diff --git a/.github/renovate.json b/.github/renovate.json index 89de9f4b3415c..f011cce4fb499 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -90,6 +90,7 @@ ], "ignoreDeps": [ "boringssl", - "com_google_googleapis" + "com_google_googleapis", + "googleapis" ] } diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c9cb43023bb06..775ea872a4aff 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -22,9 +22,9 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - name: Checkout vcpkg - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 with: path: "build/vcpkg" repository: "microsoft/vcpkg" diff --git a/.github/workflows/external-account-integration.yml b/.github/workflows/external-account-integration.yml index 3932b662c7e81..aab32c345afb2 100644 --- a/.github/workflows/external-account-integration.yml +++ b/.github/workflows/external-account-integration.yml @@ -26,7 +26,7 @@ jobs: id-token: write steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 with: ref: ${{ inputs.checkout-ref }} - id: auth diff --git a/.github/workflows/macos-cmake.yml b/.github/workflows/macos-cmake.yml index 265a4b4de208b..394313ce017bb 100644 --- a/.github/workflows/macos-cmake.yml +++ b/.github/workflows/macos-cmake.yml @@ -59,7 +59,7 @@ jobs: - exclude-from-full-trick: ${{ ! inputs.full-matrix }} shard: Other steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 with: ref: ${{ inputs.checkout-ref }} - uses: google-github-actions/auth@v2 diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 0290b589869ef..986e2d993c23a 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -106,6 +106,8 @@ jobs: execute-integration-tests: true secrets: inherit windows-cmake: + # Disabled + if: false name: Windows-CMake needs: [pre-flight] uses: ./.github/workflows/windows-cmake.yml diff --git a/.github/workflows/windows-cmake.yml b/.github/workflows/windows-cmake.yml index 9c655c71a641c..6dda386357a73 100644 --- a/.github/workflows/windows-cmake.yml +++ b/.github/workflows/windows-cmake.yml @@ -65,7 +65,7 @@ jobs: - shard: Core4 build_type: Debug steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 with: ref: ${{ inputs.checkout-ref }} - uses: google-github-actions/auth@v2 diff --git a/.typos.toml b/.typos.toml index cd164de6b395a..81e8765a472c0 100644 --- a/.typos.toml +++ b/.typos.toml @@ -32,6 +32,7 @@ extend-exclude = [ "google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_client.h", "google/cloud/resourcemanager/v3/projects_client.h", "google/cloud/securesourcemanager/v1/secure_source_manager_client.h", + "google/cloud/visionai/v1/warehouse_client.h", # The tool complains about `FIELDs` :shrug: "/google/cloud/aiplatform/v1/featurestore_client.h", # Files with binary blobs in base64 format. These are usually invalidated @@ -64,7 +65,7 @@ extend-exclude = [ "google/cloud/bigtable/ci/run_conformance_tests_proxy_bazel.sh", # ports files don't need to be checked "google/cloud/ports_def.inc", - "google/cloud/ports_undef.inc", + "google/cloud/ports_undef.inc" ] [default] diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d5bd560893fe..e33a8f77e06f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,59 @@ breaking changes in the upcoming 4.x release. This release is scheduled for **NOTE**: Please refer to the [V3 Migration Guide](/doc/v3-migration-guide.md) for details on updating existing applications using v1.x.y or v2.x.y. +## v3.5.0 - TBD + +## v3.4.0 - 2026-04 + +### [Bigtable](/google/cloud/bigtable/README.md) + +- Dynamic Channel Pool support has been added as an opt-in feature. It can be + enabled via the [InstanceChannelAffinityOption](https://github.com/googleapis/google-cloud-cpp/blob/f3de489be4caaaf17e589c7fd7e427488c474f61/google/cloud/bigtable/options.h#L186) + and configured via the [DynamicChannelPoolSizingPolicyOption](https://github.com/googleapis/google-cloud-cpp/blob/f3de489be4caaaf17e589c7fd7e427488c474f61/google/cloud/bigtable/options.h#L222). + +### [Data Catalog](/google/cloud/datacatalog/README.md) + +- Added Data Lineage Config Management library.([#16069](https://github.com/googleapis/google-cloud-cpp/pull/16069)) + +### [Dataplex](/google/cloud/dataplex/README.md) + +- Added Business Glossary library.([#16072](https://github.com/googleapis/google-cloud-cpp/pull/16072)) +- Added CMEK library.([#16072](https://github.com/googleapis/google-cloud-cpp/pull/16072)) +- Added Data Products library.([#16072](https://github.com/googleapis/google-cloud-cpp/pull/16072)) + +### [Spanner](/google/cloud/spanner/README.md) + +- feat(spanner): set read lock mode at client level ([#16068](https://github.com/googleapis/google-cloud-cpp/pull/16068)) + +### [Storage](/google/cloud/storage/README.md) + +- feat(storage): add IsOpen API for zonal read operation ([#16063](https://github.com/googleapis/google-cloud-cpp/pull/16063)) + +### [Google APIs interface definitions](https://github.com/googleapis/googleapis) + +- This release is based on definitions as of [2026-04-02T09:44:56-07:00](https://github.com/googleapis/googleapis/tree/c8ca5bce5cbabac76b8619bd8d63ac10bb0561a9) + +## v3.3.0 - 2026-03 + +### 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. + +- [Gemini Enterprise for Customer Experience API](/google/cloud/ces/README.md) +- [Cluster Director API](/google/cloud/hypercomputecluster/README.md) +- [Vector Search API](/google/cloud/vectorsearch/README.md) +- [Vision AI API](/google/cloud/visionai/README.md) +- [Workload Manager](/google/cloud/workloadmanager/README.md) + +### [Storage](/google/cloud/storage/README.md) + +- feat(storage): Get/Insert/Update/Patch Object contexts ([#15933](https://github.com/googleapis/google-cloud-cpp/pull/15933)) + +### [Google APIs interface definitions](https://github.com/googleapis/googleapis) + +- This release is based on definitions as of [2026-02-23T01:04:53-08:00](https://github.com/googleapis/googleapis/tree/edfe7983b9d99d6244b4d7636d25fa6e752a2041) + ## v3.2.0 - 2026-02 ### [Cloud Key Management Service](/google/cloud/kms/README.md) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5d973870536d..7ce073fe9de0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,9 +21,9 @@ set(PACKAGE_BUGREPORT "https://github.com/googleapis/google-cloud-cpp/issues") project( google-cloud-cpp - VERSION 3.2.0 + VERSION 3.5.0 LANGUAGES CXX) -set(PROJECT_VERSION_PRE_RELEASE "") +set(PROJECT_VERSION_PRE_RELEASE "rc") if (NOT "${PROJECT_VERSION_PRE_RELEASE}" STREQUAL "") set(PROJECT_VERSION "${PROJECT_VERSION}-${PROJECT_VERSION_PRE_RELEASE}") diff --git a/MODULE.bazel b/MODULE.bazel index 1f1fce4c464ac..e97143bc316a4 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -16,14 +16,14 @@ module( name = "google_cloud_cpp", - version = "3.2.0", # Updated by CMake + version = "3.5.0-rc", # Updated by CMake compatibility_level = 3, # Updated by CMake ) bazel_dep(name = "platforms", version = "1.0.0") -bazel_dep(name = "bazel_skylib", version = "1.8.2") +bazel_dep(name = "bazel_skylib", version = "1.9.0") bazel_dep(name = "rules_cc", version = "0.2.14") -bazel_dep(name = "abseil-cpp", version = "20250814.1") +bazel_dep(name = "abseil-cpp", version = "20250814.2") # For backwards compatibility with WORKSPACE. # The name "com_google_protobuf" is internally used by @bazel_tools, @@ -36,11 +36,11 @@ bazel_dep(name = "curl", version = "8.8.0.bcr.3") bazel_dep(name = "opentelemetry-cpp", version = "1.24.0") bazel_dep(name = "rules_proto", version = "7.1.0") bazel_dep(name = "rules_python", version = "1.6.3") -bazel_dep(name = "rules_apple", version = "4.3.2") +bazel_dep(name = "rules_apple", version = "4.3.3") bazel_dep(name = "googletest", version = "1.17.0.bcr.2") -bazel_dep(name = "google_benchmark", version = "1.9.4", dev_dependency = True, repo_name = "com_google_benchmark") -bazel_dep(name = "yaml-cpp", version = "0.8.0", dev_dependency = True, repo_name = "com_github_jbeder_yaml_cpp") +bazel_dep(name = "google_benchmark", version = "1.9.5", dev_dependency = True, repo_name = "com_google_benchmark") +bazel_dep(name = "yaml-cpp", version = "0.9.0", dev_dependency = True, repo_name = "com_github_jbeder_yaml_cpp") bazel_dep(name = "pugixml", version = "1.15", dev_dependency = True, repo_name = "com_github_zeux_pugixml") # Pin this to fix a break in bazel/deps-cache.py @@ -53,6 +53,6 @@ python.toolchain( ) bazel_dep(name = "grpc", version = "1.76.0.bcr.1") -bazel_dep(name = "googleapis", version = "0.0.0-20260223-edfe7983") -bazel_dep(name = "googleapis-cc", version = "1.0.0") -bazel_dep(name = "googleapis-grpc-cc", version = "1.0.0") +bazel_dep(name = "googleapis", version = "0.0.0-20260402-c8ca5bce") +bazel_dep(name = "googleapis-cc", version = "1.1.5") +bazel_dep(name = "googleapis-grpc-cc", version = "1.1.5") diff --git a/README.md b/README.md index 8cd44876c6272..1a100f46ea188 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,9 @@ See each library's `README.md` file for more information about: - [Certificate Manager API](google/cloud/certificatemanager/README.md) [[quickstart]](google/cloud/certificatemanager/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/certificatemanager/latest) +- [Gemini Enterprise for Customer Experience API](google/cloud/ces/README.md) + [[quickstart]](google/cloud/ces/quickstart/README.md) + [[reference]](https://cloud.google.com/cpp/docs/reference/ces/latest) - [Cloud Channel API](google/cloud/channel/README.md) [[quickstart]](google/cloud/channel/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/channel/latest) @@ -314,6 +317,9 @@ See each library's `README.md` file for more information about: - [GKE Recommender API](google/cloud/gkerecommender/README.md) [[quickstart]](google/cloud/gkerecommender/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/gkerecommender/latest) +- [Cluster Director API](google/cloud/hypercomputecluster/README.md) + [[quickstart]](google/cloud/hypercomputecluster/quickstart/README.md) + [[reference]](https://cloud.google.com/cpp/docs/reference/hypercomputecluster/latest) - [Google Cloud IAM](google/cloud/iam/README.md) [[quickstart]](google/cloud/iam/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/iam/latest) @@ -530,6 +536,9 @@ See each library's `README.md` file for more information about: - [Cloud Translation API](google/cloud/translate/README.md) [[quickstart]](google/cloud/translate/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/translate/latest) +- [Vector Search API](google/cloud/vectorsearch/README.md) + [[quickstart]](google/cloud/vectorsearch/quickstart/README.md) + [[reference]](https://cloud.google.com/cpp/docs/reference/vectorsearch/latest) - [Video Services](google/cloud/video/README.md) [[quickstart]](google/cloud/video/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/video/latest) @@ -539,6 +548,9 @@ See each library's `README.md` file for more information about: - [Cloud Vision API](google/cloud/vision/README.md) [[quickstart]](google/cloud/vision/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/vision/latest) +- [Vision AI API](google/cloud/visionai/README.md) + [[quickstart]](google/cloud/visionai/quickstart/README.md) + [[reference]](https://cloud.google.com/cpp/docs/reference/visionai/latest) - [VM Migration API](google/cloud/vmmigration/README.md) [[quickstart]](google/cloud/vmmigration/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/vmmigration/latest) @@ -557,6 +569,9 @@ See each library's `README.md` file for more information about: - [Workflow Executions API](google/cloud/workflows/README.md) [[quickstart]](google/cloud/workflows/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/workflows/latest) +- [Workload Manager API](google/cloud/workloadmanager/README.md) + [[quickstart]](google/cloud/workloadmanager/quickstart/README.md) + [[reference]](https://cloud.google.com/cpp/docs/reference/workloadmanager/latest) - [Cloud Workstations API](google/cloud/workstations/README.md) [[quickstart]](google/cloud/workstations/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/workstations/latest) diff --git a/bazel/development0.bzl b/bazel/development0.bzl index c3f3affd573be..de51d28a5f39d 100644 --- a/bazel/development0.bzl +++ b/bazel/development0.bzl @@ -57,10 +57,10 @@ def gl_cpp_development0(name = None): http_archive, name = "com_google_benchmark", urls = [ - "https://github.com/google/benchmark/archive/v1.9.2.tar.gz", + "https://github.com/google/benchmark/archive/v1.9.5.tar.gz", ], - sha256 = "409075176168dc46bbb81b74c1b4b6900385b5d16bfc181d678afb060d928bd3", - strip_prefix = "benchmark-1.9.2", + sha256 = "9631341c82bac4a288bef951f8b26b41f69021794184ece969f8473977eaa340", + strip_prefix = "benchmark-1.9.5", ) # A YAML parser and generator, this is only used in //docfx and //generator. @@ -69,8 +69,8 @@ def gl_cpp_development0(name = None): http_archive, name = "com_github_jbeder_yaml_cpp", urls = [ - "https://github.com/jbeder/yaml-cpp/archive/0.8.0.tar.gz", + "https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.9.0.tar.gz", ], - sha256 = "fbe74bbdcee21d656715688706da3c8becfd946d92cd44705cc6098bb23b3a16", - strip_prefix = "yaml-cpp-0.8.0", + sha256 = "25cb043240f828a8c51beb830569634bc7ac603978e0f69d6b63558dadefd49a", + strip_prefix = "yaml-cpp-yaml-cpp-0.9.0", ) diff --git a/bazel/workspace0.bzl b/bazel/workspace0.bzl index 31bea0558b97c..8d3d5cdc48773 100644 --- a/bazel/workspace0.bzl +++ b/bazel/workspace0.bzl @@ -91,10 +91,10 @@ def gl_cpp_workspace0(name = None): maybe( http_archive, name = "bazel_skylib", - sha256 = "6e78f0e57de26801f6f564fa7c4a48dc8b36873e416257a92bbb0937eeac8446", + sha256 = "3b5b49006181f5f8ff626ef8ddceaa95e9bb8ad294f7b5d7b11ea9f7ddaf8c59", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.8.2/bazel-skylib-1.8.2.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.8.2/bazel-skylib-1.8.2.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.9.0/bazel-skylib-1.9.0.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.9.0/bazel-skylib-1.9.0.tar.gz", ], ) @@ -103,9 +103,9 @@ def gl_cpp_workspace0(name = None): http_archive, name = "build_bazel_rules_apple", urls = [ - "https://github.com/bazelbuild/rules_apple/releases/download/4.2.0/rules_apple.4.2.0.tar.gz", + "https://github.com/bazelbuild/rules_apple/releases/download/4.3.3/rules_apple.4.3.3.tar.gz", ], - sha256 = "ef8a5744b2ffff49f47647226f69f0f06522ca2e8a6fa1aaf5d65d5314813c34", + sha256 = "fad623b4d0dbe7883fffc95a3275eaabfd13bd9336fca6788cb40bee96e5f131", ) # Load Abseil @@ -113,10 +113,10 @@ def gl_cpp_workspace0(name = None): http_archive, name = "abseil-cpp", urls = [ - "https://github.com/abseil/abseil-cpp/archive/20250512.1.tar.gz", + "https://github.com/abseil/abseil-cpp/archive/20250512.2.tar.gz", ], - sha256 = "9b7a064305e9fd94d124ffa6cc358592eb42b5da588fb4e07d09254aa40086db", - strip_prefix = "abseil-cpp-20250512.1", + sha256 = "71358f2e72e945d280bfab44090eacb3f98e10fead31fd97876f05a835510d92", + strip_prefix = "abseil-cpp-20250512.2", ) # Load a version of googletest that we know works. This is needed to create @@ -136,10 +136,10 @@ def gl_cpp_workspace0(name = None): http_archive, name = "googleapis", urls = [ - "https://github.com/googleapis/googleapis/archive/edfe7983b9d99d6244b4d7636d25fa6e752a2041.tar.gz", + "https://github.com/googleapis/googleapis/archive/c8ca5bce5cbabac76b8619bd8d63ac10bb0561a9.tar.gz", ], - sha256 = "daf93e1331c16fab7606828bcdc92aa72160718de0819eb628fae9922ccaadfc", - strip_prefix = "googleapis-edfe7983b9d99d6244b4d7636d25fa6e752a2041", + sha256 = "8ce00cdda7a5c1595fc539b2611f7084344bd08dd07d6e0be03068afb4bc6e8a", + strip_prefix = "googleapis-c8ca5bce5cbabac76b8619bd8d63ac10bb0561a9", build_file = Label("//bazel:googleapis.BUILD"), # Scaffolding for patching googleapis after download. For example: patches = [ diff --git a/ci/abi-dumps/google_cloud_cpp_accessapproval.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_accessapproval.expected.abi.dump.gz index 86603a4220def..6736f1d61a94e 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_accessapproval.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_accessapproval.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_accesscontextmanager.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_accesscontextmanager.expected.abi.dump.gz index fe6a2945082fd..f8437833053db 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_accesscontextmanager.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_accesscontextmanager.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_advisorynotifications.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_advisorynotifications.expected.abi.dump.gz index 2c67b002bd509..b20f425295031 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_advisorynotifications.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_advisorynotifications.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_aiplatform.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_aiplatform.expected.abi.dump.gz index 0c362c7bae104..063277c9ec114 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_aiplatform.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_aiplatform.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_alloydb.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_alloydb.expected.abi.dump.gz index fe6efd3ac8bf3..21fef2c500a79 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_alloydb.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_alloydb.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_apigateway.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_apigateway.expected.abi.dump.gz index 7884eeb219fcc..fbe94f76dd034 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_apigateway.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_apigateway.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_apigeeconnect.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_apigeeconnect.expected.abi.dump.gz index 95bb463e58126..ea6cc7bc14b09 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_apigeeconnect.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_apigeeconnect.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_apikeys.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_apikeys.expected.abi.dump.gz index 0e01d9fe11b04..6eab0d8536db3 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_apikeys.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_apikeys.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_apiregistry.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_apiregistry.expected.abi.dump.gz index e8dd563263f35..8845887554f3a 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_apiregistry.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_apiregistry.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_appengine.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_appengine.expected.abi.dump.gz index 5e2cf0e061d4f..4ec3c642e8d85 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_appengine.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_appengine.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_apphub.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_apphub.expected.abi.dump.gz index cc026fcb88008..bbe0c6e837f29 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_apphub.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_apphub.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_artifactregistry.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_artifactregistry.expected.abi.dump.gz index 0ca60c14247dc..4711938f84ff3 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_artifactregistry.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_artifactregistry.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_asset.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_asset.expected.abi.dump.gz index 7d2c3c235b89b..b8b32f74f05e4 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_asset.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_asset.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_assuredworkloads.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_assuredworkloads.expected.abi.dump.gz index ad05fb9658524..faa72ddd0e4d0 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_assuredworkloads.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_assuredworkloads.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_auditmanager.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_auditmanager.expected.abi.dump.gz index 1629db610f5a2..0c6412c5b4777 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_auditmanager.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_auditmanager.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_automl.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_automl.expected.abi.dump.gz index 56a6810d2c678..cd353112e562b 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_automl.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_automl.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_backupdr.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_backupdr.expected.abi.dump.gz index 2897c0c5add93..ee97b14297168 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_backupdr.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_backupdr.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_baremetalsolution.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_baremetalsolution.expected.abi.dump.gz index 9c7e3192012d7..ef7c1103b431c 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_baremetalsolution.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_baremetalsolution.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_batch.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_batch.expected.abi.dump.gz index 8bc23f6809e7b..4ee27ae8c167d 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_batch.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_batch.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_beyondcorp.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_beyondcorp.expected.abi.dump.gz index 654be005697b6..859a75a4de12c 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_beyondcorp.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_beyondcorp.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_bigquery.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_bigquery.expected.abi.dump.gz index 43ff0141795e2..a7774f0aed68f 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_bigquery.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_bigquery.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_bigquerycontrol.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_bigquerycontrol.expected.abi.dump.gz index bde3a0dd43c2b..83cad01e918e4 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_bigquerycontrol.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_bigquerycontrol.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_bigtable.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_bigtable.expected.abi.dump.gz index 4750d1f20af06..169a435f4200c 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_bigtable.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_bigtable.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_billing.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_billing.expected.abi.dump.gz index 3ac8279380b92..bd555b30041d3 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_billing.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_billing.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_binaryauthorization.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_binaryauthorization.expected.abi.dump.gz index d2b4a70fa57ed..baf8ea1cca60c 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_binaryauthorization.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_binaryauthorization.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_certificatemanager.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_certificatemanager.expected.abi.dump.gz index 21a4c3e4ab7b9..d0423964d7578 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_certificatemanager.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_certificatemanager.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_ces.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_ces.expected.abi.dump.gz new file mode 100644 index 0000000000000..d7c8c2c82a206 Binary files /dev/null and b/ci/abi-dumps/google_cloud_cpp_ces.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_channel.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_channel.expected.abi.dump.gz index 2f95156c19d33..90e08e0384ab4 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_channel.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_channel.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_chronicle.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_chronicle.expected.abi.dump.gz index 6e1e7ee7dff48..652527b0d4588 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_chronicle.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_chronicle.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_cloudbuild.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_cloudbuild.expected.abi.dump.gz index 547e27bb8eff9..62f1d5d33d47a 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_cloudbuild.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_cloudbuild.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_cloudcontrolspartner.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_cloudcontrolspartner.expected.abi.dump.gz index 56d1a7db52aab..f0d0bb3aacb43 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_cloudcontrolspartner.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_cloudcontrolspartner.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_cloudquotas.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_cloudquotas.expected.abi.dump.gz index 77cb4764ebf33..4a6aa7c439215 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_cloudquotas.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_cloudquotas.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_cloudsecuritycompliance.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_cloudsecuritycompliance.expected.abi.dump.gz index 35732a324fb47..94f0c1c8a9766 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_cloudsecuritycompliance.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_cloudsecuritycompliance.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_commerce.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_commerce.expected.abi.dump.gz index a705699753084..c90c09c7aab2d 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_commerce.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_commerce.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_common.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_common.expected.abi.dump.gz index 76394fa184487..50e07e37a2084 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_common.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_common.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_composer.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_composer.expected.abi.dump.gz index fff4f208bf22c..444f095005c71 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_composer.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_composer.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_accelerator_types.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_accelerator_types.expected.abi.dump.gz index 887e017b39596..6b6800c04c574 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_accelerator_types.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_accelerator_types.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_addresses.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_addresses.expected.abi.dump.gz index a5087e79526b8..bc0b059245a87 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_addresses.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_addresses.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_autoscalers.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_autoscalers.expected.abi.dump.gz index f6a03c282f8f9..523f33152c2b6 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_autoscalers.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_autoscalers.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_backend_buckets.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_backend_buckets.expected.abi.dump.gz index 4dd6f31eb535a..2fd632e010e78 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_backend_buckets.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_backend_buckets.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_backend_services.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_backend_services.expected.abi.dump.gz index 4b3bbb2700485..dfb8292c3bdf1 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_backend_services.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_backend_services.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_disk_types.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_disk_types.expected.abi.dump.gz index a6025ff43d162..2e6a45b30e601 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_disk_types.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_disk_types.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_disks.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_disks.expected.abi.dump.gz index f07210bff90d7..035096476b638 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_disks.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_disks.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_external_vpn_gateways.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_external_vpn_gateways.expected.abi.dump.gz index 36ab0a95c821e..78309b5ea85ce 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_external_vpn_gateways.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_external_vpn_gateways.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_firewall_policies.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_firewall_policies.expected.abi.dump.gz index 6f75a193b92ee..4742052ecd246 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_firewall_policies.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_firewall_policies.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_firewalls.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_firewalls.expected.abi.dump.gz index 2b83277bff1fc..43040046e225d 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_firewalls.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_firewalls.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_forwarding_rules.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_forwarding_rules.expected.abi.dump.gz index e124687a81794..0726c1c914aa0 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_forwarding_rules.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_forwarding_rules.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_global_addresses.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_global_addresses.expected.abi.dump.gz index 79b513f0c80da..e15e721a41921 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_global_addresses.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_global_addresses.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_global_forwarding_rules.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_global_forwarding_rules.expected.abi.dump.gz index a7022bced730f..4e28eb55ad42c 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_global_forwarding_rules.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_global_forwarding_rules.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_global_network_endpoint_groups.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_global_network_endpoint_groups.expected.abi.dump.gz index 9acb7eb2f9937..3c7e8d30da965 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_global_network_endpoint_groups.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_global_network_endpoint_groups.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_global_operations.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_global_operations.expected.abi.dump.gz index a180e131c648d..3664ff57353be 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_global_operations.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_global_operations.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_global_organization_operations.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_global_organization_operations.expected.abi.dump.gz index 3bc6eb68d02c3..fde682cad7b0f 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_global_organization_operations.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_global_organization_operations.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_global_public_delegated_prefixes.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_global_public_delegated_prefixes.expected.abi.dump.gz index 30d294eb678d2..dfd28afaa7e63 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_global_public_delegated_prefixes.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_global_public_delegated_prefixes.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_health_checks.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_health_checks.expected.abi.dump.gz index 0952899830432..1ba21f3d77d8c 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_health_checks.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_health_checks.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_http_health_checks.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_http_health_checks.expected.abi.dump.gz index cfcaa1ef3acf2..7f2df5b3cae44 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_http_health_checks.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_http_health_checks.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_https_health_checks.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_https_health_checks.expected.abi.dump.gz index d110c1d5cf39e..94d8dbf982833 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_https_health_checks.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_https_health_checks.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_image_family_views.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_image_family_views.expected.abi.dump.gz index e65bd3c1960e4..5fa2cb4e55b5e 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_image_family_views.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_image_family_views.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_images.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_images.expected.abi.dump.gz index de6da4ef8f2f6..a7ffb3d2d9fb4 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_images.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_images.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_instance_group_managers.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_instance_group_managers.expected.abi.dump.gz index f32556e992ac6..3d342055f7c62 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_instance_group_managers.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_instance_group_managers.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_instance_groups.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_instance_groups.expected.abi.dump.gz index 7c408cde42197..92a5a5c79618c 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_instance_groups.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_instance_groups.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_instance_templates.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_instance_templates.expected.abi.dump.gz index b8ad39b7d0e9a..068f5894f98ea 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_instance_templates.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_instance_templates.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_instances.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_instances.expected.abi.dump.gz index 812292867c139..d37525079d8ac 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_instances.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_instances.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_interconnect_attachments.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_interconnect_attachments.expected.abi.dump.gz index 34b2fe72bad09..04cb6dd409e86 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_interconnect_attachments.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_interconnect_attachments.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_interconnect_locations.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_interconnect_locations.expected.abi.dump.gz index 6ec40c67669e0..f74e691a6dbd1 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_interconnect_locations.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_interconnect_locations.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_interconnects.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_interconnects.expected.abi.dump.gz index 493aa82172e08..d1e295489baac 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_interconnects.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_interconnects.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_license_codes.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_license_codes.expected.abi.dump.gz index b1773b9569a3b..e3d825e17ac8a 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_license_codes.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_license_codes.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_licenses.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_licenses.expected.abi.dump.gz index 2e4ebfaaa09ce..066ee71ca95b1 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_licenses.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_licenses.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_machine_images.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_machine_images.expected.abi.dump.gz index 08edff69ccf89..dbf45016dbf05 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_machine_images.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_machine_images.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_machine_types.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_machine_types.expected.abi.dump.gz index 7c543a289db7d..7b78cfa4ec1c5 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_machine_types.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_machine_types.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_network_attachments.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_network_attachments.expected.abi.dump.gz index 09ce1f22694b4..cee6ee970ffb3 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_network_attachments.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_network_attachments.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_network_edge_security_services.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_network_edge_security_services.expected.abi.dump.gz index b43956e38115a..d83256fbe38ea 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_network_edge_security_services.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_network_edge_security_services.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_network_endpoint_groups.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_network_endpoint_groups.expected.abi.dump.gz index 8ae690dfbe11b..7e1aa11584aa4 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_network_endpoint_groups.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_network_endpoint_groups.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_network_firewall_policies.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_network_firewall_policies.expected.abi.dump.gz index a04b0717d2537..d2ff6409af239 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_network_firewall_policies.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_network_firewall_policies.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_networks.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_networks.expected.abi.dump.gz index 4df89941433d6..a533b3c9ccb3d 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_networks.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_networks.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_node_groups.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_node_groups.expected.abi.dump.gz index eb6fb9de30118..fe878468f2b92 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_node_groups.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_node_groups.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_node_templates.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_node_templates.expected.abi.dump.gz index b5583717f2247..cd6066d7979b2 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_node_templates.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_node_templates.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_node_types.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_node_types.expected.abi.dump.gz index 957e6ba6604f9..d058d017d5e61 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_node_types.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_node_types.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_packet_mirrorings.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_packet_mirrorings.expected.abi.dump.gz index 97296dbe89ee8..8d5481ca6c952 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_packet_mirrorings.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_packet_mirrorings.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_projects.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_projects.expected.abi.dump.gz index 071763f694a5e..c38faa236fb1a 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_projects.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_projects.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_public_advertised_prefixes.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_public_advertised_prefixes.expected.abi.dump.gz index 772b0d1de566c..36e1db9fb1842 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_public_advertised_prefixes.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_public_advertised_prefixes.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_public_delegated_prefixes.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_public_delegated_prefixes.expected.abi.dump.gz index 3c3f25a5295d8..c23b9a826e9c2 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_public_delegated_prefixes.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_public_delegated_prefixes.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_autoscalers.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_autoscalers.expected.abi.dump.gz index f70ec92ad0973..a046a0072efd8 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_autoscalers.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_autoscalers.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_backend_services.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_backend_services.expected.abi.dump.gz index 3952fe846de46..4e58714938275 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_backend_services.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_backend_services.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_commitments.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_commitments.expected.abi.dump.gz index 3eb377c7f023f..7194417c4e76e 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_commitments.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_commitments.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_disk_types.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_disk_types.expected.abi.dump.gz index a9ee8abb39fd4..012aa9c3f560a 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_disk_types.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_disk_types.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_disks.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_disks.expected.abi.dump.gz index d35f31ffa26d2..b9df5b29d52ab 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_disks.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_disks.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_health_check_services.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_health_check_services.expected.abi.dump.gz index 1ac2a189f3164..5430c2d364f4c 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_health_check_services.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_health_check_services.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_health_checks.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_health_checks.expected.abi.dump.gz index aec907f2e218b..bf95c590b5737 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_health_checks.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_health_checks.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_instance_group_managers.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_instance_group_managers.expected.abi.dump.gz index fa170d81443a4..fbf42dc80071b 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_instance_group_managers.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_instance_group_managers.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_instance_groups.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_instance_groups.expected.abi.dump.gz index 778884f54ec14..5282711ddf51d 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_instance_groups.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_instance_groups.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_instance_templates.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_instance_templates.expected.abi.dump.gz index 285a6b6b787c1..57714fbe9e5b4 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_instance_templates.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_instance_templates.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_instances.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_instances.expected.abi.dump.gz index 434e6d75da3a4..fe01d8f8a1214 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_instances.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_instances.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_network_endpoint_groups.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_network_endpoint_groups.expected.abi.dump.gz index d519bc43e7406..ee5f165e08ce6 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_network_endpoint_groups.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_network_endpoint_groups.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_network_firewall_policies.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_network_firewall_policies.expected.abi.dump.gz index 18104ea6cf928..56f0a73fd37ea 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_network_firewall_policies.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_network_firewall_policies.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_notification_endpoints.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_notification_endpoints.expected.abi.dump.gz index 2af5639589235..27c60a32c5549 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_notification_endpoints.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_notification_endpoints.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_operations.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_operations.expected.abi.dump.gz index 31cf323974e0f..ca8dde80be4d9 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_operations.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_operations.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_security_policies.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_security_policies.expected.abi.dump.gz index 8888ca97428e1..8076cc0b4105e 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_security_policies.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_security_policies.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_region_ssl_certificates.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_region_ssl_certificates.expected.abi.dump.gz index b35fd9817cb0e..075ce1887ae45 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_region_ssl_certificates.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_region_ssl_certificates.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_ssl_policies.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_ssl_policies.expected.abi.dump.gz index fb069ae63c3ca..95b2262f6e3e7 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_ssl_policies.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_ssl_policies.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_subnetworks.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_subnetworks.expected.abi.dump.gz index 86b398a2a5691..a55f513804119 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_subnetworks.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_subnetworks.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_target_grpc_proxies.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_target_grpc_proxies.expected.abi.dump.gz index 2afd684bb94b6..87eb5906afc28 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_target_grpc_proxies.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_target_grpc_proxies.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_target_http_proxies.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_target_http_proxies.expected.abi.dump.gz index e4bd8829e502e..93b94f31b753b 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_target_http_proxies.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_target_http_proxies.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_target_https_proxies.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_target_https_proxies.expected.abi.dump.gz index 83c50a0d5a5d5..7eb3fe5de8b7e 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_target_https_proxies.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_target_https_proxies.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_target_instances.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_target_instances.expected.abi.dump.gz index e2b1a882321db..ff91b0392291f 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_target_instances.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_target_instances.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_target_pools.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_target_pools.expected.abi.dump.gz index 2b8b70de20324..df753fb57330a 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_target_pools.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_target_pools.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_target_ssl_proxies.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_target_ssl_proxies.expected.abi.dump.gz index 9ae3f4db51321..ec75f806bd9a2 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_target_ssl_proxies.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_target_ssl_proxies.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_target_tcp_proxies.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_target_tcp_proxies.expected.abi.dump.gz index f532c5bf803ac..cb2300e70bf14 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_target_tcp_proxies.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_target_tcp_proxies.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_target_vpn_gateways.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_target_vpn_gateways.expected.abi.dump.gz index 10b3210ce88f1..62fd92effb09d 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_target_vpn_gateways.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_target_vpn_gateways.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_url_maps.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_url_maps.expected.abi.dump.gz index 3ecda64f08fb3..a3a7ccd1f4d5a 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_url_maps.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_url_maps.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_vpn_gateways.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_vpn_gateways.expected.abi.dump.gz index e7efacd834b4b..5c2e3282c4def 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_vpn_gateways.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_vpn_gateways.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_vpn_tunnels.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_vpn_tunnels.expected.abi.dump.gz index 7e9168627abfd..cdcce94e59a65 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_vpn_tunnels.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_vpn_tunnels.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_zone_operations.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_zone_operations.expected.abi.dump.gz index 36627046fff0c..0908a4528b2fb 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_zone_operations.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_zone_operations.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_compute_zones.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_compute_zones.expected.abi.dump.gz index e81590bf6c3dd..c753da4f85061 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_compute_zones.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_compute_zones.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_confidentialcomputing.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_confidentialcomputing.expected.abi.dump.gz index b90548c60b836..92ad01786fcb6 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_confidentialcomputing.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_confidentialcomputing.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_config.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_config.expected.abi.dump.gz index 46d58e596f7dd..5353f1dfb2a47 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_config.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_config.expected.abi.dump.gz differ 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 index 69e20a97d7bb1..ebca496119fef 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_configdelivery.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_configdelivery.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_connectors.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_connectors.expected.abi.dump.gz index aeebf23261900..2c0e6acac0f87 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_connectors.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_connectors.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_contactcenterinsights.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_contactcenterinsights.expected.abi.dump.gz index 12806ee111eeb..52f31ffea1977 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_contactcenterinsights.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_contactcenterinsights.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_container.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_container.expected.abi.dump.gz index 9a4917af788e7..ed48353b1ef2e 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_container.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_container.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_containeranalysis.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_containeranalysis.expected.abi.dump.gz index ddb17d8cd2932..08eb5cd39f3a3 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_containeranalysis.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_containeranalysis.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_contentwarehouse.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_contentwarehouse.expected.abi.dump.gz index e3570da31a109..7667f54b817cf 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_contentwarehouse.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_contentwarehouse.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_datacatalog.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_datacatalog.expected.abi.dump.gz index d2a84c13324f2..3ada95e858650 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_datacatalog.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_datacatalog.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_dataform.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_dataform.expected.abi.dump.gz index 594e714ee7d5b..fc16867068c70 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_dataform.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_dataform.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_datafusion.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_datafusion.expected.abi.dump.gz index 3a329365407e3..851ebaf27cc75 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_datafusion.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_datafusion.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_datamigration.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_datamigration.expected.abi.dump.gz index ae1245e1f4e6c..22334aceb3e1e 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_datamigration.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_datamigration.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_dataplex.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_dataplex.expected.abi.dump.gz index 9d3380ec0116e..6755d126681ce 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_dataplex.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_dataplex.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_dataproc.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_dataproc.expected.abi.dump.gz index 097d168b12f07..201928faeec55 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_dataproc.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_dataproc.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_datastore.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_datastore.expected.abi.dump.gz index 00e2121845c07..794bd3bc20876 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_datastore.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_datastore.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_datastream.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_datastream.expected.abi.dump.gz index 9d3a6e8751681..d57de681cd1cb 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_datastream.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_datastream.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_deploy.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_deploy.expected.abi.dump.gz index 38db1b2103167..4037bb969693b 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_deploy.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_deploy.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_developerconnect.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_developerconnect.expected.abi.dump.gz index 7fdf753b57e9a..f72512585a651 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_developerconnect.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_developerconnect.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_devicestreaming.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_devicestreaming.expected.abi.dump.gz index 6c510721a8cf3..62d71dfc69fb3 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_devicestreaming.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_devicestreaming.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_dialogflow_cx.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_dialogflow_cx.expected.abi.dump.gz index efc17a3d20bec..b570666deb6de 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_dialogflow_cx.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_dialogflow_cx.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_dialogflow_es.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_dialogflow_es.expected.abi.dump.gz index 709feab3cf5c0..ee8dfc38ef26a 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_dialogflow_es.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_dialogflow_es.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_discoveryengine.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_discoveryengine.expected.abi.dump.gz index 6c94158cd737f..77e262382852d 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_discoveryengine.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_discoveryengine.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_dlp.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_dlp.expected.abi.dump.gz index 42ca30baf43ca..a2298ff64ea2f 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_dlp.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_dlp.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_documentai.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_documentai.expected.abi.dump.gz index dbd8ea7aae0ff..cd19ec8624925 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_documentai.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_documentai.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_domains.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_domains.expected.abi.dump.gz index c8977005debbd..2141cb2290904 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_domains.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_domains.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_edgecontainer.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_edgecontainer.expected.abi.dump.gz index 45ff72d8560f6..e388f2fbc836c 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_edgecontainer.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_edgecontainer.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_edgenetwork.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_edgenetwork.expected.abi.dump.gz index 66809baf6abc7..459c52c320e60 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_edgenetwork.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_edgenetwork.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_essentialcontacts.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_essentialcontacts.expected.abi.dump.gz index 2058c816fe1f1..792215f038249 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_essentialcontacts.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_essentialcontacts.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_eventarc.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_eventarc.expected.abi.dump.gz index 301a083d6dea7..80b75d5c7c069 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_eventarc.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_eventarc.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_filestore.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_filestore.expected.abi.dump.gz index 6713cd360163c..f3abd0b3b5b27 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_filestore.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_filestore.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_financialservices.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_financialservices.expected.abi.dump.gz index 348670886bba2..1685629f73486 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_financialservices.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_financialservices.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_functions.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_functions.expected.abi.dump.gz index 6dd5dd24c347e..b8efbc718b989 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_functions.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_functions.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_gkebackup.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_gkebackup.expected.abi.dump.gz index 8396bff9b7fc0..4bc89a39bdcd2 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_gkebackup.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_gkebackup.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_gkeconnect.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_gkeconnect.expected.abi.dump.gz index 10c84ee710bda..055a78a989113 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_gkeconnect.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_gkeconnect.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_gkehub.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_gkehub.expected.abi.dump.gz index f0073d9088b8f..eb8e0fb171d00 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_gkehub.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_gkehub.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_gkemulticloud.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_gkemulticloud.expected.abi.dump.gz index c05019a8f5188..407cfd615c344 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_gkemulticloud.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_gkemulticloud.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_gkerecommender.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_gkerecommender.expected.abi.dump.gz index 3db9acd736bd1..ab3a2ae8f962e 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_gkerecommender.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_gkerecommender.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_grpc_utils.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_grpc_utils.expected.abi.dump.gz index 21be369c00ae2..cce82d7c1d968 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_grpc_utils.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_grpc_utils.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_hypercomputecluster.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_hypercomputecluster.expected.abi.dump.gz new file mode 100644 index 0000000000000..ca46cf2fbbcbc Binary files /dev/null and b/ci/abi-dumps/google_cloud_cpp_hypercomputecluster.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_iam.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_iam.expected.abi.dump.gz index 11385164a2d3e..cb5535dcd4b45 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_iam.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_iam.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_iap.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_iap.expected.abi.dump.gz index 72ae1ae4665f9..98119be572ade 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_iap.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_iap.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_ids.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_ids.expected.abi.dump.gz index 45ae06848be61..9216792858e67 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_ids.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_ids.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_kms.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_kms.expected.abi.dump.gz index 9f0b1dfd92a87..f905fabeccfb8 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_kms.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_kms.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_language.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_language.expected.abi.dump.gz index 0f218df9888a6..09a55d62e39fc 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_language.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_language.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_licensemanager.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_licensemanager.expected.abi.dump.gz index 4d70433ac14d6..3f11b1fb7f8ef 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_licensemanager.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_licensemanager.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_logging.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_logging.expected.abi.dump.gz index 6b005975432c8..3832311947af0 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_logging.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_logging.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_lustre.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_lustre.expected.abi.dump.gz index 582e40baef5ef..a19b046a01963 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_lustre.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_lustre.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_maintenance.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_maintenance.expected.abi.dump.gz index 29875486555e3..c15e14067fe3a 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_maintenance.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_maintenance.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_managedidentities.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_managedidentities.expected.abi.dump.gz index 3daa0fb3ec106..7748b59da2ab6 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_managedidentities.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_managedidentities.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_managedkafka.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_managedkafka.expected.abi.dump.gz index f8102b43007ff..b49b5b67f0ef7 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_managedkafka.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_managedkafka.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_memcache.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_memcache.expected.abi.dump.gz index bed72ed0b87e0..9e51683abbc2b 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_memcache.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_memcache.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_memorystore.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_memorystore.expected.abi.dump.gz index d272d81fcb703..06e5cb63048fb 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_memorystore.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_memorystore.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_metastore.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_metastore.expected.abi.dump.gz index 35111ce04ea82..b5292a9cf0192 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_metastore.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_metastore.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_migrationcenter.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_migrationcenter.expected.abi.dump.gz index 0ef3e00930fd8..e73c9822cfeff 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_migrationcenter.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_migrationcenter.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_monitoring.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_monitoring.expected.abi.dump.gz index 63ca9c3ff7cbf..9e65dee453db5 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_monitoring.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_monitoring.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_netapp.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_netapp.expected.abi.dump.gz index 22d8942da8f7f..8a3bba4cdf9cf 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_netapp.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_netapp.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_networkconnectivity.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_networkconnectivity.expected.abi.dump.gz index f495f14bb98fb..c77e15f6a5aa4 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_networkconnectivity.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_networkconnectivity.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_networkmanagement.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_networkmanagement.expected.abi.dump.gz index 5a1f5f8f2d582..bd8ec003783e7 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_networkmanagement.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_networkmanagement.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_networksecurity.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_networksecurity.expected.abi.dump.gz index 649d3a4fd13d9..13a30c650399e 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_networksecurity.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_networksecurity.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_networkservices.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_networkservices.expected.abi.dump.gz index c4e113f3fa6bb..562e4c9650124 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_networkservices.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_networkservices.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_notebooks.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_notebooks.expected.abi.dump.gz index 9531b347bfc74..ea8c24fa2f8ea 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_notebooks.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_notebooks.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_oauth2.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_oauth2.expected.abi.dump.gz index 38ec7274cd3cf..a70329ccefbe1 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_oauth2.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_oauth2.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_opentelemetry.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_opentelemetry.expected.abi.dump.gz index c693c0acfe09c..2955a64473aa8 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_opentelemetry.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_opentelemetry.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_optimization.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_optimization.expected.abi.dump.gz index 377746842bd15..cd35f04292c7c 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_optimization.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_optimization.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_oracledatabase.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_oracledatabase.expected.abi.dump.gz index faa6778b81e0f..bd6cc1c3aa339 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_oracledatabase.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_oracledatabase.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_orgpolicy.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_orgpolicy.expected.abi.dump.gz index 3441a4303bdac..949bfa2b52719 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_orgpolicy.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_orgpolicy.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_osconfig.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_osconfig.expected.abi.dump.gz index 199f0e1225afa..53431d6df9476 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_osconfig.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_osconfig.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_oslogin.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_oslogin.expected.abi.dump.gz index 3c3c7b4af1010..efe9371ac2a4a 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_oslogin.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_oslogin.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_parallelstore.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_parallelstore.expected.abi.dump.gz index 9306d5a29c3b8..d284247895d79 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_parallelstore.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_parallelstore.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_parametermanager.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_parametermanager.expected.abi.dump.gz index 0dd432483011c..644ce8bdea53e 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_parametermanager.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_parametermanager.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_policysimulator.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_policysimulator.expected.abi.dump.gz index b3c14ec74dfe6..d47085a25b6c3 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_policysimulator.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_policysimulator.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_policytroubleshooter.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_policytroubleshooter.expected.abi.dump.gz index 11e44e19c90af..1da3be44060fe 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_policytroubleshooter.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_policytroubleshooter.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_privateca.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_privateca.expected.abi.dump.gz index fc9c8db77a7c6..1ca3b03d220e0 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_privateca.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_privateca.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_privilegedaccessmanager.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_privilegedaccessmanager.expected.abi.dump.gz index b6d9fe648ca47..577904e8a03b4 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_privilegedaccessmanager.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_privilegedaccessmanager.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_profiler.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_profiler.expected.abi.dump.gz index f8389b674d5ac..a98e55239e83b 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_profiler.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_profiler.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_publicca.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_publicca.expected.abi.dump.gz index 40609de9f281b..0a90f00b3d5fb 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_publicca.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_publicca.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_pubsub.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_pubsub.expected.abi.dump.gz index b6ba0228e51a3..c748b548018e3 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_pubsub.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_pubsub.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_rapidmigrationassessment.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_rapidmigrationassessment.expected.abi.dump.gz index 3134d4537d210..bedefa95e4d7a 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_rapidmigrationassessment.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_rapidmigrationassessment.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_recaptchaenterprise.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_recaptchaenterprise.expected.abi.dump.gz index 3bf33411c9b7e..312b4be219ff9 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_recaptchaenterprise.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_recaptchaenterprise.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_recommender.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_recommender.expected.abi.dump.gz index ec65fbd1103cc..49fdeab47ec9a 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_recommender.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_recommender.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_redis.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_redis.expected.abi.dump.gz index 7ddfef6b3498d..4ec5c59f15d55 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_redis.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_redis.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_resourcemanager.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_resourcemanager.expected.abi.dump.gz index f1dcf76085c0a..ebe75a51afd86 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_resourcemanager.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_resourcemanager.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_retail.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_retail.expected.abi.dump.gz index fa14242f69803..f1d8730395ba0 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_retail.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_retail.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_run.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_run.expected.abi.dump.gz index a6748d46b9fdf..8a038bc9939c2 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_run.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_run.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_scheduler.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_scheduler.expected.abi.dump.gz index 6e86e9d4c9a1c..354125d05e8b0 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_scheduler.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_scheduler.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_secretmanager.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_secretmanager.expected.abi.dump.gz index 8d15e40102491..52286853077a5 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_secretmanager.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_secretmanager.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_securesourcemanager.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_securesourcemanager.expected.abi.dump.gz index 92d8c976ff7e0..2bd0a271f2157 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_securesourcemanager.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_securesourcemanager.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_securitycenter.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_securitycenter.expected.abi.dump.gz index a70412cc7321c..62cec308b98b9 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_securitycenter.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_securitycenter.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_securitycentermanagement.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_securitycentermanagement.expected.abi.dump.gz index 0b36fcdf3ace4..736c54408e505 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_securitycentermanagement.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_securitycentermanagement.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_servicecontrol.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_servicecontrol.expected.abi.dump.gz index 2f9e6ff258508..ad8ce9eb8d530 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_servicecontrol.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_servicecontrol.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_servicedirectory.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_servicedirectory.expected.abi.dump.gz index 09ab7a1eba94e..53c2b95b61f65 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_servicedirectory.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_servicedirectory.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_servicehealth.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_servicehealth.expected.abi.dump.gz index 2728e83b9ccfd..4b40d86b4fd26 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_servicehealth.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_servicehealth.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_servicemanagement.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_servicemanagement.expected.abi.dump.gz index bcada30099867..7a3a73105c60d 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_servicemanagement.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_servicemanagement.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_serviceusage.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_serviceusage.expected.abi.dump.gz index 3dda34d5554f8..0761ba34374c9 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_serviceusage.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_serviceusage.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_shell.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_shell.expected.abi.dump.gz index 65895dc3c88b5..fd4a3bc2069de 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_shell.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_shell.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_spanner.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_spanner.expected.abi.dump.gz index ee372929cf80d..d53552f654bc6 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_spanner.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_spanner.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_speech.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_speech.expected.abi.dump.gz index ed5294d23819a..f66849e7ea40b 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_speech.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_speech.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_sql.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_sql.expected.abi.dump.gz index 160f0ee79f873..9ffaa0a54e87e 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_sql.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_sql.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_storage.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_storage.expected.abi.dump.gz index 1de59a5b2725a..d6d6234f11cac 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_storage.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_storage.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_storage_grpc.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_storage_grpc.expected.abi.dump.gz index 018148808ddf6..b13c42e412e07 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_storage_grpc.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_storage_grpc.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_storagebatchoperations.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_storagebatchoperations.expected.abi.dump.gz index a411d4f0f98a0..f3882082380d9 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_storagebatchoperations.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_storagebatchoperations.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_storagecontrol.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_storagecontrol.expected.abi.dump.gz index 6dca4850ec874..7007bfd069f2b 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_storagecontrol.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_storagecontrol.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_storageinsights.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_storageinsights.expected.abi.dump.gz index 8dcac62a7a209..de650021a2221 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_storageinsights.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_storageinsights.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_storagetransfer.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_storagetransfer.expected.abi.dump.gz index ed930d969f0d6..bc3bfdd362b4d 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_storagetransfer.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_storagetransfer.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_support.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_support.expected.abi.dump.gz index 60e1e8ef0340e..86f86963f4c6f 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_support.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_support.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_talent.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_talent.expected.abi.dump.gz index dae3613316af1..4a6ba507e02ce 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_talent.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_talent.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_tasks.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_tasks.expected.abi.dump.gz index 8d0f1cf722205..a5777fc8dcbe1 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_tasks.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_tasks.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_telcoautomation.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_telcoautomation.expected.abi.dump.gz index ba2a8eeccd5d6..69e098c25f7e9 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_telcoautomation.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_telcoautomation.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_texttospeech.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_texttospeech.expected.abi.dump.gz index 6baaffc7a3447..b925139df52a5 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_texttospeech.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_texttospeech.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_timeseriesinsights.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_timeseriesinsights.expected.abi.dump.gz index 07d2d1b8d3c2c..edc25a1364572 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_timeseriesinsights.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_timeseriesinsights.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_tpu.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_tpu.expected.abi.dump.gz index 258d91e3c14df..6224cea08de81 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_tpu.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_tpu.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_trace.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_trace.expected.abi.dump.gz index 5343f801c82c0..7ac3e7e8d859d 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_trace.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_trace.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_translate.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_translate.expected.abi.dump.gz index e1eb9f38fbf5b..d338e4ace299e 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_translate.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_translate.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_universe_domain.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_universe_domain.expected.abi.dump.gz index 303f36a179f50..6b5e0b60b55dc 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_universe_domain.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_universe_domain.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_vectorsearch.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_vectorsearch.expected.abi.dump.gz new file mode 100644 index 0000000000000..84a6e82c3891c Binary files /dev/null and b/ci/abi-dumps/google_cloud_cpp_vectorsearch.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_video.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_video.expected.abi.dump.gz index 6133a3ad394aa..0b8f3669e39a3 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_video.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_video.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_videointelligence.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_videointelligence.expected.abi.dump.gz index bcf45d23b3d03..bd0039a8f301c 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_videointelligence.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_videointelligence.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_vision.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_vision.expected.abi.dump.gz index b90876add1291..4b90dea0fad4f 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_vision.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_vision.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_visionai.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_visionai.expected.abi.dump.gz new file mode 100644 index 0000000000000..4e929b0c89e48 Binary files /dev/null and b/ci/abi-dumps/google_cloud_cpp_visionai.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_vmmigration.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_vmmigration.expected.abi.dump.gz index 32125dc85bbe4..7a4bdb5fc9bed 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_vmmigration.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_vmmigration.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_vmwareengine.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_vmwareengine.expected.abi.dump.gz index ce44b927681b2..3c2872ae20782 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_vmwareengine.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_vmwareengine.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_vpcaccess.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_vpcaccess.expected.abi.dump.gz index 0dbd868ef4667..7fb6049025969 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_vpcaccess.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_vpcaccess.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_webrisk.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_webrisk.expected.abi.dump.gz index 4f1463ed9b274..31232da8051be 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_webrisk.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_webrisk.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_websecurityscanner.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_websecurityscanner.expected.abi.dump.gz index 7df8d6ce41d17..c9c5192c3ccb2 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_websecurityscanner.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_websecurityscanner.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_workflows.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_workflows.expected.abi.dump.gz index e2966f37c9873..cd8f90026be13 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_workflows.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_workflows.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_workloadmanager.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_workloadmanager.expected.abi.dump.gz new file mode 100644 index 0000000000000..d9ca667534c0f Binary files /dev/null and b/ci/abi-dumps/google_cloud_cpp_workloadmanager.expected.abi.dump.gz differ diff --git a/ci/abi-dumps/google_cloud_cpp_workstations.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_workstations.expected.abi.dump.gz index 4633b47a0b266..4b662918b14cb 100644 Binary files a/ci/abi-dumps/google_cloud_cpp_workstations.expected.abi.dump.gz and b/ci/abi-dumps/google_cloud_cpp_workstations.expected.abi.dump.gz differ diff --git a/ci/bzlmod_tests/consumer-test/MODULE.bazel b/ci/bzlmod_tests/consumer-test/MODULE.bazel index 3ebfa7a79f844..9a48243eaeb83 100644 --- a/ci/bzlmod_tests/consumer-test/MODULE.bazel +++ b/ci/bzlmod_tests/consumer-test/MODULE.bazel @@ -1,5 +1,5 @@ module(name = "bzlmod-consumer-test") -bazel_dep(name = "google_cloud_cpp", version = "3.0.0-rc1") +bazel_dep(name = "google_cloud_cpp", version = "3.2.0") bazel_dep(name = "googletest", version = "1.15.2") bazel_dep(name = "rules_cc", version = "0.1.1") diff --git a/ci/cloudbuild/builds/check-api.sh b/ci/cloudbuild/builds/check-api.sh index 937944db782ec..984e2da49d4db 100755 --- a/ci/cloudbuild/builds/check-api.sh +++ b/ci/cloudbuild/builds/check-api.sh @@ -74,6 +74,8 @@ function check_abi() { elif [[ "${shortlib}" == "storage_grpc" ]]; then # `storage_grpc` uses the same header location as `storage` public_headers="${prefix}/include/google/cloud/storage" + elif [[ "${shortlib}" =~ "hypercomputecluster" ]]; then + : elif [[ "${shortlib}" =~ "compute" ]]; then # Compute libs are also special as their headers are in subdirectories. local computelib="${library#google_cloud_cpp_compute_}" diff --git a/ci/cloudbuild/builds/generate-libraries.sh b/ci/cloudbuild/builds/generate-libraries.sh index 5a6b503ed77c1..8f3c8a92dbd32 100755 --- a/ci/cloudbuild/builds/generate-libraries.sh +++ b/ci/cloudbuild/builds/generate-libraries.sh @@ -24,10 +24,8 @@ source module ci/lib/io.sh bazel_output_base="$(bazel info output_base)" -# As we support both WORKSPACE and MODULE modes for bazel, we need to determine -# the path to these dependencies dynamically. -read -r protobuf_proto_path < <(find "${bazel_output_base}/external" -name "empty.proto" | sed -nE 's/(.+\/src)\/google\/protobuf\/empty.proto/\1/p') -read -r googleapis_proto_path < <(find "${bazel_output_base}/external" -name "api-index-v1.json" | sed -nE 's/(.+)\/api-index-v1.json/\1/p') +protobuf_proto_path="${bazel_output_base}/external/protobuf+/src" +googleapis_proto_path="${bazel_output_base}/external/googleapis+" if [ -z "${UPDATED_DISCOVERY_DOCUMENT}" ]; then io::log_h2 "Removing previously generated golden files" diff --git a/ci/cloudbuild/builds/lib/integration.sh b/ci/cloudbuild/builds/lib/integration.sh index b733dc71fca40..0891b576894a9 100644 --- a/ci/cloudbuild/builds/lib/integration.sh +++ b/ci/cloudbuild/builds/lib/integration.sh @@ -31,7 +31,7 @@ source module ci/lib/io.sh export PATH="${HOME}/.local/bin:${PATH}" python3 -m pip uninstall -y --quiet googleapis-storage-testbench python3 -m pip install --upgrade --user --quiet --disable-pip-version-check \ - "git+https://github.com/googleapis/storage-testbench@v0.60.0" + "git+https://github.com/googleapis/storage-testbench@v0.61.0" # Some of the tests will need a valid roots.pem file. rm -f /dev/shm/roots.pem @@ -271,7 +271,7 @@ function integration::bazel_with_emulators() { # As we support both WORKSPACE and MODULE modes for bazel, we need to determine # the path to these dependencies dynamically. read -r protobuf_proto_path < <(find "${bazel_output_base}/external" -name "empty.proto" | sed -nE 's/(.+\/src)\/google\/protobuf\/empty.proto/\1/p') - read -r googleapis_proto_path < <(find "${bazel_output_base}/external" -name "api-index-v1.json" | sed -nE 's/(.+)\/api-index-v1.json/\1/p') + read -r googleapis_proto_path < <(find "${bazel_output_base}/external" -name "generator-versions.json" | sed -nE 's/(.+)\/generator-versions.json/\1/p') bazel run --action_env=GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes \ //generator:google-cloud-cpp-codegen -- \ diff --git a/ci/cloudbuild/dockerfiles/checkers.Dockerfile b/ci/cloudbuild/dockerfiles/checkers.Dockerfile index c13831ef34fcc..4a10b60b09d1d 100644 --- a/ci/cloudbuild/dockerfiles/checkers.Dockerfile +++ b/ci/cloudbuild/dockerfiles/checkers.Dockerfile @@ -54,6 +54,6 @@ RUN pip3 install mdformat==0.7.19 \ mdformat-frontmatter==2.0.8 \ mdformat-footnote==0.1.1 -RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-${ARCH}" && \ +RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.28.1/bazelisk-linux-${ARCH}" && \ chmod +x /usr/bin/bazelisk && \ ln -s /usr/bin/bazelisk /usr/bin/bazel diff --git a/ci/cloudbuild/dockerfiles/demo-debian-bookworm.Dockerfile b/ci/cloudbuild/dockerfiles/demo-debian-bookworm.Dockerfile index 74c5752c79754..4ea7d35d571f6 100644 --- a/ci/cloudbuild/dockerfiles/demo-debian-bookworm.Dockerfile +++ b/ci/cloudbuild/dockerfiles/demo-debian-bookworm.Dockerfile @@ -59,7 +59,7 @@ ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig # ```bash WORKDIR /var/tmp/build/abseil-cpp -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.1.tar.gz | \ +RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Debug \ @@ -142,7 +142,7 @@ RUN curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \ # ```bash WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.76.0.tar.gz | \ +RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Debug \ diff --git a/ci/cloudbuild/dockerfiles/demo-debian-bullseye.Dockerfile b/ci/cloudbuild/dockerfiles/demo-debian-bullseye.Dockerfile index d1b311d689a8a..bde9040639ed1 100644 --- a/ci/cloudbuild/dockerfiles/demo-debian-bullseye.Dockerfile +++ b/ci/cloudbuild/dockerfiles/demo-debian-bullseye.Dockerfile @@ -37,7 +37,7 @@ RUN curl -fsSL https://github.com/Kitware/cmake/archive/v3.22.3.tar.gz | \ # ```bash WORKDIR /var/tmp/build/abseil-cpp -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.1.tar.gz | \ +RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Debug \ @@ -104,7 +104,7 @@ RUN curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \ # ```bash WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.76.0.tar.gz | \ +RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Debug \ diff --git a/ci/cloudbuild/dockerfiles/demo-opensuse-leap.Dockerfile b/ci/cloudbuild/dockerfiles/demo-opensuse-leap.Dockerfile index 310ef24b41aad..6d258d8fa7fd0 100644 --- a/ci/cloudbuild/dockerfiles/demo-opensuse-leap.Dockerfile +++ b/ci/cloudbuild/dockerfiles/demo-opensuse-leap.Dockerfile @@ -27,16 +27,15 @@ ARG NCPU=4 # ```bash RUN zypper refresh && \ zypper install --allow-downgrade -y automake cmake curl \ - gcc8 gcc8-c++ git gzip libtool make patch tar wget + gcc9 gcc9-c++ git gzip libtool make patch tar wget # ``` # Install some of the dependencies for `google-cloud-cpp`. # ```bash RUN zypper refresh && \ - zypper install --allow-downgrade -y abseil-cpp-devel c-ares-devel \ - libcurl-devel libopenssl-devel nlohmann_json-devel \ - grpc-devel libprotobuf-devel + zypper install --allow-downgrade -y \ + libcurl-devel libopenssl-devel nlohmann_json-devel # ``` # The following steps will install libraries and tools in `/usr/local`. openSUSE @@ -52,19 +51,52 @@ ENV PATH=/usr/local/bin:${PATH} # Use the following environment variables to configure the compiler used by # CMake. -ENV CC=gcc-8 -ENV CXX=g++-8 +ENV CC=gcc-9 +ENV CXX=g++-9 -# #### opentelemetry-cpp +# #### Abseil + +# ```bash +WORKDIR /var/tmp/build/abseil-cpp +RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ + -DABSL_BUILD_TESTING=OFF \ + -DBUILD_SHARED_LIBS=yes \ + -S . -B cmake-out && \ + cmake --build cmake-out -- -j ${NCPU:-4} && \ + cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ + ldconfig +# ``` + +# #### Protobuf + +# ```bash +WORKDIR /var/tmp/build/protobuf +RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ + -DBUILD_SHARED_LIBS=yes \ + -Dprotobuf_BUILD_TESTS=OFF \ + -Dprotobuf_ABSL_PROVIDER=package \ + -S . -B cmake-out && \ + cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ + ldconfig && \ + ln -s /usr/local/bin/protoc /usr/bin/protoc +# ``` -# The project has a dependency on the OpenTelemetry library. +# #### opentelemetry-cpp # ```bash WORKDIR /var/tmp/build/opentelemetry-cpp RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24.0.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ - -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_CXX_STANDARD=17 \ -DBUILD_SHARED_LIBS=yes \ -DWITH_EXAMPLES=OFF \ @@ -77,6 +109,58 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24 ldconfig # ``` +# #### c-ares + +# ```bash +WORKDIR /var/tmp/build/c-ares +RUN curl -fsSL https://github.com/c-ares/c-ares/archive/refs/tags/cares-1_17_1.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_BUILD_TYPE=Debug \ + -DBUILD_SHARED_LIBS=yes \ + -S . -B cmake-out && \ + cmake --build cmake-out --target install && \ + ldconfig +# ``` + +# #### RE2 + +# ```bash +WORKDIR /var/tmp/build/re2 +RUN curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake -DCMAKE_BUILD_TYPE=Debug \ + -DBUILD_SHARED_LIBS=ON \ + -DRE2_BUILD_TESTING=OFF \ + -S . -B cmake-out && \ + cmake --build cmake-out --target install && \ + ldconfig +# ``` + +# #### gRPC + +# ```bash +WORKDIR /var/tmp/build/grpc +RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.1.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=17 \ + -DBUILD_SHARED_LIBS=yes \ + -DgRPC_INSTALL=ON \ + -DgRPC_BUILD_TESTS=OFF \ + -DgRPC_ABSL_PROVIDER=package \ + -DgRPC_CARES_PROVIDER=package \ + -DgRPC_PROTOBUF_PROVIDER=package \ + -DgRPC_RE2_PROVIDER=package \ + -DgRPC_SSL_PROVIDER=package \ + -DgRPC_ZLIB_PROVIDER=package \ + -DgRPC_OPENTELEMETRY_PROVIDER=package \ + -S . -B cmake-out && \ + cmake --build cmake-out --target install -- -j ${NCPU:-4} && \ + ldconfig +# ``` + ## [DONE packaging.md] RUN zypper refresh && \ @@ -91,5 +175,5 @@ RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/scca # Update the ld.conf cache in case any libraries were installed in /usr/local/lib* RUN ldconfig /usr/local/lib* - ENV DEMO_CORD_WORKAROUND=OFF +RUN echo 'root:cloudcxx' | chpasswd diff --git a/ci/cloudbuild/dockerfiles/demo-rockylinux-9.Dockerfile b/ci/cloudbuild/dockerfiles/demo-rockylinux-9.Dockerfile index 7b795b7d4a574..15bd62307002a 100644 --- a/ci/cloudbuild/dockerfiles/demo-rockylinux-9.Dockerfile +++ b/ci/cloudbuild/dockerfiles/demo-rockylinux-9.Dockerfile @@ -72,7 +72,7 @@ ENV PATH=/usr/local/bin:${PATH} # ```bash WORKDIR /var/tmp/build/abseil-cpp -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.1.tar.gz | \ +RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Debug \ @@ -135,7 +135,7 @@ RUN curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \ # ```bash WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.76.0.tar.gz | \ +RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_CXX_STANDARD=17 \ diff --git a/ci/cloudbuild/dockerfiles/demo-ubuntu-24.04.Dockerfile b/ci/cloudbuild/dockerfiles/demo-ubuntu-24.04.Dockerfile index 4a60238f3f675..be694f5466ddf 100644 --- a/ci/cloudbuild/dockerfiles/demo-ubuntu-24.04.Dockerfile +++ b/ci/cloudbuild/dockerfiles/demo-ubuntu-24.04.Dockerfile @@ -63,7 +63,7 @@ RUN ln -s /usr/bin/pkgconf /usr/bin/pkg-config # ```bash WORKDIR /var/tmp/build/abseil-cpp -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.1.tar.gz | \ +RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Debug \ @@ -142,7 +142,7 @@ RUN curl -fsSL https://github.com/google/re2/archive/2025-07-22.tar.gz | \ # ```bash WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.76.0.tar.gz | \ +RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Debug \ diff --git a/ci/cloudbuild/dockerfiles/demo-ubuntu-jammy.Dockerfile b/ci/cloudbuild/dockerfiles/demo-ubuntu-jammy.Dockerfile index 5716b5500acad..bd56e96c73661 100644 --- a/ci/cloudbuild/dockerfiles/demo-ubuntu-jammy.Dockerfile +++ b/ci/cloudbuild/dockerfiles/demo-ubuntu-jammy.Dockerfile @@ -32,7 +32,7 @@ RUN apt-get update && \ # ```bash WORKDIR /var/tmp/build/abseil-cpp -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.1.tar.gz | \ +RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Debug \ @@ -73,7 +73,7 @@ RUN curl -fsSL https://github.com/protocolbuffers/protobuf/archive/v33.1.tar.gz # ```bash WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.76.0.tar.gz | \ +RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Debug \ diff --git a/ci/cloudbuild/dockerfiles/fedora-latest-bazel.Dockerfile b/ci/cloudbuild/dockerfiles/fedora-latest-bazel.Dockerfile index 2b406debf8c9a..492d24d9e74f4 100644 --- a/ci/cloudbuild/dockerfiles/fedora-latest-bazel.Dockerfile +++ b/ci/cloudbuild/dockerfiles/fedora-latest-bazel.Dockerfile @@ -50,7 +50,7 @@ RUN /var/tmp/ci/install-cloud-sdk.sh ENV CLOUD_SDK_LOCATION=/usr/local/google-cloud-sdk ENV PATH=${CLOUD_SDK_LOCATION}/bin:${PATH} -RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-${ARCH}" && \ +RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.28.1/bazelisk-linux-${ARCH}" && \ chmod +x /usr/bin/bazelisk && \ ln -s /usr/bin/bazelisk /usr/bin/bazel diff --git a/ci/cloudbuild/dockerfiles/fedora-latest-cmake.Dockerfile b/ci/cloudbuild/dockerfiles/fedora-latest-cmake.Dockerfile index 10ce73a470bf4..a5ebcfac33e4a 100644 --- a/ci/cloudbuild/dockerfiles/fedora-latest-cmake.Dockerfile +++ b/ci/cloudbuild/dockerfiles/fedora-latest-cmake.Dockerfile @@ -40,7 +40,7 @@ RUN dnf makecache && dnf install -y "dnf-command(debuginfo-install)" RUN dnf makecache && dnf debuginfo-install -y libstdc++ # These are used by the docfx tool. -RUN dnf makecache && dnf install -y pugixml-devel yaml-cpp-devel +RUN dnf makecache && dnf install -y pugixml-devel RUN dnf install -y valgrind @@ -50,6 +50,18 @@ RUN dnf install -y valgrind # the container's /etc/passwd file. RUN echo "root:cloudcxx" | chpasswd +WORKDIR /var/tmp/build/ +RUN curl -fsSL https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.9.0.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_STANDARD=17 \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_TESTING=OFF \ + -S . -B cmake-out -GNinja && \ + cmake --build cmake-out --target install && \ + ldconfig && cd /var/tmp && rm -fr build + # Fedora's version of `pkg-config` (https://github.com/pkgconf/pkgconf) is slow # when handling `.pc` files with lots of `Requires:` deps. This problem is # triggered by the Abseil `.pc` files, which we use (indirectly) when testing @@ -72,7 +84,7 @@ ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib # We disable the inline namespace because otherwise Abseil LTS updates break our # `check-api` build. WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.1.tar.gz | \ +RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE="Release" \ @@ -94,7 +106,7 @@ RUN curl -fsSL https://github.com/google/googletest/archive/v1.16.0.tar.gz | \ ldconfig && cd /var/tmp && rm -fr build WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.2.tar.gz | \ +RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.5.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE="Release" \ @@ -148,7 +160,7 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24 WORKDIR /var/tmp/build/grpc RUN dnf makecache && dnf install -y c-ares-devel re2-devel -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.76.0.tar.gz | \ +RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/ci/cloudbuild/dockerfiles/fedora-latest-cxx20.Dockerfile b/ci/cloudbuild/dockerfiles/fedora-latest-cxx20.Dockerfile index 548b7052ea66b..05c72c0054291 100644 --- a/ci/cloudbuild/dockerfiles/fedora-latest-cxx20.Dockerfile +++ b/ci/cloudbuild/dockerfiles/fedora-latest-cxx20.Dockerfile @@ -73,7 +73,7 @@ ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib # with fewer layers). WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.1.tar.gz | \ +RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_CXX_STANDARD=20 \ @@ -98,7 +98,7 @@ RUN curl -fsSL https://github.com/google/googletest/archive/v1.16.0.tar.gz | \ cd /var/tmp && rm -fr build WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.2.tar.gz | \ +RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.5.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_CXX_STANDARD=20 \ @@ -157,7 +157,7 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24 WORKDIR /var/tmp/build/grpc RUN dnf makecache && dnf install -y c-ares-devel re2-devel -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.76.0.tar.gz | \ +RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_CXX_STANDARD=20 \ diff --git a/ci/cloudbuild/dockerfiles/fedora-latest-publish-docs.Dockerfile b/ci/cloudbuild/dockerfiles/fedora-latest-publish-docs.Dockerfile index 43be33013f9cd..9d1e232b3d416 100644 --- a/ci/cloudbuild/dockerfiles/fedora-latest-publish-docs.Dockerfile +++ b/ci/cloudbuild/dockerfiles/fedora-latest-publish-docs.Dockerfile @@ -33,8 +33,7 @@ RUN dnf makecache && \ libcurl-devel \ openssl-devel \ protobuf-devel \ - pugixml-devel \ - yaml-cpp-devel + pugixml-devel # This is used in the `publish-docs` build RUN dnf makecache && dnf install -y libxslt @@ -45,6 +44,18 @@ RUN dnf makecache && dnf install -y libxslt # the container's /etc/passwd file. RUN echo 'root:cloudcxx' | chpasswd +WORKDIR /var/tmp/build/ +RUN curl -fsSL https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.9.0.tar.gz | \ + tar -xzf - --strip-components=1 && \ + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_STANDARD=17 \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_TESTING=OFF \ + -S . -B cmake-out -GNinja && \ + cmake --build cmake-out --target install && \ + ldconfig && cd /var/tmp && rm -fr build + # We would prefer to say `dnf install -y doxygen`, but Fedora 40 ships with # Doxygen 1.10.0 and we need fixes that were released in Doxygen 1.11.0. Also, # we cannot use the binary, as it was built with clang support, which does not diff --git a/ci/cloudbuild/dockerfiles/fedora-msan.Dockerfile b/ci/cloudbuild/dockerfiles/fedora-msan.Dockerfile index f2cf48537eac6..d3f84f83a3f75 100644 --- a/ci/cloudbuild/dockerfiles/fedora-msan.Dockerfile +++ b/ci/cloudbuild/dockerfiles/fedora-msan.Dockerfile @@ -81,6 +81,6 @@ RUN /var/tmp/ci/install-cloud-sdk.sh ENV CLOUD_SDK_LOCATION=/usr/local/google-cloud-sdk ENV PATH=${CLOUD_SDK_LOCATION}/bin:${PATH} -RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-${ARCH}" && \ +RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.28.1/bazelisk-linux-${ARCH}" && \ chmod +x /usr/bin/bazelisk && \ ln -s /usr/bin/bazelisk /usr/bin/bazel diff --git a/ci/cloudbuild/dockerfiles/gcc-oldest.Dockerfile b/ci/cloudbuild/dockerfiles/gcc-oldest.Dockerfile index 83f2475107f4a..ae722c9165881 100644 --- a/ci/cloudbuild/dockerfiles/gcc-oldest.Dockerfile +++ b/ci/cloudbuild/dockerfiles/gcc-oldest.Dockerfile @@ -16,7 +16,7 @@ FROM opensuse/leap:15 ARG NCPU=4 RUN zypper refresh && \ - zypper install --allow-downgrade -y automake cmake curl gcc gcc-c++ \ + zypper install --allow-downgrade -y automake cmake curl gcc9 gcc9-c++ \ git gzip libtool make ninja patch tar wget \ c-ares-devel libcurl-devel libopenssl-devel libcrc32c-devel @@ -25,8 +25,14 @@ RUN (echo "/usr/local/lib" ; echo "/usr/local/lib64") | \ ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig ENV PATH=/usr/local/bin:${PATH} +ENV CXX=g++-9 +ENV CC=gcc-9 + +RUN ln -s /usr/bin/g++-9 /usr/local/bin/g++ +RUN ln -s /usr/bin/gcc-9 /usr/local/bin/gcc + WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.1.tar.gz | \ +RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250127.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_CXX_STANDARD=17 \ @@ -67,7 +73,7 @@ RUN curl -fsSL https://github.com/google/googletest/archive/v1.16.0.tar.gz | \ # Download and compile Google microbenchmark support library: WORKDIR /var/tmp/build -RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.2.tar.gz | \ +RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.5.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE="Release" \ @@ -111,7 +117,7 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24 ldconfig && cd /var/tmp && rm -fr build WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.76.0.tar.gz | \ +RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/ci/cloudbuild/dockerfiles/ubuntu-20.04-install.Dockerfile b/ci/cloudbuild/dockerfiles/ubuntu-20.04-install.Dockerfile index d83c1918e3c02..ac26d636b2c5f 100644 --- a/ci/cloudbuild/dockerfiles/ubuntu-20.04-install.Dockerfile +++ b/ci/cloudbuild/dockerfiles/ubuntu-20.04-install.Dockerfile @@ -59,7 +59,7 @@ RUN apt update && apt install -y openjdk-13-jre # image smaller (and with fewer layers) WORKDIR /var/tmp/build/abseil-cpp -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.1.tar.gz | \ +RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE="Release" \ @@ -84,7 +84,7 @@ RUN curl -fsSL https://github.com/google/googletest/archive/v1.16.0.tar.gz | \ cd /var/tmp && rm -fr build WORKDIR /var/tmp/build/benchmark -RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.2.tar.gz | \ +RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.5.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE="Release" \ @@ -163,7 +163,7 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24 ldconfig && cd /var/tmp && rm -fr build WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.76.0.tar.gz | \ +RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/ci/cloudbuild/dockerfiles/ubuntu-22.04-install.Dockerfile b/ci/cloudbuild/dockerfiles/ubuntu-22.04-install.Dockerfile index b4fe54f4bbd65..e9868ec79e92f 100644 --- a/ci/cloudbuild/dockerfiles/ubuntu-22.04-install.Dockerfile +++ b/ci/cloudbuild/dockerfiles/ubuntu-22.04-install.Dockerfile @@ -58,7 +58,7 @@ RUN apt update && apt install -y openjdk-11-jre # image smaller (and with fewer layers) WORKDIR /var/tmp/build/abseil-cpp -RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.1.tar.gz | \ +RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20250814.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE="Release" \ @@ -83,7 +83,7 @@ RUN curl -fsSL https://github.com/google/googletest/archive/v1.16.0.tar.gz | \ cd /var/tmp && rm -fr build WORKDIR /var/tmp/build/benchmark -RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.2.tar.gz | \ +RUN curl -fsSL https://github.com/google/benchmark/archive/v1.9.5.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE="Release" \ @@ -162,7 +162,7 @@ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24 ldconfig && cd /var/tmp && rm -fr build WORKDIR /var/tmp/build/grpc -RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.76.0.tar.gz | \ +RUN curl -fsSL https://github.com/grpc/grpc/archive/v1.71.2.tar.gz | \ tar -xzf - --strip-components=1 && \ cmake \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/ci/cloudbuild/dockerfiles/ubuntu-22.04.Dockerfile b/ci/cloudbuild/dockerfiles/ubuntu-22.04.Dockerfile index 226536688ab2a..d11b633bbf6b6 100644 --- a/ci/cloudbuild/dockerfiles/ubuntu-22.04.Dockerfile +++ b/ci/cloudbuild/dockerfiles/ubuntu-22.04.Dockerfile @@ -60,6 +60,6 @@ RUN /var/tmp/ci/install-cloud-sdk.sh ENV CLOUD_SDK_LOCATION=/usr/local/google-cloud-sdk ENV PATH=${CLOUD_SDK_LOCATION}/bin:${PATH} -RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-${ARCH}" && \ +RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.28.1/bazelisk-linux-${ARCH}" && \ chmod +x /usr/bin/bazelisk && \ ln -s /usr/bin/bazelisk /usr/bin/bazel diff --git a/ci/cloudbuild/dockerfiles/ubuntu-24.04.Dockerfile b/ci/cloudbuild/dockerfiles/ubuntu-24.04.Dockerfile index 3bb1f5fe01e2f..f081b1ce49162 100644 --- a/ci/cloudbuild/dockerfiles/ubuntu-24.04.Dockerfile +++ b/ci/cloudbuild/dockerfiles/ubuntu-24.04.Dockerfile @@ -65,6 +65,6 @@ RUN /var/tmp/ci/install-cloud-sdk.sh ENV CLOUD_SDK_LOCATION=/usr/local/google-cloud-sdk ENV PATH=${CLOUD_SDK_LOCATION}/bin:${PATH} -RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-${ARCH}" && \ +RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.28.1/bazelisk-linux-${ARCH}" && \ chmod +x /usr/bin/bazelisk && \ ln -s /usr/bin/bazelisk /usr/bin/bazel diff --git a/ci/etc/expected_install_directories b/ci/etc/expected_install_directories index 50319d65c9e6c..5e38dd32f7cc5 100644 --- a/ci/etc/expected_install_directories +++ b/ci/etc/expected_install_directories @@ -171,6 +171,10 @@ ./include/google/cloud/certificatemanager/v1 ./include/google/cloud/certificatemanager/v1/internal ./include/google/cloud/certificatemanager/v1/mocks +./include/google/cloud/ces +./include/google/cloud/ces/v1 +./include/google/cloud/ces/v1/internal +./include/google/cloud/ces/v1/mocks ./include/google/cloud/channel ./include/google/cloud/channel/v1 ./include/google/cloud/channel/v1/internal @@ -665,6 +669,10 @@ ./include/google/cloud/contentwarehouse/v1/mocks ./include/google/cloud/datacatalog ./include/google/cloud/datacatalog/lineage +./include/google/cloud/datacatalog/lineage/configmanagement +./include/google/cloud/datacatalog/lineage/configmanagement/v1 +./include/google/cloud/datacatalog/lineage/configmanagement/v1/internal +./include/google/cloud/datacatalog/lineage/configmanagement/v1/mocks ./include/google/cloud/datacatalog/lineage/v1 ./include/google/cloud/datacatalog/lineage/v1/internal ./include/google/cloud/datacatalog/lineage/v1/mocks @@ -797,6 +805,10 @@ ./include/google/cloud/gkerecommender/v1 ./include/google/cloud/gkerecommender/v1/internal ./include/google/cloud/gkerecommender/v1/mocks +./include/google/cloud/hypercomputecluster +./include/google/cloud/hypercomputecluster/v1 +./include/google/cloud/hypercomputecluster/v1/internal +./include/google/cloud/hypercomputecluster/v1/mocks ./include/google/cloud/iam ./include/google/cloud/iam/admin ./include/google/cloud/iam/admin/v1 @@ -1159,6 +1171,10 @@ ./include/google/cloud/translate/v3 ./include/google/cloud/translate/v3/internal ./include/google/cloud/translate/v3/mocks +./include/google/cloud/vectorsearch +./include/google/cloud/vectorsearch/v1 +./include/google/cloud/vectorsearch/v1/internal +./include/google/cloud/vectorsearch/v1/mocks ./include/google/cloud/video ./include/google/cloud/video/livestream ./include/google/cloud/video/livestream/v1 @@ -1180,6 +1196,10 @@ ./include/google/cloud/vision/v1 ./include/google/cloud/vision/v1/internal ./include/google/cloud/vision/v1/mocks +./include/google/cloud/visionai +./include/google/cloud/visionai/v1 +./include/google/cloud/visionai/v1/internal +./include/google/cloud/visionai/v1/mocks ./include/google/cloud/vmmigration ./include/google/cloud/vmmigration/v1 ./include/google/cloud/vmmigration/v1/internal @@ -1208,6 +1228,10 @@ ./include/google/cloud/workflows/v1 ./include/google/cloud/workflows/v1/internal ./include/google/cloud/workflows/v1/mocks +./include/google/cloud/workloadmanager +./include/google/cloud/workloadmanager/v1 +./include/google/cloud/workloadmanager/v1/internal +./include/google/cloud/workloadmanager/v1/mocks ./include/google/cloud/workstations ./include/google/cloud/workstations/v1 ./include/google/cloud/workstations/v1/internal @@ -1322,6 +1346,8 @@ ./lib64/cmake/google_cloud_cpp_binaryauthorization_mocks ./lib64/cmake/google_cloud_cpp_certificatemanager ./lib64/cmake/google_cloud_cpp_certificatemanager_mocks +./lib64/cmake/google_cloud_cpp_ces +./lib64/cmake/google_cloud_cpp_ces_mocks ./lib64/cmake/google_cloud_cpp_channel ./lib64/cmake/google_cloud_cpp_channel_mocks ./lib64/cmake/google_cloud_cpp_chronicle @@ -1413,6 +1439,8 @@ ./lib64/cmake/google_cloud_cpp_gkemulticloud_mocks ./lib64/cmake/google_cloud_cpp_gkerecommender ./lib64/cmake/google_cloud_cpp_gkerecommender_mocks +./lib64/cmake/google_cloud_cpp_hypercomputecluster +./lib64/cmake/google_cloud_cpp_hypercomputecluster_mocks ./lib64/cmake/google_cloud_cpp_iam ./lib64/cmake/google_cloud_cpp_iam_mocks ./lib64/cmake/google_cloud_cpp_iap @@ -1556,12 +1584,16 @@ ./lib64/cmake/google_cloud_cpp_trace_mocks ./lib64/cmake/google_cloud_cpp_translate ./lib64/cmake/google_cloud_cpp_translate_mocks +./lib64/cmake/google_cloud_cpp_vectorsearch +./lib64/cmake/google_cloud_cpp_vectorsearch_mocks ./lib64/cmake/google_cloud_cpp_video ./lib64/cmake/google_cloud_cpp_video_mocks ./lib64/cmake/google_cloud_cpp_videointelligence ./lib64/cmake/google_cloud_cpp_videointelligence_mocks ./lib64/cmake/google_cloud_cpp_vision ./lib64/cmake/google_cloud_cpp_vision_mocks +./lib64/cmake/google_cloud_cpp_visionai +./lib64/cmake/google_cloud_cpp_visionai_mocks ./lib64/cmake/google_cloud_cpp_vmmigration ./lib64/cmake/google_cloud_cpp_vmmigration_mocks ./lib64/cmake/google_cloud_cpp_vmwareengine @@ -1574,5 +1606,7 @@ ./lib64/cmake/google_cloud_cpp_websecurityscanner_mocks ./lib64/cmake/google_cloud_cpp_workflows ./lib64/cmake/google_cloud_cpp_workflows_mocks +./lib64/cmake/google_cloud_cpp_workloadmanager +./lib64/cmake/google_cloud_cpp_workloadmanager_mocks ./lib64/cmake/google_cloud_cpp_workstations ./lib64/cmake/google_cloud_cpp_workstations_mocks diff --git a/ci/kokoro/lib/vcpkg.sh b/ci/kokoro/lib/vcpkg.sh index 4a7975358a7ed..c224992bebdd8 100644 --- a/ci/kokoro/lib/vcpkg.sh +++ b/ci/kokoro/lib/vcpkg.sh @@ -32,7 +32,7 @@ install_vcpkg() { io::log "Downloading vcpkg into ${vcpkg_dir}..." VCPKG_VERSION="$( #include diff --git a/docfx/doxygen2references.cc b/docfx/doxygen2references.cc index 63ea2750adab0..53c6bbcf607ae 100644 --- a/docfx/doxygen2references.cc +++ b/docfx/doxygen2references.cc @@ -15,7 +15,6 @@ #include "docfx/doxygen2references.h" #include "docfx/node_name.h" #include "docfx/public_docs.h" -#include "docfx/yaml_emit.h" #include namespace docfx { diff --git a/docfx/doxygen2syntax.cc b/docfx/doxygen2syntax.cc index 66c665a0af7a4..0c15dcaa96937 100644 --- a/docfx/doxygen2syntax.cc +++ b/docfx/doxygen2syntax.cc @@ -17,7 +17,6 @@ #include "docfx/doxygen_errors.h" #include "docfx/function_classifiers.h" #include "docfx/linked_text_type.h" -#include "docfx/yaml_emit.h" #include namespace docfx { diff --git a/docfx/doxygen2yaml.cc b/docfx/doxygen2yaml.cc index 5808c75c0a983..a96e05fe13013 100644 --- a/docfx/doxygen2yaml.cc +++ b/docfx/doxygen2yaml.cc @@ -21,7 +21,6 @@ #include "docfx/function_classifiers.h" #include "docfx/node_name.h" #include "docfx/public_docs.h" -#include "docfx/yaml_emit.h" #include #include #include diff --git a/docfx/product-neutral-guides/docs.metadata.json.in b/docfx/product-neutral-guides/docs.metadata.json.in index e11f570d884ad..395f8646bd51d 100644 --- a/docfx/product-neutral-guides/docs.metadata.json.in +++ b/docfx/product-neutral-guides/docs.metadata.json.in @@ -1,5 +1,5 @@ { "language": "cpp", - "name": "product-neutral-guides", + "name": "help", "version": "@PROJECT_VERSION@" } diff --git a/docfx/yaml_emit.cc b/docfx/yaml_emit.cc deleted file mode 100644 index f7439b78649cc..0000000000000 --- a/docfx/yaml_emit.cc +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2023 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 "docfx/yaml_emit.h" - -namespace docfx { - -YAML::Emitter& operator<<(YAML::Emitter& e, std::string_view rhs) { - return e.Write(std::string(rhs)); -} - -} // namespace docfx diff --git a/docfx/yaml_emit.h b/docfx/yaml_emit.h deleted file mode 100644 index 4bc863f7c7da0..0000000000000 --- a/docfx/yaml_emit.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 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. - -#ifndef GOOGLE_CLOUD_CPP_DOCFX_YAML_EMIT_H -#define GOOGLE_CLOUD_CPP_DOCFX_YAML_EMIT_H - -#include -#include - -namespace docfx { - -YAML::Emitter& operator<<(YAML::Emitter& e, std::string_view rhs); - -} // namespace docfx - -#endif // GOOGLE_CLOUD_CPP_DOCFX_YAML_EMIT_H diff --git a/external/googleapis/protodeps/ces.deps b/external/googleapis/protodeps/ces.deps new file mode 100644 index 0000000000000..3a69eb58546e0 --- /dev/null +++ b/external/googleapis/protodeps/ces.deps @@ -0,0 +1,8 @@ +@googleapis//google/api:annotations_proto +@googleapis//google/api:client_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:http_proto +@googleapis//google/api:launch_stage_proto +@googleapis//google/api:resource_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/dataform.deps b/external/googleapis/protodeps/dataform.deps index f631e058a96b9..dc80aafe0faf3 100644 --- a/external/googleapis/protodeps/dataform.deps +++ b/external/googleapis/protodeps/dataform.deps @@ -4,5 +4,11 @@ @googleapis//google/api:http_proto @googleapis//google/api:launch_stage_proto @googleapis//google/api:resource_proto +@googleapis//google/iam/v1:iam_policy_proto +@googleapis//google/iam/v1:options_proto +@googleapis//google/iam/v1:policy_proto +@googleapis//google/iam/v1:resource_policy_member_proto +@googleapis//google/longrunning:operations_proto @googleapis//google/rpc:status_proto +@googleapis//google/type:expr_proto @googleapis//google/type:interval_proto diff --git a/external/googleapis/protodeps/dataplex.deps b/external/googleapis/protodeps/dataplex.deps index 6fe9d79d63f91..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/dataplex.deps +++ b/external/googleapis/protodeps/dataplex.deps @@ -5,10 +5,5 @@ @googleapis//google/api:http_proto @googleapis//google/api:launch_stage_proto @googleapis//google/api:resource_proto -@googleapis//google/iam/v1:iam_policy_proto -@googleapis//google/iam/v1:options_proto -@googleapis//google/iam/v1:policy_proto -@googleapis//google/iam/v1:resource_policy_member_proto @googleapis//google/longrunning:operations_proto @googleapis//google/rpc:status_proto -@googleapis//google/type:expr_proto diff --git a/external/googleapis/protodeps/hypercomputecluster.deps b/external/googleapis/protodeps/hypercomputecluster.deps new file mode 100644 index 0000000000000..ce4eebcf1a3ab --- /dev/null +++ b/external/googleapis/protodeps/hypercomputecluster.deps @@ -0,0 +1,9 @@ +@googleapis//google/api:annotations_proto +@googleapis//google/api:client_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:field_info_proto +@googleapis//google/api:http_proto +@googleapis//google/api:launch_stage_proto +@googleapis//google/api:resource_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/networksecurity.deps b/external/googleapis/protodeps/networksecurity.deps index 3a69eb58546e0..ce4eebcf1a3ab 100644 --- a/external/googleapis/protodeps/networksecurity.deps +++ b/external/googleapis/protodeps/networksecurity.deps @@ -1,6 +1,7 @@ @googleapis//google/api:annotations_proto @googleapis//google/api:client_proto @googleapis//google/api:field_behavior_proto +@googleapis//google/api:field_info_proto @googleapis//google/api:http_proto @googleapis//google/api:launch_stage_proto @googleapis//google/api:resource_proto diff --git a/external/googleapis/protodeps/securesourcemanager.deps b/external/googleapis/protodeps/securesourcemanager.deps index 11efb6f9d66da..6fe9d79d63f91 100644 --- a/external/googleapis/protodeps/securesourcemanager.deps +++ b/external/googleapis/protodeps/securesourcemanager.deps @@ -1,6 +1,7 @@ @googleapis//google/api:annotations_proto @googleapis//google/api:client_proto @googleapis//google/api:field_behavior_proto +@googleapis//google/api:field_info_proto @googleapis//google/api:http_proto @googleapis//google/api:launch_stage_proto @googleapis//google/api:resource_proto diff --git a/external/googleapis/protodeps/securitycenter.deps b/external/googleapis/protodeps/securitycenter.deps index fa07d4ad68c5b..82b8f2ed76f34 100644 --- a/external/googleapis/protodeps/securitycenter.deps +++ b/external/googleapis/protodeps/securitycenter.deps @@ -1,6 +1,7 @@ @googleapis//google/api:annotations_proto @googleapis//google/api:client_proto @googleapis//google/api:field_behavior_proto +@googleapis//google/api:field_info_proto @googleapis//google/api:http_proto @googleapis//google/api:launch_stage_proto @googleapis//google/api:resource_proto diff --git a/external/googleapis/protodeps/vectorsearch.deps b/external/googleapis/protodeps/vectorsearch.deps new file mode 100644 index 0000000000000..ce4eebcf1a3ab --- /dev/null +++ b/external/googleapis/protodeps/vectorsearch.deps @@ -0,0 +1,9 @@ +@googleapis//google/api:annotations_proto +@googleapis//google/api:client_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:field_info_proto +@googleapis//google/api:http_proto +@googleapis//google/api:launch_stage_proto +@googleapis//google/api:resource_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protodeps/visionai.deps b/external/googleapis/protodeps/visionai.deps new file mode 100644 index 0000000000000..114adaef2924e --- /dev/null +++ b/external/googleapis/protodeps/visionai.deps @@ -0,0 +1,9 @@ +@googleapis//google/api:annotations_proto +@googleapis//google/api:client_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:http_proto +@googleapis//google/api:launch_stage_proto +@googleapis//google/api:resource_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto +@googleapis//google/type:datetime_proto diff --git a/external/googleapis/protodeps/workloadmanager.deps b/external/googleapis/protodeps/workloadmanager.deps new file mode 100644 index 0000000000000..3a69eb58546e0 --- /dev/null +++ b/external/googleapis/protodeps/workloadmanager.deps @@ -0,0 +1,8 @@ +@googleapis//google/api:annotations_proto +@googleapis//google/api:client_proto +@googleapis//google/api:field_behavior_proto +@googleapis//google/api:http_proto +@googleapis//google/api:launch_stage_proto +@googleapis//google/api:resource_proto +@googleapis//google/longrunning:operations_proto +@googleapis//google/rpc:status_proto diff --git a/external/googleapis/protolists/aiplatform.list b/external/googleapis/protolists/aiplatform.list index e9320c941d622..668b04a4957f5 100644 --- a/external/googleapis/protolists/aiplatform.list +++ b/external/googleapis/protolists/aiplatform.list @@ -136,6 +136,8 @@ @googleapis//google/cloud/aiplatform/v1:schedule.proto @googleapis//google/cloud/aiplatform/v1:schedule_service.proto @googleapis//google/cloud/aiplatform/v1:service_networking.proto +@googleapis//google/cloud/aiplatform/v1:session.proto +@googleapis//google/cloud/aiplatform/v1:session_service.proto @googleapis//google/cloud/aiplatform/v1:specialist_pool.proto @googleapis//google/cloud/aiplatform/v1:specialist_pool_service.proto @googleapis//google/cloud/aiplatform/v1:study.proto diff --git a/external/googleapis/protolists/ces.list b/external/googleapis/protolists/ces.list new file mode 100644 index 0000000000000..cade557b3199b --- /dev/null +++ b/external/googleapis/protolists/ces.list @@ -0,0 +1,40 @@ +@googleapis//google/cloud/ces/v1:agent.proto +@googleapis//google/cloud/ces/v1:agent_service.proto +@googleapis//google/cloud/ces/v1:agent_tool.proto +@googleapis//google/cloud/ces/v1:agent_transfers.proto +@googleapis//google/cloud/ces/v1:app.proto +@googleapis//google/cloud/ces/v1:app_version.proto +@googleapis//google/cloud/ces/v1:auth.proto +@googleapis//google/cloud/ces/v1:bigquery_export.proto +@googleapis//google/cloud/ces/v1:changelog.proto +@googleapis//google/cloud/ces/v1:client_function.proto +@googleapis//google/cloud/ces/v1:common.proto +@googleapis//google/cloud/ces/v1:connector_tool.proto +@googleapis//google/cloud/ces/v1:connector_toolset.proto +@googleapis//google/cloud/ces/v1:conversation.proto +@googleapis//google/cloud/ces/v1:data_store.proto +@googleapis//google/cloud/ces/v1:data_store_tool.proto +@googleapis//google/cloud/ces/v1:deployment.proto +@googleapis//google/cloud/ces/v1:example.proto +@googleapis//google/cloud/ces/v1:fakes.proto +@googleapis//google/cloud/ces/v1:file_search_tool.proto +@googleapis//google/cloud/ces/v1:google_search_tool.proto +@googleapis//google/cloud/ces/v1:guardrail.proto +@googleapis//google/cloud/ces/v1:mcp_tool.proto +@googleapis//google/cloud/ces/v1:mcp_toolset.proto +@googleapis//google/cloud/ces/v1:omnichannel.proto +@googleapis//google/cloud/ces/v1:omnichannel_service.proto +@googleapis//google/cloud/ces/v1:open_api_tool.proto +@googleapis//google/cloud/ces/v1:open_api_toolset.proto +@googleapis//google/cloud/ces/v1:python_function.proto +@googleapis//google/cloud/ces/v1:schema.proto +@googleapis//google/cloud/ces/v1:search_suggestions.proto +@googleapis//google/cloud/ces/v1:security_settings.proto +@googleapis//google/cloud/ces/v1:session_service.proto +@googleapis//google/cloud/ces/v1:system_tool.proto +@googleapis//google/cloud/ces/v1:tool.proto +@googleapis//google/cloud/ces/v1:tool_service.proto +@googleapis//google/cloud/ces/v1:toolset.proto +@googleapis//google/cloud/ces/v1:toolset_tool.proto +@googleapis//google/cloud/ces/v1:widget_service.proto +@googleapis//google/cloud/ces/v1:widget_tool.proto diff --git a/external/googleapis/protolists/datacatalog.list b/external/googleapis/protolists/datacatalog.list index f801de4561991..ddff1eff21222 100644 --- a/external/googleapis/protolists/datacatalog.list +++ b/external/googleapis/protolists/datacatalog.list @@ -1,3 +1,4 @@ +@googleapis//google/cloud/datacatalog/lineage/configmanagement/v1:configmanagement.proto @googleapis//google/cloud/datacatalog/lineage/v1:lineage.proto @googleapis//google/cloud/datacatalog/v1:bigquery.proto @googleapis//google/cloud/datacatalog/v1:common.proto diff --git a/external/googleapis/protolists/dataplex.list b/external/googleapis/protolists/dataplex.list index c0e82abf6c348..e31b6ac83e94c 100644 --- a/external/googleapis/protolists/dataplex.list +++ b/external/googleapis/protolists/dataplex.list @@ -5,6 +5,7 @@ @googleapis//google/cloud/dataplex/v1:content.proto @googleapis//google/cloud/dataplex/v1:data_discovery.proto @googleapis//google/cloud/dataplex/v1:data_documentation.proto +@googleapis//google/cloud/dataplex/v1:data_products.proto @googleapis//google/cloud/dataplex/v1:data_profile.proto @googleapis//google/cloud/dataplex/v1:data_quality.proto @googleapis//google/cloud/dataplex/v1:data_taxonomy.proto diff --git a/external/googleapis/protolists/dialogflow_es.list b/external/googleapis/protolists/dialogflow_es.list index f8033289c5e91..5f521c8a728f9 100644 --- a/external/googleapis/protolists/dialogflow_es.list +++ b/external/googleapis/protolists/dialogflow_es.list @@ -2,6 +2,8 @@ @googleapis//google/cloud/dialogflow/v2:agent_coaching_instruction.proto @googleapis//google/cloud/dialogflow/v2:answer_record.proto @googleapis//google/cloud/dialogflow/v2:audio_config.proto +@googleapis//google/cloud/dialogflow/v2:ces_app.proto +@googleapis//google/cloud/dialogflow/v2:ces_tool.proto @googleapis//google/cloud/dialogflow/v2:context.proto @googleapis//google/cloud/dialogflow/v2:conversation.proto @googleapis//google/cloud/dialogflow/v2:conversation_dataset.proto @@ -26,6 +28,7 @@ @googleapis//google/cloud/dialogflow/v2:sip_trunk.proto @googleapis//google/cloud/dialogflow/v2:tool.proto @googleapis//google/cloud/dialogflow/v2:tool_call.proto +@googleapis//google/cloud/dialogflow/v2:toolset.proto @googleapis//google/cloud/dialogflow/v2:validation_result.proto @googleapis//google/cloud/dialogflow/v2:version.proto @googleapis//google/cloud/dialogflow/v2:webhook.proto diff --git a/external/googleapis/protolists/hypercomputecluster.list b/external/googleapis/protolists/hypercomputecluster.list new file mode 100644 index 0000000000000..3f84bbb372d12 --- /dev/null +++ b/external/googleapis/protolists/hypercomputecluster.list @@ -0,0 +1,2 @@ +@googleapis//google/cloud/hypercomputecluster/v1:hypercompute_cluster.proto +@googleapis//google/cloud/hypercomputecluster/v1:operation_metadata.proto diff --git a/external/googleapis/protolists/netapp.list b/external/googleapis/protolists/netapp.list index f8b9d854d58e3..81afccaa277b6 100644 --- a/external/googleapis/protolists/netapp.list +++ b/external/googleapis/protolists/netapp.list @@ -6,6 +6,7 @@ @googleapis//google/cloud/netapp/v1:common.proto @googleapis//google/cloud/netapp/v1:host_group.proto @googleapis//google/cloud/netapp/v1:kms.proto +@googleapis//google/cloud/netapp/v1:ontap.proto @googleapis//google/cloud/netapp/v1:quota_rule.proto @googleapis//google/cloud/netapp/v1:replication.proto @googleapis//google/cloud/netapp/v1:snapshot.proto diff --git a/external/googleapis/protolists/networksecurity.list b/external/googleapis/protolists/networksecurity.list index 917cc32161b26..3d32c110ba98f 100644 --- a/external/googleapis/protolists/networksecurity.list +++ b/external/googleapis/protolists/networksecurity.list @@ -1,7 +1,23 @@ @googleapis//google/cloud/networksecurity/v1:address_group.proto @googleapis//google/cloud/networksecurity/v1:authorization_policy.proto +@googleapis//google/cloud/networksecurity/v1:authz_policy.proto +@googleapis//google/cloud/networksecurity/v1:backend_authentication_config.proto @googleapis//google/cloud/networksecurity/v1:client_tls_policy.proto @googleapis//google/cloud/networksecurity/v1:common.proto +@googleapis//google/cloud/networksecurity/v1:dns_threat_detector.proto +@googleapis//google/cloud/networksecurity/v1:firewall_activation.proto +@googleapis//google/cloud/networksecurity/v1:gateway_security_policy.proto +@googleapis//google/cloud/networksecurity/v1:gateway_security_policy_rule.proto +@googleapis//google/cloud/networksecurity/v1:intercept.proto +@googleapis//google/cloud/networksecurity/v1:mirroring.proto @googleapis//google/cloud/networksecurity/v1:network_security.proto +@googleapis//google/cloud/networksecurity/v1:security_profile_group.proto +@googleapis//google/cloud/networksecurity/v1:security_profile_group_intercept.proto +@googleapis//google/cloud/networksecurity/v1:security_profile_group_mirroring.proto +@googleapis//google/cloud/networksecurity/v1:security_profile_group_service.proto +@googleapis//google/cloud/networksecurity/v1:security_profile_group_threatprevention.proto +@googleapis//google/cloud/networksecurity/v1:security_profile_group_urlfiltering.proto @googleapis//google/cloud/networksecurity/v1:server_tls_policy.proto @googleapis//google/cloud/networksecurity/v1:tls.proto +@googleapis//google/cloud/networksecurity/v1:tls_inspection_policy.proto +@googleapis//google/cloud/networksecurity/v1:url_list.proto diff --git a/external/googleapis/protolists/securitycenter.list b/external/googleapis/protolists/securitycenter.list index f40643817ce87..6210953e2c855 100644 --- a/external/googleapis/protolists/securitycenter.list +++ b/external/googleapis/protolists/securitycenter.list @@ -5,6 +5,7 @@ @googleapis//google/cloud/securitycenter/v1:attack_path.proto @googleapis//google/cloud/securitycenter/v1:backup_disaster_recovery.proto @googleapis//google/cloud/securitycenter/v1:bigquery_export.proto +@googleapis//google/cloud/securitycenter/v1:chokepoint.proto @googleapis//google/cloud/securitycenter/v1:cloud_armor.proto @googleapis//google/cloud/securitycenter/v1:cloud_dlp_data_profile.proto @googleapis//google/cloud/securitycenter/v1:cloud_dlp_inspection.proto @@ -18,6 +19,7 @@ @googleapis//google/cloud/securitycenter/v1:event_threat_detection_custom_module.proto @googleapis//google/cloud/securitycenter/v1:event_threat_detection_custom_module_validation_errors.proto @googleapis//google/cloud/securitycenter/v1:exfiltration.proto +@googleapis//google/cloud/securitycenter/v1:external_exposure.proto @googleapis//google/cloud/securitycenter/v1:external_system.proto @googleapis//google/cloud/securitycenter/v1:file.proto @googleapis//google/cloud/securitycenter/v1:finding.proto diff --git a/external/googleapis/protolists/vectorsearch.list b/external/googleapis/protolists/vectorsearch.list new file mode 100644 index 0000000000000..0c723548e099d --- /dev/null +++ b/external/googleapis/protolists/vectorsearch.list @@ -0,0 +1,6 @@ +@googleapis//google/cloud/vectorsearch/v1:common.proto +@googleapis//google/cloud/vectorsearch/v1:data_object.proto +@googleapis//google/cloud/vectorsearch/v1:data_object_search_service.proto +@googleapis//google/cloud/vectorsearch/v1:data_object_service.proto +@googleapis//google/cloud/vectorsearch/v1:embedding_config.proto +@googleapis//google/cloud/vectorsearch/v1:vectorsearch_service.proto diff --git a/external/googleapis/protolists/visionai.list b/external/googleapis/protolists/visionai.list new file mode 100644 index 0000000000000..b51abc3de332b --- /dev/null +++ b/external/googleapis/protolists/visionai.list @@ -0,0 +1,12 @@ +@googleapis//google/cloud/visionai/v1:annotations.proto +@googleapis//google/cloud/visionai/v1:common.proto +@googleapis//google/cloud/visionai/v1:health_service.proto +@googleapis//google/cloud/visionai/v1:lva.proto +@googleapis//google/cloud/visionai/v1:lva_resources.proto +@googleapis//google/cloud/visionai/v1:lva_service.proto +@googleapis//google/cloud/visionai/v1:platform.proto +@googleapis//google/cloud/visionai/v1:streaming_resources.proto +@googleapis//google/cloud/visionai/v1:streaming_service.proto +@googleapis//google/cloud/visionai/v1:streams_resources.proto +@googleapis//google/cloud/visionai/v1:streams_service.proto +@googleapis//google/cloud/visionai/v1:warehouse.proto diff --git a/external/googleapis/protolists/workloadmanager.list b/external/googleapis/protolists/workloadmanager.list new file mode 100644 index 0000000000000..ce90280dbc802 --- /dev/null +++ b/external/googleapis/protolists/workloadmanager.list @@ -0,0 +1 @@ +@googleapis//google/cloud/workloadmanager/v1:service.proto diff --git a/external/googleapis/update_libraries.sh b/external/googleapis/update_libraries.sh index fc7888d7f0e4e..61ffb2995d108 100755 --- a/external/googleapis/update_libraries.sh +++ b/external/googleapis/update_libraries.sh @@ -93,6 +93,7 @@ declare -A -r LIBRARIES=( "@googleapis//google/cloud/certificatemanager/logging/v1:logging_cc_grpc" \ "@googleapis//google/cloud/certificatemanager/v1:certificatemanager_cc_grpc" )" + ["ces"]="@googleapis//google/cloud/ces/v1:ces_cc_grpc" ["channel"]="@googleapis//google/cloud/channel/v1:channel_cc_grpc" ["chronicle"]="@googleapis//google/cloud/chronicle/v1:chronicle_cc_grpc" ["cloudbuild"]="$( @@ -117,7 +118,8 @@ declare -A -r LIBRARIES=( ["datacatalog"]="$( printf ",%s" \ "@googleapis//google/cloud/datacatalog/v1:datacatalog_cc_grpc" \ - "@googleapis//google/cloud/datacatalog/lineage/v1:lineage_cc_grpc" + "@googleapis//google/cloud/datacatalog/lineage/v1:lineage_cc_grpc" \ + "@googleapis//google/cloud/datacatalog/lineage/configmanagement/v1:configmanagement_cc_grpc" )" ["dataform"]="$( printf ",%s" \ @@ -177,6 +179,7 @@ declare -A -r LIBRARIES=( )" ["gkemulticloud"]="@googleapis//google/cloud/gkemulticloud/v1:gkemulticloud_cc_grpc" ["grafeas"]="@googleapis//grafeas/v1:grafeas_cc_grpc" + ["hypercomputecluster"]="@googleapis//google/cloud/hypercomputecluster/v1:hypercomputecluster_cc_grpc" ["iam"]="@googleapis//google/iam/admin/v1:admin_cc_grpc" ["iam_v2"]="@googleapis//google/iam/v2:iam_cc_grpc" ["iam_v3"]="@googleapis//google/iam/v3:iam_cc_grpc" @@ -330,6 +333,7 @@ declare -A -r LIBRARIES=( "@googleapis//google/devtools/cloudtrace/v2:cloudtrace_cc_grpc" )" ["translate"]="@googleapis//google/cloud/translate/v3:translation_cc_grpc" + ["vectorsearch"]="@googleapis//google/cloud/vectorsearch/v1:vectorsearch_cc_grpc" ["video"]="$( printf ",%s" \ "@googleapis//google/cloud/video/livestream/v1:livestream_cc_grpc" \ @@ -338,6 +342,7 @@ declare -A -r LIBRARIES=( )" ["videointelligence"]="@googleapis//google/cloud/videointelligence/v1:videointelligence_cc_grpc" ["vision"]="@googleapis//google/cloud/vision/v1:vision_cc_grpc" + ["visionai"]="@googleapis//google/cloud/visionai/v1:visionai_cc_grpc" ["vmmigration"]="@googleapis//google/cloud/vmmigration/v1:vmmigration_cc_grpc" ["vmwareengine"]="@googleapis//google/cloud/vmwareengine/v1:vmwareengine_cc_grpc" ["vpcaccess"]="@googleapis//google/cloud/vpcaccess/v1:vpcaccess_cc_grpc" @@ -349,6 +354,7 @@ declare -A -r LIBRARIES=( "@googleapis//google/cloud/workflows/type:type_cc_grpc" \ "@googleapis//google/cloud/workflows/executions/v1:executions_cc_grpc" )" + ["workloadmanager"]="@googleapis//google/cloud/workloadmanager/v1:workloadmanager_cc_grpc" ["workstations"]="$( printf ",%s" \ "@googleapis//google/cloud/workstations/logging/v1:logging_cc_grpc" \ diff --git a/generator/CMakeLists.txt b/generator/CMakeLists.txt index c6533bdf68984..874bad7da5fd4 100644 --- a/generator/CMakeLists.txt +++ b/generator/CMakeLists.txt @@ -150,7 +150,7 @@ target_link_libraries( google-cloud-cpp::longrunning_operations_protos absl::str_format protobuf::libprotoc - yaml-cpp) + yaml-cpp::yaml-cpp) google_cloud_cpp_add_common_options(google_cloud_cpp_generator) target_compile_options(google_cloud_cpp_generator PUBLIC ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG}) diff --git a/generator/generator_config.textproto b/generator/generator_config.textproto index 91e201db7e3f5..966e0c6b7e236 100644 --- a/generator/generator_config.textproto +++ b/generator/generator_config.textproto @@ -571,6 +571,7 @@ service { "ReadModifyWriteRow", "ReadRows", "SampleRowKeys", + "PingAndWarm", "PrepareQuery" ] omit_repo_metadata: true @@ -666,6 +667,35 @@ service { retryable_status_codes: ["kUnavailable"] } +# CES +service { + service_proto_path: "google/cloud/ces/v1/agent_service.proto" + product_path: "google/cloud/ces/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + +service { + service_proto_path: "google/cloud/ces/v1/widget_service.proto" + product_path: "google/cloud/ces/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + +service { + service_proto_path: "google/cloud/ces/v1/tool_service.proto" + product_path: "google/cloud/ces/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + +service { + service_proto_path: "google/cloud/ces/v1/session_service.proto" + product_path: "google/cloud/ces/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + # Chronicle service { service_proto_path: "google/cloud/chronicle/v1/entity.proto" @@ -1904,6 +1934,20 @@ service { retryable_status_codes: ["kUnavailable"] } +service { + service_proto_path: "google/cloud/datacatalog/lineage/v1/lineage.proto" + product_path: "google/cloud/datacatalog/lineage/v1" + initial_copyright_year: "2023" + retryable_status_codes: ["kUnavailable"] +} + +service { + service_proto_path: "google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.proto" + product_path: "google/cloud/datacatalog/lineage/configmanagement/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + # Database Migration service { service_proto_path: "google/cloud/clouddms/v1/clouddms.proto" @@ -1921,6 +1965,13 @@ service { } # Dataplex +service { + service_proto_path: "google/cloud/dataplex/v1/business_glossary.proto" + product_path: "google/cloud/dataplex/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + service { service_proto_path: "google/cloud/dataplex/v1/catalog.proto" product_path: "google/cloud/dataplex/v1" @@ -1928,6 +1979,13 @@ service { retryable_status_codes: ["kUnavailable"] } +service { + service_proto_path: "google/cloud/dataplex/v1/cmek.proto" + product_path: "google/cloud/dataplex/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + service { service_proto_path: "google/cloud/dataplex/v1/content.proto" product_path: "google/cloud/dataplex/v1" @@ -1935,6 +1993,13 @@ service { retryable_status_codes: ["kUnavailable"] } +service { + service_proto_path: "google/cloud/dataplex/v1/data_products.proto" + product_path: "google/cloud/dataplex/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + service { service_proto_path: "google/cloud/dataplex/v1/datascans.proto" product_path: "google/cloud/dataplex/v1" @@ -2635,6 +2700,14 @@ service { retryable_status_codes: ["kUnavailable"] } +# Hypercompute Cluster +service { + service_proto_path: "google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto" + product_path: "google/cloud/hypercomputecluster/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + # IAM service { service_proto_path: "google/iam/credentials/v1/iamcredentials.proto" @@ -3993,6 +4066,28 @@ service { retryable_status_codes: ["kUnavailable"] } +# Vector Search +service { + service_proto_path: "google/cloud/vectorsearch/v1/data_object_service.proto" + product_path: "google/cloud/vectorsearch/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + +service { + service_proto_path: "google/cloud/vectorsearch/v1/vectorsearch_service.proto" + product_path: "google/cloud/vectorsearch/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + +service { + service_proto_path: "google/cloud/vectorsearch/v1/data_object_search_service.proto" + product_path: "google/cloud/vectorsearch/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + # Video service { service_proto_path: "google/cloud/video/livestream/v1/service.proto" @@ -4038,6 +4133,49 @@ service { retryable_status_codes: ["kUnavailable"] } +# Vision AI +service { + service_proto_path: "google/cloud/visionai/v1/health_service.proto" + product_path: "google/cloud/visionai/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + +service { + service_proto_path: "google/cloud/visionai/v1/lva_service.proto" + product_path: "google/cloud/visionai/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + +service { + service_proto_path: "google/cloud/visionai/v1/platform.proto" + product_path: "google/cloud/visionai/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + +service { + service_proto_path: "google/cloud/visionai/v1/streaming_service.proto" + product_path: "google/cloud/visionai/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + +service { + service_proto_path: "google/cloud/visionai/v1/streams_service.proto" + product_path: "google/cloud/visionai/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + +service { + service_proto_path: "google/cloud/visionai/v1/warehouse.proto" + product_path: "google/cloud/visionai/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + # VM Migration service { service_proto_path: "google/cloud/vmmigration/v1/vmmigration.proto" @@ -4093,6 +4231,14 @@ service { retryable_status_codes: ["kUnavailable"] } +# Workload Manager +service { + service_proto_path: "google/cloud/workloadmanager/v1/service.proto" + product_path: "google/cloud/workloadmanager/v1" + initial_copyright_year: "2026" + retryable_status_codes: ["kUnavailable"] +} + # Workstations service { service_proto_path: "google/cloud/workstations/v1/workstations.proto" diff --git a/generator/integration_tests/tests/golden_thing_admin_rest_metadata_decorator_test.cc b/generator/integration_tests/tests/golden_thing_admin_rest_metadata_decorator_test.cc index b666614589891..514ed4e722197 100644 --- a/generator/integration_tests/tests/golden_thing_admin_rest_metadata_decorator_test.cc +++ b/generator/integration_tests/tests/golden_thing_admin_rest_metadata_decorator_test.cc @@ -312,7 +312,7 @@ TEST(ThingAdminRestMetadataDecoratorTest, DropDatabaseExplicitRoutingMatch) { EXPECT_THAT(context.GetHeader("x-goog-quota-user"), IsEmpty()); EXPECT_THAT(context.GetHeader("x-server-timeout"), IsEmpty()); EXPECT_THAT( - context.GetHeader("x-goog-request-params")[0], + context.GetHeader("x-goog-request-params").values().front(), AllOf( HasSubstr(std::string("project=projects%2Fmy_project")), HasSubstr(std::string("instance=instances%2Fmy_instance")), diff --git a/generator/internal/format_method_comments.cc b/generator/internal/format_method_comments.cc index 9780926dfcabf..b94c00e60ea78 100644 --- a/generator/internal/format_method_comments.cc +++ b/generator/internal/format_method_comments.cc @@ -191,6 +191,12 @@ MethodCommentSubstitution substitutions[] = { // From google/dialogflow/v2/conversation.proto {kDialogflowEsConversationsProto, kDialogflowEsConversationsCpp}, + // From google/cloud/visionai/v1/warehouse.proto + // From google/cloud/ces/v1/session_service.proto + // The "---" are transformed into a element which breaks our docs + // process. + {R"""(---)""", R"""(-)"""}, + // Add Doxygen-style comments {"\n", "\n ///"}, diff --git a/generator/templates/WORKSPACE.bazel b/generator/templates/WORKSPACE.bazel index 11faaf5678a27..46d4411b56154 100644 --- a/generator/templates/WORKSPACE.bazel +++ b/generator/templates/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "699955112a4c57ae9111fbadeff1698674a1762acd77daf36360e6dfc227dc93", - strip_prefix = "google-cloud-cpp-2.42.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v2.42.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/BUILD.bazel b/google/cloud/BUILD.bazel index 68bd685293f5f..708169ddda3d5 100644 --- a/google/cloud/BUILD.bazel +++ b/google/cloud/BUILD.bazel @@ -237,6 +237,8 @@ cc_library( name = "google_cloud_cpp_rest_internal", srcs = google_cloud_cpp_rest_internal_srcs, hdrs = google_cloud_cpp_rest_internal_hdrs, + # TODO(#16079): Remove macro definition when GA. + cxxopts = ["-DGOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB"], linkopts = select({ "@platforms//os:windows": [ "-DEFAULTLIB:bcrypt.lib", @@ -256,6 +258,7 @@ cc_library( visibility = ["//:__subpackages__"], deps = [ ":google_cloud_cpp_common", + "@abseil-cpp//absl/container:flat_hash_map", "@abseil-cpp//absl/functional:function_ref", "@abseil-cpp//absl/types:span", "@curl", @@ -272,6 +275,8 @@ cc_library( [cc_test( name = test.replace("/", "_").replace(".cc", ""), srcs = [test], + # TODO(#16079): Remove macro definition when GA. + cxxopts = ["-DGOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB"], deps = [ ":google_cloud_cpp_rest_internal", "//google/cloud/testing_util:google_cloud_cpp_testing_private", diff --git a/google/cloud/accessapproval/quickstart/.bazelversion b/google/cloud/accessapproval/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/accessapproval/quickstart/.bazelversion +++ b/google/cloud/accessapproval/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/accessapproval/quickstart/WORKSPACE.bazel b/google/cloud/accessapproval/quickstart/WORKSPACE.bazel index efc09e414660f..dcb5a3a23edff 100644 --- a/google/cloud/accessapproval/quickstart/WORKSPACE.bazel +++ b/google/cloud/accessapproval/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/accesscontextmanager/quickstart/.bazelversion b/google/cloud/accesscontextmanager/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/accesscontextmanager/quickstart/.bazelversion +++ b/google/cloud/accesscontextmanager/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/accesscontextmanager/quickstart/WORKSPACE.bazel b/google/cloud/accesscontextmanager/quickstart/WORKSPACE.bazel index f835a34fe5eb9..80974057a3d3b 100644 --- a/google/cloud/accesscontextmanager/quickstart/WORKSPACE.bazel +++ b/google/cloud/accesscontextmanager/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/advisorynotifications/quickstart/.bazelversion b/google/cloud/advisorynotifications/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/advisorynotifications/quickstart/.bazelversion +++ b/google/cloud/advisorynotifications/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/advisorynotifications/quickstart/WORKSPACE.bazel b/google/cloud/advisorynotifications/quickstart/WORKSPACE.bazel index acaa1a494f85a..e045d82aa1ca8 100644 --- a/google/cloud/advisorynotifications/quickstart/WORKSPACE.bazel +++ b/google/cloud/advisorynotifications/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/aiplatform/quickstart/.bazelversion b/google/cloud/aiplatform/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/aiplatform/quickstart/.bazelversion +++ b/google/cloud/aiplatform/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/aiplatform/quickstart/WORKSPACE.bazel b/google/cloud/aiplatform/quickstart/WORKSPACE.bazel index 25c9ff3e62072..e3bb835c1d191 100644 --- a/google/cloud/aiplatform/quickstart/WORKSPACE.bazel +++ b/google/cloud/aiplatform/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/aiplatform/v1/dataset_client.h b/google/cloud/aiplatform/v1/dataset_client.h index 422e39592926f..67a882e06e603 100644 --- a/google/cloud/aiplatform/v1/dataset_client.h +++ b/google/cloud/aiplatform/v1/dataset_client.h @@ -2150,7 +2150,7 @@ class DatasetServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2189,7 +2189,7 @@ class DatasetServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/deployment_resource_pool_client.h b/google/cloud/aiplatform/v1/deployment_resource_pool_client.h index d2b90f8025a0b..8f20261089b47 100644 --- a/google/cloud/aiplatform/v1/deployment_resource_pool_client.h +++ b/google/cloud/aiplatform/v1/deployment_resource_pool_client.h @@ -998,7 +998,7 @@ class DeploymentResourcePoolServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1037,7 +1037,7 @@ class DeploymentResourcePoolServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/endpoint_client.h b/google/cloud/aiplatform/v1/endpoint_client.h index c068f364609e2..19af63e98f3e3 100644 --- a/google/cloud/aiplatform/v1/endpoint_client.h +++ b/google/cloud/aiplatform/v1/endpoint_client.h @@ -1516,7 +1516,7 @@ class EndpointServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1555,7 +1555,7 @@ class EndpointServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/evaluation_client.h b/google/cloud/aiplatform/v1/evaluation_client.h index f373f91587d7e..9fcbb541aedd2 100644 --- a/google/cloud/aiplatform/v1/evaluation_client.h +++ b/google/cloud/aiplatform/v1/evaluation_client.h @@ -110,8 +110,8 @@ class EvaluationServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.aiplatform.v1.EvaluateInstancesRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/evaluation_service.proto#L64} - /// [google.cloud.aiplatform.v1.EvaluateInstancesResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/evaluation_service.proto#L162} + /// [google.cloud.aiplatform.v1.EvaluateInstancesRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/evaluation_service.proto#L68} + /// [google.cloud.aiplatform.v1.EvaluateInstancesResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/evaluation_service.proto#L269} /// // clang-format on StatusOr @@ -511,7 +511,7 @@ class EvaluationServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -550,7 +550,7 @@ class EvaluationServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/feature_online_store_admin_client.h b/google/cloud/aiplatform/v1/feature_online_store_admin_client.h index c3c23749bfcfa..e2c1f06367c9e 100644 --- a/google/cloud/aiplatform/v1/feature_online_store_admin_client.h +++ b/google/cloud/aiplatform/v1/feature_online_store_admin_client.h @@ -1729,7 +1729,7 @@ class FeatureOnlineStoreAdminServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1768,7 +1768,7 @@ class FeatureOnlineStoreAdminServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/feature_online_store_client.h b/google/cloud/aiplatform/v1/feature_online_store_client.h index c992e05953eca..b82135a8c3ef3 100644 --- a/google/cloud/aiplatform/v1/feature_online_store_client.h +++ b/google/cloud/aiplatform/v1/feature_online_store_client.h @@ -645,7 +645,7 @@ class FeatureOnlineStoreServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -684,7 +684,7 @@ class FeatureOnlineStoreServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/feature_registry_client.h b/google/cloud/aiplatform/v1/feature_registry_client.h index bcc37fe8c96bf..7370422d3577f 100644 --- a/google/cloud/aiplatform/v1/feature_registry_client.h +++ b/google/cloud/aiplatform/v1/feature_registry_client.h @@ -1642,7 +1642,7 @@ class FeatureRegistryServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1681,7 +1681,7 @@ class FeatureRegistryServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/featurestore_client.h b/google/cloud/aiplatform/v1/featurestore_client.h index 79650eaf2c306..0f78bca32b6d5 100644 --- a/google/cloud/aiplatform/v1/featurestore_client.h +++ b/google/cloud/aiplatform/v1/featurestore_client.h @@ -2954,7 +2954,7 @@ class FeaturestoreServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2993,7 +2993,7 @@ class FeaturestoreServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/featurestore_online_serving_client.h b/google/cloud/aiplatform/v1/featurestore_online_serving_client.h index 066e0809cb922..5abd65d288c93 100644 --- a/google/cloud/aiplatform/v1/featurestore_online_serving_client.h +++ b/google/cloud/aiplatform/v1/featurestore_online_serving_client.h @@ -692,7 +692,7 @@ class FeaturestoreOnlineServingServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -731,7 +731,7 @@ class FeaturestoreOnlineServingServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/gen_ai_tuning_client.h b/google/cloud/aiplatform/v1/gen_ai_tuning_client.h index 0dde1a79b0881..889bbc6829516 100644 --- a/google/cloud/aiplatform/v1/gen_ai_tuning_client.h +++ b/google/cloud/aiplatform/v1/gen_ai_tuning_client.h @@ -112,7 +112,7 @@ class GenAiTuningServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.CreateTuningJobRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/genai_tuning_service.proto#L106} - /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L36} + /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L37} /// // clang-format on StatusOr CreateTuningJob( @@ -145,7 +145,7 @@ class GenAiTuningServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.CreateTuningJobRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/genai_tuning_service.proto#L106} - /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L36} + /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L37} /// // clang-format on StatusOr CreateTuningJob( @@ -172,7 +172,7 @@ class GenAiTuningServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.GetTuningJobRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/genai_tuning_service.proto#L122} - /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L36} + /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L37} /// // clang-format on StatusOr GetTuningJob( @@ -202,7 +202,7 @@ class GenAiTuningServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.GetTuningJobRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/genai_tuning_service.proto#L122} - /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L36} + /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L37} /// // clang-format on StatusOr GetTuningJob( @@ -238,7 +238,7 @@ class GenAiTuningServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.ListTuningJobsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/genai_tuning_service.proto#L135} - /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L36} + /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L37} /// // clang-format on StreamRange ListTuningJobs( @@ -277,7 +277,7 @@ class GenAiTuningServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.ListTuningJobsRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/genai_tuning_service.proto#L135} - /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L36} + /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L37} /// // clang-format on StreamRange ListTuningJobs( @@ -314,9 +314,9 @@ class GenAiTuningServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.CancelTuningJobRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/genai_tuning_service.proto#L173} /// [google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/genai_tuning_service.proto#L54} - /// [google.cloud.aiplatform.v1.TuningJob.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L105} - /// [google.cloud.aiplatform.v1.TuningJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L78} - /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// [google.cloud.aiplatform.v1.TuningJob.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L106} + /// [google.cloud.aiplatform.v1.TuningJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L79} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelTuningJob(std::string const& name, Options opts = {}); @@ -355,9 +355,9 @@ class GenAiTuningServiceClient { /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.CancelTuningJobRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/genai_tuning_service.proto#L173} /// [google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/genai_tuning_service.proto#L54} - /// [google.cloud.aiplatform.v1.TuningJob.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L105} - /// [google.cloud.aiplatform.v1.TuningJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L78} - /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// [google.cloud.aiplatform.v1.TuningJob.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L106} + /// [google.cloud.aiplatform.v1.TuningJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L79} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelTuningJob( @@ -392,7 +392,7 @@ class GenAiTuningServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.RebaseTunedModelRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/genai_tuning_service.proto#L186} - /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L36} + /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L37} /// // clang-format on future> RebaseTunedModel( @@ -447,7 +447,7 @@ class GenAiTuningServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.RebaseTunedModelRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/genai_tuning_service.proto#L186} - /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L36} + /// [google.cloud.aiplatform.v1.TuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/tuning_job.proto#L37} /// // clang-format on future> RebaseTunedModel( @@ -874,7 +874,7 @@ class GenAiTuningServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -913,7 +913,7 @@ class GenAiTuningServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/index_client.h b/google/cloud/aiplatform/v1/index_client.h index 01048b5562221..cab56db2f070e 100644 --- a/google/cloud/aiplatform/v1/index_client.h +++ b/google/cloud/aiplatform/v1/index_client.h @@ -1035,7 +1035,7 @@ class IndexServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1074,7 +1074,7 @@ class IndexServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/index_endpoint_client.h b/google/cloud/aiplatform/v1/index_endpoint_client.h index 0caddbbe2e4fb..275264334c69f 100644 --- a/google/cloud/aiplatform/v1/index_endpoint_client.h +++ b/google/cloud/aiplatform/v1/index_endpoint_client.h @@ -1287,7 +1287,7 @@ class IndexEndpointServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1326,7 +1326,7 @@ class IndexEndpointServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/job_client.h b/google/cloud/aiplatform/v1/job_client.h index d24bd8b61d64a..61e3fe13abb60 100644 --- a/google/cloud/aiplatform/v1/job_client.h +++ b/google/cloud/aiplatform/v1/job_client.h @@ -431,7 +431,7 @@ class JobServiceClient { /// [google.cloud.aiplatform.v1.CustomJob.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/custom_job.proto#L83} /// [google.cloud.aiplatform.v1.CustomJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/custom_job.proto#L61} /// [google.cloud.aiplatform.v1.JobService.GetCustomJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/job_service.proto#L61} - /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelCustomJob(std::string const& name, Options opts = {}); @@ -473,7 +473,7 @@ class JobServiceClient { /// [google.cloud.aiplatform.v1.CustomJob.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/custom_job.proto#L83} /// [google.cloud.aiplatform.v1.CustomJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/custom_job.proto#L61} /// [google.cloud.aiplatform.v1.JobService.GetCustomJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/job_service.proto#L61} - /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelCustomJob( @@ -1203,7 +1203,7 @@ class JobServiceClient { /// [google.cloud.aiplatform.v1.HyperparameterTuningJob.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto#L101} /// [google.cloud.aiplatform.v1.HyperparameterTuningJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto#L77} /// [google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/job_service.proto#L171} - /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelHyperparameterTuningJob(std::string const& name, @@ -1247,7 +1247,7 @@ class JobServiceClient { /// [google.cloud.aiplatform.v1.HyperparameterTuningJob.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto#L101} /// [google.cloud.aiplatform.v1.HyperparameterTuningJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto#L77} /// [google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/job_service.proto#L171} - /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelHyperparameterTuningJob( @@ -1598,7 +1598,7 @@ class JobServiceClient { /// [google.cloud.aiplatform.v1.JobService.GetNasJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/job_service.proto#L234} /// [google.cloud.aiplatform.v1.NasJob.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/nas_job.proto#L80} /// [google.cloud.aiplatform.v1.NasJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/nas_job.proto#L58} - /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelNasJob(std::string const& name, Options opts = {}); @@ -1640,7 +1640,7 @@ class JobServiceClient { /// [google.cloud.aiplatform.v1.JobService.GetNasJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/job_service.proto#L234} /// [google.cloud.aiplatform.v1.NasJob.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/nas_job.proto#L80} /// [google.cloud.aiplatform.v1.NasJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/nas_job.proto#L58} - /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelNasJob( @@ -3232,7 +3232,7 @@ class JobServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -3271,7 +3271,7 @@ class JobServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/llm_utility_client.h b/google/cloud/aiplatform/v1/llm_utility_client.h index 682989d20de98..a7d575a9e8141 100644 --- a/google/cloud/aiplatform/v1/llm_utility_client.h +++ b/google/cloud/aiplatform/v1/llm_utility_client.h @@ -601,7 +601,7 @@ class LlmUtilityServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -640,7 +640,7 @@ class LlmUtilityServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/match_client.h b/google/cloud/aiplatform/v1/match_client.h index 1060ce83f5eb8..8b1284ce11f55 100644 --- a/google/cloud/aiplatform/v1/match_client.h +++ b/google/cloud/aiplatform/v1/match_client.h @@ -543,7 +543,7 @@ class MatchServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -582,7 +582,7 @@ class MatchServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/metadata_client.h b/google/cloud/aiplatform/v1/metadata_client.h index 8fc349016330f..acf69f683f3ee 100644 --- a/google/cloud/aiplatform/v1/metadata_client.h +++ b/google/cloud/aiplatform/v1/metadata_client.h @@ -3045,7 +3045,7 @@ class MetadataServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -3084,7 +3084,7 @@ class MetadataServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/migration_client.h b/google/cloud/aiplatform/v1/migration_client.h index b8f61135d1acd..fd6023e48c463 100644 --- a/google/cloud/aiplatform/v1/migration_client.h +++ b/google/cloud/aiplatform/v1/migration_client.h @@ -693,7 +693,7 @@ class MigrationServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -732,7 +732,7 @@ class MigrationServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/model_client.h b/google/cloud/aiplatform/v1/model_client.h index 823454f1840e2..008ddffa6df97 100644 --- a/google/cloud/aiplatform/v1/model_client.h +++ b/google/cloud/aiplatform/v1/model_client.h @@ -2154,7 +2154,7 @@ class ModelServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2193,7 +2193,7 @@ class ModelServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/model_garden_client.h b/google/cloud/aiplatform/v1/model_garden_client.h index 5932ce9e6e6d1..4051fc66b5ea9 100644 --- a/google/cloud/aiplatform/v1/model_garden_client.h +++ b/google/cloud/aiplatform/v1/model_garden_client.h @@ -605,7 +605,7 @@ class ModelGardenServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -644,7 +644,7 @@ class ModelGardenServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/notebook_client.h b/google/cloud/aiplatform/v1/notebook_client.h index e398003f92ac5..10f35c1cff591 100644 --- a/google/cloud/aiplatform/v1/notebook_client.h +++ b/google/cloud/aiplatform/v1/notebook_client.h @@ -2048,7 +2048,7 @@ class NotebookServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2087,7 +2087,7 @@ class NotebookServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/persistent_resource_client.h b/google/cloud/aiplatform/v1/persistent_resource_client.h index 94a3a2719b7ac..ccfd3fcc95898 100644 --- a/google/cloud/aiplatform/v1/persistent_resource_client.h +++ b/google/cloud/aiplatform/v1/persistent_resource_client.h @@ -1114,7 +1114,7 @@ class PersistentResourceServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1153,7 +1153,7 @@ class PersistentResourceServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/pipeline_client.h b/google/cloud/aiplatform/v1/pipeline_client.h index b52895c309b21..1b4ea9c6e9205 100644 --- a/google/cloud/aiplatform/v1/pipeline_client.h +++ b/google/cloud/aiplatform/v1/pipeline_client.h @@ -442,7 +442,7 @@ class PipelineServiceClient { /// [google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]: @googleapis_reference_link{google/cloud/aiplatform/v1/pipeline_service.proto#L58} /// [google.cloud.aiplatform.v1.TrainingPipeline.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/training_pipeline.proto#L127} /// [google.cloud.aiplatform.v1.TrainingPipeline.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/training_pipeline.proto#L123} - /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelTrainingPipeline(std::string const& name, Options opts = {}); @@ -485,7 +485,7 @@ class PipelineServiceClient { /// [google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]: @googleapis_reference_link{google/cloud/aiplatform/v1/pipeline_service.proto#L58} /// [google.cloud.aiplatform.v1.TrainingPipeline.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/training_pipeline.proto#L127} /// [google.cloud.aiplatform.v1.TrainingPipeline.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/training_pipeline.proto#L123} - /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelTrainingPipeline( @@ -973,7 +973,7 @@ class PipelineServiceClient { /// [google.cloud.aiplatform.v1.PipelineJob.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/pipeline_job.proto#L142} /// [google.cloud.aiplatform.v1.PipelineJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/pipeline_job.proto#L135} /// [google.cloud.aiplatform.v1.PipelineService.GetPipelineJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/pipeline_service.proto#L122} - /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelPipelineJob(std::string const& name, Options opts = {}); @@ -1015,7 +1015,7 @@ class PipelineServiceClient { /// [google.cloud.aiplatform.v1.PipelineJob.error]: @googleapis_reference_link{google/cloud/aiplatform/v1/pipeline_job.proto#L142} /// [google.cloud.aiplatform.v1.PipelineJob.state]: @googleapis_reference_link{google/cloud/aiplatform/v1/pipeline_job.proto#L135} /// [google.cloud.aiplatform.v1.PipelineService.GetPipelineJob]: @googleapis_reference_link{google/cloud/aiplatform/v1/pipeline_service.proto#L122} - /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelPipelineJob( @@ -1553,7 +1553,7 @@ class PipelineServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1592,7 +1592,7 @@ class PipelineServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/prediction_client.h b/google/cloud/aiplatform/v1/prediction_client.h index 28abff5bfe6d9..1fb7fe0674564 100644 --- a/google/cloud/aiplatform/v1/prediction_client.h +++ b/google/cloud/aiplatform/v1/prediction_client.h @@ -788,7 +788,7 @@ class PredictionServiceClient { /// @param model Required. The name of the publisher model requested to serve the /// prediction. Format: /// `projects/{project}/locations/{location}/publishers/*/models/*` - /// @param content Required. Input content to be embedded. Required. + /// @param content Required. Input content to be embedded. /// @param opts Optional. Override the class-level options, such as retry and /// backoff policies. /// @return the result of the RPC. The response message type @@ -803,7 +803,7 @@ class PredictionServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.EmbedContentRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/prediction_service.proto#L894} - /// [google.cloud.aiplatform.v1.EmbedContentResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/prediction_service.proto#L954} + /// [google.cloud.aiplatform.v1.EmbedContentResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/prediction_service.proto#L996} /// // clang-format on StatusOr EmbedContent( @@ -834,7 +834,7 @@ class PredictionServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.aiplatform.v1.EmbedContentRequest]: @googleapis_reference_link{google/cloud/aiplatform/v1/prediction_service.proto#L894} - /// [google.cloud.aiplatform.v1.EmbedContentResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/prediction_service.proto#L954} + /// [google.cloud.aiplatform.v1.EmbedContentResponse]: @googleapis_reference_link{google/cloud/aiplatform/v1/prediction_service.proto#L996} /// // clang-format on StatusOr EmbedContent( @@ -1233,7 +1233,7 @@ class PredictionServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1272,7 +1272,7 @@ class PredictionServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/schedule_client.h b/google/cloud/aiplatform/v1/schedule_client.h index 9477e946001a3..76c17ea4e95a2 100644 --- a/google/cloud/aiplatform/v1/schedule_client.h +++ b/google/cloud/aiplatform/v1/schedule_client.h @@ -1036,7 +1036,7 @@ class ScheduleServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1075,7 +1075,7 @@ class ScheduleServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/specialist_pool_client.h b/google/cloud/aiplatform/v1/specialist_pool_client.h index 9b3c9ef544dac..f38634588585f 100644 --- a/google/cloud/aiplatform/v1/specialist_pool_client.h +++ b/google/cloud/aiplatform/v1/specialist_pool_client.h @@ -977,7 +977,7 @@ class SpecialistPoolServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1016,7 +1016,7 @@ class SpecialistPoolServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/tensorboard_client.h b/google/cloud/aiplatform/v1/tensorboard_client.h index 9844c0b24ac3f..95c36f741d9ae 100644 --- a/google/cloud/aiplatform/v1/tensorboard_client.h +++ b/google/cloud/aiplatform/v1/tensorboard_client.h @@ -2836,7 +2836,7 @@ class TensorboardServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2875,7 +2875,7 @@ class TensorboardServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/aiplatform/v1/vizier_client.h b/google/cloud/aiplatform/v1/vizier_client.h index e7faea5ecd189..990cfda61950c 100644 --- a/google/cloud/aiplatform/v1/vizier_client.h +++ b/google/cloud/aiplatform/v1/vizier_client.h @@ -1334,7 +1334,7 @@ class VizierServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1373,7 +1373,7 @@ class VizierServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/alloydb/quickstart/.bazelversion b/google/cloud/alloydb/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/alloydb/quickstart/.bazelversion +++ b/google/cloud/alloydb/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/alloydb/quickstart/WORKSPACE.bazel b/google/cloud/alloydb/quickstart/WORKSPACE.bazel index 555662be341e4..f02f12b522bf7 100644 --- a/google/cloud/alloydb/quickstart/WORKSPACE.bazel +++ b/google/cloud/alloydb/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/alloydb/v1/alloy_db_admin_client.h b/google/cloud/alloydb/v1/alloy_db_admin_client.h index 8e124b0f0bb85..e344b37b5db26 100644 --- a/google/cloud/alloydb/v1/alloy_db_admin_client.h +++ b/google/cloud/alloydb/v1/alloy_db_admin_client.h @@ -1417,7 +1417,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// [google.cloud.alloydb.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1133} /// // clang-format on @@ -1456,7 +1456,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// [google.cloud.alloydb.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1133} /// // clang-format on @@ -1484,7 +1484,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1174} - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// // clang-format on StatusOr GetInstance( @@ -1514,7 +1514,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1174} - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// // clang-format on StatusOr GetInstance( @@ -1550,7 +1550,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.CreateInstanceRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1189} - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// // clang-format on future> CreateInstance( @@ -1605,7 +1605,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.CreateInstanceRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1189} - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// // clang-format on future> CreateInstance( @@ -1669,7 +1669,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.CreateSecondaryInstanceRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1227} - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// // clang-format on future> @@ -1724,7 +1724,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.CreateSecondaryInstanceRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1227} - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// // clang-format on future> @@ -1868,7 +1868,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// [google.cloud.alloydb.v1.UpdateInstanceRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1392} /// // clang-format on @@ -1921,7 +1921,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// [google.cloud.alloydb.v1.UpdateInstanceRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1392} /// // clang-format on @@ -2101,7 +2101,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.FailoverInstanceRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1467} - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// // clang-format on future> FailoverInstance( @@ -2154,7 +2154,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.FailoverInstanceRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1467} - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// // clang-format on future> FailoverInstance( @@ -2218,7 +2218,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.InjectFaultRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1499} - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// // clang-format on future> InjectFault( @@ -2273,7 +2273,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.InjectFaultRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1499} - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// // clang-format on future> InjectFault( @@ -2334,7 +2334,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// [google.cloud.alloydb.v1.RestartInstanceRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1543} /// // clang-format on @@ -2386,7 +2386,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L777} + /// [google.cloud.alloydb.v1.Instance]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L788} /// [google.cloud.alloydb.v1.RestartInstanceRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1543} /// // clang-format on @@ -2517,7 +2517,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1320} + /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1331} /// [google.cloud.alloydb.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1668} /// // clang-format on @@ -2556,7 +2556,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1320} + /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1331} /// [google.cloud.alloydb.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1668} /// // clang-format on @@ -2582,7 +2582,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1320} + /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1331} /// [google.cloud.alloydb.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1704} /// // clang-format on @@ -2612,7 +2612,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1320} + /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1331} /// [google.cloud.alloydb.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1704} /// // clang-format on @@ -2647,7 +2647,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1320} + /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1331} /// [google.cloud.alloydb.v1.CreateBackupRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1713} /// // clang-format on @@ -2702,7 +2702,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1320} + /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1331} /// [google.cloud.alloydb.v1.CreateBackupRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1713} /// // clang-format on @@ -2768,7 +2768,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1320} + /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1331} /// [google.cloud.alloydb.v1.UpdateBackupRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1749} /// // clang-format on @@ -2821,7 +2821,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1320} + /// [google.cloud.alloydb.v1.Backup]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1331} /// [google.cloud.alloydb.v1.UpdateBackupRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1749} /// // clang-format on @@ -3005,7 +3005,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1820} - /// [google.cloud.alloydb.v1.SupportedDatabaseFlag]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1515} + /// [google.cloud.alloydb.v1.SupportedDatabaseFlag]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1526} /// // clang-format on StreamRange @@ -3044,7 +3044,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1820} - /// [google.cloud.alloydb.v1.SupportedDatabaseFlag]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1515} + /// [google.cloud.alloydb.v1.SupportedDatabaseFlag]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1526} /// // clang-format on StreamRange @@ -3138,7 +3138,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.ConnectionInfo]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1289} + /// [google.cloud.alloydb.v1.ConnectionInfo]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1300} /// [google.cloud.alloydb.v1.GetConnectionInfoRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1911} /// // clang-format on @@ -3168,7 +3168,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.ConnectionInfo]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1289} + /// [google.cloud.alloydb.v1.ConnectionInfo]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1300} /// [google.cloud.alloydb.v1.GetConnectionInfoRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L1911} /// // clang-format on @@ -3204,7 +3204,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.ListUsersRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L2054} - /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1618} + /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1629} /// // clang-format on StreamRange ListUsers( @@ -3243,7 +3243,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.ListUsersRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L2054} - /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1618} + /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1629} /// // clang-format on StreamRange ListUsers( @@ -3269,7 +3269,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.GetUserRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L2090} - /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1618} + /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1629} /// // clang-format on StatusOr GetUser(std::string const& name, @@ -3299,7 +3299,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.GetUserRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L2090} - /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1618} + /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1629} /// // clang-format on StatusOr GetUser( @@ -3327,7 +3327,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.CreateUserRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L2100} - /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1618} + /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1629} /// // clang-format on StatusOr CreateUser( @@ -3358,7 +3358,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.CreateUserRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L2100} - /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1618} + /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1629} /// // clang-format on StatusOr CreateUser( @@ -3389,7 +3389,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.UpdateUserRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L2136} - /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1618} + /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1629} /// // clang-format on StatusOr UpdateUser( @@ -3420,7 +3420,7 @@ class AlloyDBAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.alloydb.v1.UpdateUserRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L2136} - /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1618} + /// [google.cloud.alloydb.v1.User]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1629} /// // clang-format on StatusOr UpdateUser( @@ -3504,7 +3504,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Database]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1660} + /// [google.cloud.alloydb.v1.Database]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1671} /// [google.cloud.alloydb.v1.ListDatabasesRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L2201} /// // clang-format on @@ -3543,7 +3543,7 @@ class AlloyDBAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.alloydb.v1.Database]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1660} + /// [google.cloud.alloydb.v1.Database]: @googleapis_reference_link{google/cloud/alloydb/v1/resources.proto#L1671} /// [google.cloud.alloydb.v1.ListDatabasesRequest]: @googleapis_reference_link{google/cloud/alloydb/v1/service.proto#L2201} /// // clang-format on @@ -3841,7 +3841,7 @@ class AlloyDBAdminClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -3880,7 +3880,7 @@ class AlloyDBAdminClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/apigateway/quickstart/.bazelversion b/google/cloud/apigateway/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/apigateway/quickstart/.bazelversion +++ b/google/cloud/apigateway/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/apigateway/quickstart/WORKSPACE.bazel b/google/cloud/apigateway/quickstart/WORKSPACE.bazel index 3a3b35ec59b86..6ca2bd527022d 100644 --- a/google/cloud/apigateway/quickstart/WORKSPACE.bazel +++ b/google/cloud/apigateway/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/apigeeconnect/quickstart/.bazelversion b/google/cloud/apigeeconnect/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/apigeeconnect/quickstart/.bazelversion +++ b/google/cloud/apigeeconnect/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/apigeeconnect/quickstart/WORKSPACE.bazel b/google/cloud/apigeeconnect/quickstart/WORKSPACE.bazel index 24a778490a9ca..1c1ed7007ab10 100644 --- a/google/cloud/apigeeconnect/quickstart/WORKSPACE.bazel +++ b/google/cloud/apigeeconnect/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/apikeys/quickstart/.bazelversion b/google/cloud/apikeys/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/apikeys/quickstart/.bazelversion +++ b/google/cloud/apikeys/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/apikeys/quickstart/WORKSPACE.bazel b/google/cloud/apikeys/quickstart/WORKSPACE.bazel index f438d57d021f8..7f452977f0276 100644 --- a/google/cloud/apikeys/quickstart/WORKSPACE.bazel +++ b/google/cloud/apikeys/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/apiregistry/quickstart/WORKSPACE.bazel b/google/cloud/apiregistry/quickstart/WORKSPACE.bazel index d903c87f0cfc4..53a888f6b610c 100644 --- a/google/cloud/apiregistry/quickstart/WORKSPACE.bazel +++ b/google/cloud/apiregistry/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/appengine/quickstart/.bazelversion b/google/cloud/appengine/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/appengine/quickstart/.bazelversion +++ b/google/cloud/appengine/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/appengine/quickstart/WORKSPACE.bazel b/google/cloud/appengine/quickstart/WORKSPACE.bazel index afa8fb5c7deca..7d3d753c83bc7 100644 --- a/google/cloud/appengine/quickstart/WORKSPACE.bazel +++ b/google/cloud/appengine/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/apphub/quickstart/.bazelversion b/google/cloud/apphub/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/apphub/quickstart/.bazelversion +++ b/google/cloud/apphub/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/apphub/quickstart/WORKSPACE.bazel b/google/cloud/apphub/quickstart/WORKSPACE.bazel index d5a1b3b678930..41080345991f4 100644 --- a/google/cloud/apphub/quickstart/WORKSPACE.bazel +++ b/google/cloud/apphub/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/apphub/v1/app_hub_client.h b/google/cloud/apphub/v1/app_hub_client.h index 341ab90c6a3b9..01d9a25501884 100644 --- a/google/cloud/apphub/v1/app_hub_client.h +++ b/google/cloud/apphub/v1/app_hub_client.h @@ -2870,7 +2870,7 @@ class AppHubClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2909,7 +2909,7 @@ class AppHubClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/artifactregistry/quickstart/.bazelversion b/google/cloud/artifactregistry/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/artifactregistry/quickstart/.bazelversion +++ b/google/cloud/artifactregistry/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/artifactregistry/quickstart/WORKSPACE.bazel b/google/cloud/artifactregistry/quickstart/WORKSPACE.bazel index 8b79b7a4c6fe5..786f392b39a73 100644 --- a/google/cloud/artifactregistry/quickstart/WORKSPACE.bazel +++ b/google/cloud/artifactregistry/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/asset/quickstart/.bazelversion b/google/cloud/asset/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/asset/quickstart/.bazelversion +++ b/google/cloud/asset/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/asset/quickstart/WORKSPACE.bazel b/google/cloud/asset/quickstart/WORKSPACE.bazel index ebb1d16354cd6..7b961ea2bd386 100644 --- a/google/cloud/asset/quickstart/WORKSPACE.bazel +++ b/google/cloud/asset/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/assuredworkloads/quickstart/.bazelversion b/google/cloud/assuredworkloads/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/assuredworkloads/quickstart/.bazelversion +++ b/google/cloud/assuredworkloads/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/assuredworkloads/quickstart/WORKSPACE.bazel b/google/cloud/assuredworkloads/quickstart/WORKSPACE.bazel index 7dd02e7b05180..978af6cf9bd2c 100644 --- a/google/cloud/assuredworkloads/quickstart/WORKSPACE.bazel +++ b/google/cloud/assuredworkloads/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/auditmanager/quickstart/WORKSPACE.bazel b/google/cloud/auditmanager/quickstart/WORKSPACE.bazel index c947bc2b49dfa..470f234bc480d 100644 --- a/google/cloud/auditmanager/quickstart/WORKSPACE.bazel +++ b/google/cloud/auditmanager/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/auditmanager/v1/audit_manager_client.h b/google/cloud/auditmanager/v1/audit_manager_client.h index de335a23be428..c6d499e15d510 100644 --- a/google/cloud/auditmanager/v1/audit_manager_client.h +++ b/google/cloud/auditmanager/v1/audit_manager_client.h @@ -1010,7 +1010,7 @@ class AuditManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1049,7 +1049,7 @@ class AuditManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/automl/quickstart/.bazelversion b/google/cloud/automl/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/automl/quickstart/.bazelversion +++ b/google/cloud/automl/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/automl/quickstart/WORKSPACE.bazel b/google/cloud/automl/quickstart/WORKSPACE.bazel index da71f08b40851..04c67d74dceda 100644 --- a/google/cloud/automl/quickstart/WORKSPACE.bazel +++ b/google/cloud/automl/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/backupdr/quickstart/.bazelversion b/google/cloud/backupdr/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/backupdr/quickstart/.bazelversion +++ b/google/cloud/backupdr/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/backupdr/quickstart/WORKSPACE.bazel b/google/cloud/backupdr/quickstart/WORKSPACE.bazel index 6cb84cc01d891..8520ec53e0084 100644 --- a/google/cloud/backupdr/quickstart/WORKSPACE.bazel +++ b/google/cloud/backupdr/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/backupdr/v1/backup_dr_client.h b/google/cloud/backupdr/v1/backup_dr_client.h index 72ef66c71b00f..a7f91c5096eac 100644 --- a/google/cloud/backupdr/v1/backup_dr_client.h +++ b/google/cloud/backupdr/v1/backup_dr_client.h @@ -2516,8 +2516,8 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L37} - /// [google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L184} + /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L38} + /// [google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L190} /// // clang-format on future> @@ -2574,8 +2574,8 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L37} - /// [google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L184} + /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L38} + /// [google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L190} /// // clang-format on future> @@ -2646,8 +2646,8 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L37} - /// [google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L371} + /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L38} + /// [google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L377} /// // clang-format on future> @@ -2703,8 +2703,8 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L37} - /// [google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L371} + /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L38} + /// [google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L377} /// // clang-format on future> @@ -2762,8 +2762,8 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L37} - /// [google.cloud.backupdr.v1.GetBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L329} + /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L38} + /// [google.cloud.backupdr.v1.GetBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L335} /// // clang-format on StatusOr @@ -2792,8 +2792,8 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L37} - /// [google.cloud.backupdr.v1.GetBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L329} + /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L38} + /// [google.cloud.backupdr.v1.GetBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L335} /// // clang-format on StatusOr @@ -2834,8 +2834,8 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L37} - /// [google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L224} + /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L38} + /// [google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L230} /// // clang-format on StreamRange @@ -2873,8 +2873,8 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L37} - /// [google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L224} + /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L38} + /// [google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L230} /// // clang-format on StreamRange @@ -2912,8 +2912,8 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L37} - /// [google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L269} + /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L38} + /// [google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L275} /// // clang-format on StreamRange @@ -2953,8 +2953,8 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L37} - /// [google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L269} + /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L38} + /// [google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L275} /// // clang-format on StreamRange @@ -2989,7 +2989,7 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L341} + /// [google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L347} /// [google.cloud.backupdr.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/backupdr/v1/backupdr.proto#L811} /// // clang-format on @@ -3040,7 +3040,7 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L341} + /// [google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L347} /// [google.cloud.backupdr.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/backupdr/v1/backupdr.proto#L811} /// // clang-format on @@ -3107,8 +3107,8 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L37} - /// [google.cloud.backupdr.v1.TriggerBackupRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L406} + /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L38} + /// [google.cloud.backupdr.v1.TriggerBackupRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L412} /// // clang-format on future> @@ -3160,8 +3160,8 @@ class BackupDRClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L37} - /// [google.cloud.backupdr.v1.TriggerBackupRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L406} + /// [google.cloud.backupdr.v1.BackupPlanAssociation]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L38} + /// [google.cloud.backupdr.v1.TriggerBackupRequest]: @googleapis_reference_link{google/cloud/backupdr/v1/backupplanassociation.proto#L412} /// // clang-format on future> @@ -3874,7 +3874,7 @@ class BackupDRClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -3913,7 +3913,7 @@ class BackupDRClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/baremetalsolution/quickstart/.bazelversion b/google/cloud/baremetalsolution/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/baremetalsolution/quickstart/.bazelversion +++ b/google/cloud/baremetalsolution/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/baremetalsolution/quickstart/WORKSPACE.bazel b/google/cloud/baremetalsolution/quickstart/WORKSPACE.bazel index 2bbf5346864da..695af951e71e7 100644 --- a/google/cloud/baremetalsolution/quickstart/WORKSPACE.bazel +++ b/google/cloud/baremetalsolution/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/batch/quickstart/.bazelversion b/google/cloud/batch/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/batch/quickstart/.bazelversion +++ b/google/cloud/batch/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/batch/quickstart/WORKSPACE.bazel b/google/cloud/batch/quickstart/WORKSPACE.bazel index 9b9a41d616e93..5255497de7f10 100644 --- a/google/cloud/batch/quickstart/WORKSPACE.bazel +++ b/google/cloud/batch/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/batch/v1/batch_client.h b/google/cloud/batch/v1/batch_client.h index e0d673a6cbe3b..c9f774648a7c7 100644 --- a/google/cloud/batch/v1/batch_client.h +++ b/google/cloud/batch/v1/batch_client.h @@ -932,7 +932,7 @@ class BatchServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -971,7 +971,7 @@ class BatchServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/beyondcorp/appconnections/v1/app_connections_client.h b/google/cloud/beyondcorp/appconnections/v1/app_connections_client.h index 13b38fe88d535..baccc5d46be77 100644 --- a/google/cloud/beyondcorp/appconnections/v1/app_connections_client.h +++ b/google/cloud/beyondcorp/appconnections/v1/app_connections_client.h @@ -1090,7 +1090,7 @@ class AppConnectionsServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1129,7 +1129,7 @@ class AppConnectionsServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/beyondcorp/appconnectors/v1/app_connectors_client.h b/google/cloud/beyondcorp/appconnectors/v1/app_connectors_client.h index 566b6476d2783..43dfb62e635d7 100644 --- a/google/cloud/beyondcorp/appconnectors/v1/app_connectors_client.h +++ b/google/cloud/beyondcorp/appconnectors/v1/app_connectors_client.h @@ -1129,7 +1129,7 @@ class AppConnectorsServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1168,7 +1168,7 @@ class AppConnectorsServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/beyondcorp/appgateways/v1/app_gateways_client.h b/google/cloud/beyondcorp/appgateways/v1/app_gateways_client.h index b317410b2be2d..51225a729eaab 100644 --- a/google/cloud/beyondcorp/appgateways/v1/app_gateways_client.h +++ b/google/cloud/beyondcorp/appgateways/v1/app_gateways_client.h @@ -878,7 +878,7 @@ class AppGatewaysServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -917,7 +917,7 @@ class AppGatewaysServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/beyondcorp/quickstart/.bazelversion b/google/cloud/beyondcorp/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/beyondcorp/quickstart/.bazelversion +++ b/google/cloud/beyondcorp/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/beyondcorp/quickstart/WORKSPACE.bazel b/google/cloud/beyondcorp/quickstart/WORKSPACE.bazel index 3c7693efb45f4..d0fe1375246a8 100644 --- a/google/cloud/beyondcorp/quickstart/WORKSPACE.bazel +++ b/google/cloud/beyondcorp/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/bigquery/quickstart/.bazelversion b/google/cloud/bigquery/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/bigquery/quickstart/.bazelversion +++ b/google/cloud/bigquery/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/bigquery/quickstart/MODULE.bazel b/google/cloud/bigquery/quickstart/MODULE.bazel index 769db68723a0d..e47bfb6fa8af0 100644 --- a/google/cloud/bigquery/quickstart/MODULE.bazel +++ b/google/cloud/bigquery/quickstart/MODULE.bazel @@ -17,4 +17,4 @@ module( version = "0.0.0", ) -bazel_dep(name = "google_cloud_cpp", version = "3.1.0") +bazel_dep(name = "google_cloud_cpp", version = "3.2.0") diff --git a/google/cloud/bigquery/quickstart/WORKSPACE.bazel b/google/cloud/bigquery/quickstart/WORKSPACE.bazel index 1e2dfae17a4c2..e0e1e9a22acb2 100644 --- a/google/cloud/bigquery/quickstart/WORKSPACE.bazel +++ b/google/cloud/bigquery/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/bigquery/v2/minimal/benchmarks/benchmarks_config.cc b/google/cloud/bigquery/v2/minimal/benchmarks/benchmarks_config.cc index 83a0119653c6e..2112c9d398126 100644 --- a/google/cloud/bigquery/v2/minimal/benchmarks/benchmarks_config.cc +++ b/google/cloud/bigquery/v2/minimal/benchmarks/benchmarks_config.cc @@ -359,6 +359,9 @@ google::cloud::StatusOr JobConfig::ParseArgs( flags_.push_back( {"--use-int64-timestamp=", "outputs timestamp as usec int64", [this](std::string const& v) { use_int64_timestamp = (v == "true"); }}); + flags_.push_back( + {"--timestamp-output-format=", "sets timestamp output format", + [this](std::string const& v) { timestamp_output_format = v; }}); flags_.push_back( {"--min-creation-time=", "min job creation time. If set, only jobs created after or at this " diff --git a/google/cloud/bigquery/v2/minimal/benchmarks/benchmarks_config.h b/google/cloud/bigquery/v2/minimal/benchmarks/benchmarks_config.h index aaf908fabf0c1..99a75a8840c03 100644 --- a/google/cloud/bigquery/v2/minimal/benchmarks/benchmarks_config.h +++ b/google/cloud/bigquery/v2/minimal/benchmarks/benchmarks_config.h @@ -100,6 +100,7 @@ struct JobConfig : public Config { int start_index = 0; int timeout_ms; bool use_int64_timestamp; + std::string timestamp_output_format; bigquery_v2_minimal_internal::Projection projection; bigquery_v2_minimal_internal::StateFilter state_filter; diff --git a/google/cloud/bigquery/v2/minimal/internal/job_request.cc b/google/cloud/bigquery/v2/minimal/internal/job_request.cc index 0c2063e936368..d3404627870fb 100644 --- a/google/cloud/bigquery/v2/minimal/internal/job_request.cc +++ b/google/cloud/bigquery/v2/minimal/internal/job_request.cc @@ -343,6 +343,7 @@ std::string DataFormatOptions::DebugString(absl::string_view name, int indent) const { return internal::DebugFormatter(name, options, indent) .Field("use_int64_timestamp", use_int64_timestamp) + .Field("timestamp_output_format", timestamp_output_format) .Build(); } diff --git a/google/cloud/bigquery/v2/minimal/internal/job_request.h b/google/cloud/bigquery/v2/minimal/internal/job_request.h index 2c59df70d2e51..f35d056d7bce5 100644 --- a/google/cloud/bigquery/v2/minimal/internal/job_request.h +++ b/google/cloud/bigquery/v2/minimal/internal/job_request.h @@ -311,14 +311,17 @@ class CancelJobRequest { struct DataFormatOptions { DataFormatOptions() = default; + bool use_int64_timestamp = false; + std::string timestamp_output_format = "TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED"; std::string DebugString(absl::string_view name, TracingOptions const& options = {}, int indent = 0) const; }; NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(DataFormatOptions, - use_int64_timestamp); + use_int64_timestamp, + timestamp_output_format); // Indicates the type of compute mode for the query stage. // diff --git a/google/cloud/bigquery/v2/minimal/internal/job_request_test.cc b/google/cloud/bigquery/v2/minimal/internal/job_request_test.cc index 3e27d9b18ee72..d1be2f64247a8 100644 --- a/google/cloud/bigquery/v2/minimal/internal/job_request_test.cc +++ b/google/cloud/bigquery/v2/minimal/internal/job_request_test.cc @@ -1028,7 +1028,7 @@ TEST(PostQueryRequestTest, DebugString) { R"( parameter_value { value: "query-parameter-value" } })" R"( labels { key: "lk1" value: "lv1" } labels { key: "lk2" value: "lv2" })" R"( default_dataset { project_id: "2" dataset_id: "1" })" - R"( format_options { use_int64_timestamp: true })" + R"( format_options { use_int64_timestamp: true timestamp_output_format: TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED })" R"( job_creation_mode { value: "JOB_CREATION_MODE_UNSPECIFIED" } } })"); EXPECT_EQ( @@ -1049,7 +1049,7 @@ TEST(PostQueryRequestTest, DebugString) { R"( parameter_value { value: "query-p......" } })" R"( labels { key: "lk1" value: "lv1" } labels { key: "lk2" value: "lv2" })" R"( default_dataset { project_id: "2" dataset_id: "1" })" - R"( format_options { use_int64_timestamp: true })" + R"( format_options { use_int64_timestamp: true timestamp_output_format: TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED })" R"( job_creation_mode { value: "JOB_CRE......" } } })"); EXPECT_EQ(request.DebugString("PostQueryRequest", TracingOptions{}.SetOptions( @@ -1103,6 +1103,7 @@ TEST(PostQueryRequestTest, DebugString) { } format_options { use_int64_timestamp: true + timestamp_output_format: TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED } job_creation_mode { value: "JOB_CREATION_MODE_UNSPECIFIED" diff --git a/google/cloud/bigquery/v2/minimal/internal/log_wrapper.h b/google/cloud/bigquery/v2/minimal/internal/log_wrapper.h index 2337435bbf05a..f689cb0aef151 100644 --- a/google/cloud/bigquery/v2/minimal/internal/log_wrapper.h +++ b/google/cloud/bigquery/v2/minimal/internal/log_wrapper.h @@ -38,10 +38,11 @@ Result LogWrapper(Functor&& functor, rest_internal::RestContext& context, TracingOptions const& options) { auto formatter = [options](std::string* out, auto const& header) { auto const* delim = options.single_line_mode() ? "&" : "\n"; - absl::StrAppend( - out, " { name: \"", header.first, "\" value: \"", - internal::DebugString(absl::StrJoin(header.second, delim), options), - "\" }"); + absl::StrAppend(out, " { name: \"", std::string_view{header.first}, + "\" value: \"", + internal::DebugString( + absl::StrJoin(header.second.values(), delim), options), + "\" }"); }; GCP_LOG(DEBUG) << where << "() << " << request.DebugString(request_name, options) << ", Context {" diff --git a/google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h b/google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h index ca0762f1a05b1..34dd83a79a44f 100644 --- a/google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h +++ b/google/cloud/bigquery/v2/minimal/internal/rest_stub_utils.h @@ -48,7 +48,7 @@ StatusOr PrepareRestRequest( if (!rest_context.headers().empty()) { for (auto const& h : rest_context.headers()) { if (!h.second.empty()) { - rest_request->AddHeader(h.first, absl::StrJoin(h.second, "&")); + rest_request->AddHeader(h.first, absl::StrJoin(h.second.values(), "&")); } } } diff --git a/google/cloud/bigquery/v2/minimal/testing/metadata_test_utils.cc b/google/cloud/bigquery/v2/minimal/testing/metadata_test_utils.cc index 9116da715a518..4efa4545f6f36 100644 --- a/google/cloud/bigquery/v2/minimal/testing/metadata_test_utils.cc +++ b/google/cloud/bigquery/v2/minimal/testing/metadata_test_utils.cc @@ -30,13 +30,15 @@ static auto const kUserProject = "test-only-project"; static auto const kQuotaUser = "test-quota-user"; void VerifyMetadataContext(rest_internal::RestContext& context) { - EXPECT_THAT(context.GetHeader("x-goog-api-client"), + EXPECT_THAT(context.GetHeader("x-goog-api-client").values(), ElementsAre(internal::HandCraftedLibClientHeader())); - EXPECT_THAT(context.GetHeader("x-goog-request-params"), IsEmpty()); - EXPECT_THAT(context.GetHeader("x-goog-user-project"), + EXPECT_THAT(context.GetHeader("x-goog-request-params").values(), IsEmpty()); + EXPECT_THAT(context.GetHeader("x-goog-user-project").values(), ElementsAre(kUserProject)); - EXPECT_THAT(context.GetHeader("x-goog-quota-user"), ElementsAre(kQuotaUser)); - EXPECT_THAT(context.GetHeader("x-server-timeout"), ElementsAre("3.141")); + EXPECT_THAT(context.GetHeader("x-goog-quota-user").values(), + ElementsAre(kQuotaUser)); + EXPECT_THAT(context.GetHeader("x-server-timeout").values(), + ElementsAre("3.141")); } Options GetMetadataOptions() { diff --git a/google/cloud/bigquerycontrol/quickstart/.bazelversion b/google/cloud/bigquerycontrol/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/bigquerycontrol/quickstart/.bazelversion +++ b/google/cloud/bigquerycontrol/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/bigquerycontrol/quickstart/WORKSPACE.bazel b/google/cloud/bigquerycontrol/quickstart/WORKSPACE.bazel index 9417a12d157ed..d58d28e192dc6 100644 --- a/google/cloud/bigquerycontrol/quickstart/WORKSPACE.bazel +++ b/google/cloud/bigquerycontrol/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/bigtable/CMakeLists.txt b/google/cloud/bigtable/CMakeLists.txt index 4449a71d74515..5dc1c42f4ed68 100644 --- a/google/cloud/bigtable/CMakeLists.txt +++ b/google/cloud/bigtable/CMakeLists.txt @@ -155,6 +155,8 @@ add_library( internal/bigtable_logging_decorator.h internal/bigtable_metadata_decorator.cc internal/bigtable_metadata_decorator.h + internal/bigtable_random_two_least_used_decorator.cc + internal/bigtable_random_two_least_used_decorator.h internal/bigtable_round_robin_decorator.cc internal/bigtable_round_robin_decorator.h internal/bigtable_stub.cc @@ -165,6 +167,7 @@ add_library( internal/bigtable_tracing_stub.h internal/bulk_mutator.cc internal/bulk_mutator.h + internal/channel_usage.h internal/client_options_defaults.h internal/common_client.h internal/connection_refresh_state.cc @@ -183,6 +186,7 @@ add_library( internal/default_row_reader.h internal/defaults.cc internal/defaults.h + internal/dynamic_channel_pool.h internal/endpoint_options.h internal/google_bytes_traits.cc internal/google_bytes_traits.h @@ -214,6 +218,8 @@ add_library( internal/row_reader_impl.h internal/rpc_policy_parameters.h internal/rpc_policy_parameters.inc + internal/stub_manager.cc + internal/stub_manager.h internal/traced_row_reader.cc internal/traced_row_reader.h internal/tuple_utils.h @@ -440,8 +446,10 @@ if (BUILD_TESTING) internal/async_row_sampler_test.cc internal/async_streaming_read_test.cc internal/bigtable_channel_refresh_test.cc + internal/bigtable_random_two_least_used_decorator_test.cc internal/bigtable_stub_factory_test.cc internal/bulk_mutator_test.cc + internal/channel_usage_test.cc internal/connection_refresh_state_test.cc internal/convert_policies_test.cc internal/crc32c_test.cc @@ -449,6 +457,7 @@ if (BUILD_TESTING) internal/data_tracing_connection_test.cc internal/default_row_reader_test.cc internal/defaults_test.cc + internal/dynamic_channel_pool_test.cc internal/google_bytes_traits_test.cc internal/logging_result_set_reader_test.cc internal/metrics_test.cc @@ -461,6 +470,7 @@ if (BUILD_TESTING) internal/query_plan_test.cc internal/rate_limiter_test.cc internal/retry_traits_test.cc + internal/stub_manager_test.cc internal/traced_row_reader_test.cc internal/tuple_utils_test.cc mocks/mock_row_reader_test.cc diff --git a/google/cloud/bigtable/admin/bigtable_table_admin_client.h b/google/cloud/bigtable/admin/bigtable_table_admin_client.h index b4b3e849d63fd..cb10d31bfe4a8 100644 --- a/google/cloud/bigtable/admin/bigtable_table_admin_client.h +++ b/google/cloud/bigtable/admin/bigtable_table_admin_client.h @@ -620,7 +620,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L279} + /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L290} /// [google.bigtable.admin.v2.CreateAuthorizedViewRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1366} /// // clang-format on @@ -676,7 +676,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L279} + /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L290} /// [google.bigtable.admin.v2.CreateAuthorizedViewRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1366} /// // clang-format on @@ -743,7 +743,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L279} + /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L290} /// [google.bigtable.admin.v2.ListAuthorizedViewsRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1402} /// // clang-format on @@ -782,7 +782,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L279} + /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L290} /// [google.bigtable.admin.v2.ListAuthorizedViewsRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1402} /// // clang-format on @@ -810,7 +810,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L279} + /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L290} /// [google.bigtable.admin.v2.GetAuthorizedViewRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1446} /// // clang-format on @@ -840,7 +840,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L279} + /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L290} /// [google.bigtable.admin.v2.GetAuthorizedViewRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1446} /// // clang-format on @@ -883,7 +883,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L279} + /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L290} /// [google.bigtable.admin.v2.UpdateAuthorizedViewRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1464} /// // clang-format on @@ -938,7 +938,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L279} + /// [google.bigtable.admin.v2.AuthorizedView]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L290} /// [google.bigtable.admin.v2.UpdateAuthorizedViewRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1464} /// // clang-format on @@ -1300,7 +1300,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L507} + /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L518} /// [google.bigtable.admin.v2.CreateBackupMetadata]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1143} /// [google.bigtable.admin.v2.CreateBackupRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1118} /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L121} @@ -1364,7 +1364,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L507} + /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L518} /// [google.bigtable.admin.v2.CreateBackupMetadata]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1143} /// [google.bigtable.admin.v2.CreateBackupRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1118} /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L121} @@ -1424,7 +1424,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L507} + /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L518} /// [google.bigtable.admin.v2.GetBackupRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1178} /// // clang-format on @@ -1454,7 +1454,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L507} + /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L518} /// [google.bigtable.admin.v2.GetBackupRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1178} /// // clang-format on @@ -1489,7 +1489,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L507} + /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L518} /// [google.bigtable.admin.v2.UpdateBackupRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1159} /// // clang-format on @@ -1520,7 +1520,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L507} + /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L518} /// [google.bigtable.admin.v2.UpdateBackupRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1159} /// // clang-format on @@ -1610,7 +1610,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L507} + /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L518} /// [google.bigtable.admin.v2.ListBackupsRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1206} /// // clang-format on @@ -1650,7 +1650,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L507} + /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L518} /// [google.bigtable.admin.v2.ListBackupsRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1206} /// // clang-format on @@ -1780,7 +1780,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L507} + /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L518} /// [google.bigtable.admin.v2.CopyBackupRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1303} /// // clang-format on @@ -1836,7 +1836,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L507} + /// [google.bigtable.admin.v2.Backup]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L518} /// [google.bigtable.admin.v2.CopyBackupRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1303} /// // clang-format on @@ -2113,7 +2113,7 @@ class BigtableTableAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.bigtable.admin.v2.CreateSchemaBundleRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1522} - /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L692} + /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L703} /// // clang-format on future> @@ -2170,7 +2170,7 @@ class BigtableTableAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.bigtable.admin.v2.CreateSchemaBundleRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1522} - /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L692} + /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L703} /// // clang-format on future> @@ -2237,7 +2237,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L692} + /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L703} /// [google.bigtable.admin.v2.UpdateSchemaBundleRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1558} /// // clang-format on @@ -2292,7 +2292,7 @@ class BigtableTableAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L692} + /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L703} /// [google.bigtable.admin.v2.UpdateSchemaBundleRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1558} /// // clang-format on @@ -2351,7 +2351,7 @@ class BigtableTableAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.bigtable.admin.v2.GetSchemaBundleRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1594} - /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L692} + /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L703} /// // clang-format on StatusOr GetSchemaBundle( @@ -2381,7 +2381,7 @@ class BigtableTableAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.bigtable.admin.v2.GetSchemaBundleRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1594} - /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L692} + /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L703} /// // clang-format on StatusOr GetSchemaBundle( @@ -2418,7 +2418,7 @@ class BigtableTableAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.bigtable.admin.v2.ListSchemaBundlesRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1608} - /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L692} + /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L703} /// // clang-format on StreamRange ListSchemaBundles( @@ -2457,7 +2457,7 @@ class BigtableTableAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.bigtable.admin.v2.ListSchemaBundlesRequest]: @googleapis_reference_link{google/bigtable/admin/v2/bigtable_table_admin.proto#L1608} - /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L692} + /// [google.bigtable.admin.v2.SchemaBundle]: @googleapis_reference_link{google/bigtable/admin/v2/table.proto#L703} /// // clang-format on StreamRange ListSchemaBundles( diff --git a/google/cloud/bigtable/bigtable_client_unit_tests.bzl b/google/cloud/bigtable/bigtable_client_unit_tests.bzl index 6c95291b749a2..4c9b3784556f4 100644 --- a/google/cloud/bigtable/bigtable_client_unit_tests.bzl +++ b/google/cloud/bigtable/bigtable_client_unit_tests.bzl @@ -42,8 +42,10 @@ bigtable_client_unit_tests = [ "internal/async_row_sampler_test.cc", "internal/async_streaming_read_test.cc", "internal/bigtable_channel_refresh_test.cc", + "internal/bigtable_random_two_least_used_decorator_test.cc", "internal/bigtable_stub_factory_test.cc", "internal/bulk_mutator_test.cc", + "internal/channel_usage_test.cc", "internal/connection_refresh_state_test.cc", "internal/convert_policies_test.cc", "internal/crc32c_test.cc", @@ -51,6 +53,7 @@ bigtable_client_unit_tests = [ "internal/data_tracing_connection_test.cc", "internal/default_row_reader_test.cc", "internal/defaults_test.cc", + "internal/dynamic_channel_pool_test.cc", "internal/google_bytes_traits_test.cc", "internal/logging_result_set_reader_test.cc", "internal/metrics_test.cc", @@ -63,6 +66,7 @@ bigtable_client_unit_tests = [ "internal/query_plan_test.cc", "internal/rate_limiter_test.cc", "internal/retry_traits_test.cc", + "internal/stub_manager_test.cc", "internal/traced_row_reader_test.cc", "internal/tuple_utils_test.cc", "mocks/mock_row_reader_test.cc", diff --git a/google/cloud/bigtable/ci/run_integration_tests_emulator_bazel.sh b/google/cloud/bigtable/ci/run_integration_tests_emulator_bazel.sh index ba218743f7e64..953d572d526be 100755 --- a/google/cloud/bigtable/ci/run_integration_tests_emulator_bazel.sh +++ b/google/cloud/bigtable/ci/run_integration_tests_emulator_bazel.sh @@ -59,8 +59,10 @@ source module /google/cloud/bigtable/tools/run_emulator_utils.sh production_only_targets=( "//google/cloud/bigtable/examples:bigtable_table_admin_backup_snippets" "//google/cloud/bigtable/examples:table_admin_iam_policy_snippets" - "//google/cloud/bigtable/tests:table_admin_backup_integration_test" - "//google/cloud/bigtable/tests:table_admin_iam_policy_integration_test" + "//google/cloud/bigtable/tests:table_admin_backup_integration_test-default" + "//google/cloud/bigtable/tests:table_admin_iam_policy_integration_test-default" + "//google/cloud/bigtable/tests:table_admin_backup_integration_test-dynamic-pool" + "//google/cloud/bigtable/tests:table_admin_iam_policy_integration_test-dynamic-pool" ) # Coverage builds are more subject to flakiness, as we must explicitly disable diff --git a/google/cloud/bigtable/data_connection.cc b/google/cloud/bigtable/data_connection.cc index bada0bb3d7952..91ee5a61d5b46 100644 --- a/google/cloud/bigtable/data_connection.cc +++ b/google/cloud/bigtable/data_connection.cc @@ -184,14 +184,35 @@ std::shared_ptr MakeDataConnection(Options options) { google::cloud::internal::MakeBackgroundThreadsFactory(options)(); auto auth = google::cloud::internal::CreateAuthenticationStrategy( background->cq(), options); - auto stub = bigtable_internal::CreateBigtableStub(std::move(auth), - background->cq(), options); auto limiter = bigtable_internal::MakeMutateRowsLimiter(background->cq(), options); - std::shared_ptr conn = - std::make_shared( - std::move(background), std::move(stub), std::move(limiter), - std::move(options)); + std::shared_ptr conn; + + if (options.has()) { + auto stub_creation_fn = + [auth, cq = background->cq(), options]( + std::string_view instance_name, + bigtable_internal::StubManager::Priming priming) { + return bigtable_internal::CreateBigtableStub(auth, cq, instance_name, + priming, options); + }; + + auto affinity_stubs = bigtable_internal::CreateBigtableAffinityStubs( + options.get(), + stub_creation_fn); + conn = std::make_shared( + std::move(background), + std::make_unique( + std::move(affinity_stubs), stub_creation_fn), + std::move(limiter), std::move(options)); + } else { + auto stub = bigtable_internal::CreateBigtableStub( + std::move(auth), background->cq(), options); + conn = std::make_shared( + std::move(background), + std::make_unique(std::move(stub)), + std::move(limiter), std::move(options)); + } if (google::cloud::internal::TracingEnabled(conn->options())) { conn = bigtable_internal::MakeDataTracingConnection(std::move(conn)); } diff --git a/google/cloud/bigtable/data_connection_test.cc b/google/cloud/bigtable/data_connection_test.cc index e51d7f38819e8..2682aa2dee32e 100644 --- a/google/cloud/bigtable/data_connection_test.cc +++ b/google/cloud/bigtable/data_connection_test.cc @@ -13,6 +13,7 @@ // limitations under the License. #include "google/cloud/bigtable/data_connection.h" +#include "google/cloud/bigtable/internal/bigtable_stub_factory.h" #include "google/cloud/bigtable/options.h" #include "google/cloud/common_options.h" #include "google/cloud/credentials.h" @@ -29,6 +30,12 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { using ms = std::chrono::milliseconds; +using ::google::cloud::testing_util::DisableTracing; +using ::google::cloud::testing_util::EnableTracing; +using ::google::cloud::testing_util::SpanNamed; +using ::testing::Contains; +using ::testing::Eq; +using ::testing::IsEmpty; Options TestOptions() { return Options{} @@ -54,12 +61,6 @@ TEST(MakeDataConnection, DefaultsOptions) { << "User supplied Options are overridden in MakeDataConnection()"; } -using ::google::cloud::testing_util::DisableTracing; -using ::google::cloud::testing_util::EnableTracing; -using ::google::cloud::testing_util::SpanNamed; -using ::testing::Contains; -using ::testing::IsEmpty; - TEST(MakeDataConnection, TracingEnabled) { auto span_catcher = testing_util::InstallSpanCatcher(); @@ -71,6 +72,24 @@ TEST(MakeDataConnection, TracingEnabled) { Contains(SpanNamed("bigtable::Table::Apply"))); } +TEST(MakeDataConnection, InstanceChannelAffinityOption) { + InstanceResource instance_a{Project("my-project"), "instance-a"}; + InstanceResource instance_b{Project("my-project"), "instance-b"}; + auto conn = + MakeDataConnection(TestOptions() + .set("user-supplied") + .set( + {instance_a, instance_b})); + auto options = conn->options(); + EXPECT_TRUE(options.has()) + << "Options are not defaulted in MakeDataConnection()"; + EXPECT_EQ(options.get(), "user-supplied") + << "User supplied Options are overridden in MakeDataConnection()"; + ASSERT_TRUE(options.has()); + EXPECT_THAT(options.get().size(), + Eq(2)); +} + TEST(MakeDataConnection, TracingDisabled) { auto span_catcher = testing_util::InstallSpanCatcher(); diff --git a/google/cloud/bigtable/google_cloud_cpp_bigtable.bzl b/google/cloud/bigtable/google_cloud_cpp_bigtable.bzl index 2ecc66c6fd37e..e8f2fe5650641 100644 --- a/google/cloud/bigtable/google_cloud_cpp_bigtable.bzl +++ b/google/cloud/bigtable/google_cloud_cpp_bigtable.bzl @@ -74,11 +74,13 @@ google_cloud_cpp_bigtable_hdrs = [ "internal/bigtable_channel_refresh.h", "internal/bigtable_logging_decorator.h", "internal/bigtable_metadata_decorator.h", + "internal/bigtable_random_two_least_used_decorator.h", "internal/bigtable_round_robin_decorator.h", "internal/bigtable_stub.h", "internal/bigtable_stub_factory.h", "internal/bigtable_tracing_stub.h", "internal/bulk_mutator.h", + "internal/channel_usage.h", "internal/client_options_defaults.h", "internal/common_client.h", "internal/connection_refresh_state.h", @@ -89,6 +91,7 @@ google_cloud_cpp_bigtable_hdrs = [ "internal/data_tracing_connection.h", "internal/default_row_reader.h", "internal/defaults.h", + "internal/dynamic_channel_pool.h", "internal/endpoint_options.h", "internal/google_bytes_traits.h", "internal/logging_result_set_reader.h", @@ -107,6 +110,7 @@ google_cloud_cpp_bigtable_hdrs = [ "internal/row_reader_impl.h", "internal/rpc_policy_parameters.h", "internal/rpc_policy_parameters.inc", + "internal/stub_manager.h", "internal/traced_row_reader.h", "internal/tuple_utils.h", "internal/unary_client_utils.h", @@ -187,6 +191,7 @@ google_cloud_cpp_bigtable_srcs = [ "internal/bigtable_channel_refresh.cc", "internal/bigtable_logging_decorator.cc", "internal/bigtable_metadata_decorator.cc", + "internal/bigtable_random_two_least_used_decorator.cc", "internal/bigtable_round_robin_decorator.cc", "internal/bigtable_stub.cc", "internal/bigtable_stub_factory.cc", @@ -213,6 +218,7 @@ google_cloud_cpp_bigtable_srcs = [ "internal/rate_limiter.cc", "internal/readrowsparser.cc", "internal/retry_traits.cc", + "internal/stub_manager.cc", "internal/traced_row_reader.cc", "mutation_batcher.cc", "mutations.cc", diff --git a/google/cloud/bigtable/internal/bigtable_auth_decorator.cc b/google/cloud/bigtable/internal/bigtable_auth_decorator.cc index 19f04976bea39..75619c26258a6 100644 --- a/google/cloud/bigtable/internal/bigtable_auth_decorator.cc +++ b/google/cloud/bigtable/internal/bigtable_auth_decorator.cc @@ -224,6 +224,27 @@ BigtableAuth::AsyncCheckAndMutateRow( }); } +future> +BigtableAuth::AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest 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( + StatusOr( + std::move(context).status())); + } + return child->AsyncPingAndWarm(cq, *std::move(context), + std::move(options), request); + }); +} + future> BigtableAuth::AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_auth_decorator.h b/google/cloud/bigtable/internal/bigtable_auth_decorator.h index 08cb2328cd4fa..6118e588383e9 100644 --- a/google/cloud/bigtable/internal/bigtable_auth_decorator.h +++ b/google/cloud/bigtable/internal/bigtable_auth_decorator.h @@ -120,6 +120,12 @@ class BigtableAuth : public BigtableStub { google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request) override; + future> AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) override; + future> AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_channel_refresh.cc b/google/cloud/bigtable/internal/bigtable_channel_refresh.cc index 5e3cf133a8c2c..af3c6b754b301 100644 --- a/google/cloud/bigtable/internal/bigtable_channel_refresh.cc +++ b/google/cloud/bigtable/internal/bigtable_channel_refresh.cc @@ -139,6 +139,16 @@ BigtableChannelRefresh::AsyncCheckAndMutateRow( std::move(options), request); } +future> +BigtableChannelRefresh::AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) { + return child_->AsyncPingAndWarm(cq, std::move(context), std::move(options), + request); +} + future> BigtableChannelRefresh::AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_channel_refresh.h b/google/cloud/bigtable/internal/bigtable_channel_refresh.h index 7207b3c9f9aea..4c55ff34d0376 100644 --- a/google/cloud/bigtable/internal/bigtable_channel_refresh.h +++ b/google/cloud/bigtable/internal/bigtable_channel_refresh.h @@ -124,6 +124,12 @@ class BigtableChannelRefresh : public BigtableStub { google::cloud::internal::ImmutableOptions, google::bigtable::v2::CheckAndMutateRowRequest const& request) override; + future> AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) override; + future> AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_logging_decorator.cc b/google/cloud/bigtable/internal/bigtable_logging_decorator.cc index f1119bb28c20e..07523e4b92c84 100644 --- a/google/cloud/bigtable/internal/bigtable_logging_decorator.cc +++ b/google/cloud/bigtable/internal/bigtable_logging_decorator.cc @@ -304,6 +304,24 @@ BigtableLogging::AsyncCheckAndMutateRow( tracing_options_); } +future> +BigtableLogging::AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) { + return child_->AsyncPingAndWarm(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + future> BigtableLogging::AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_logging_decorator.h b/google/cloud/bigtable/internal/bigtable_logging_decorator.h index d9badbe7a8397..5f5cf619a142d 100644 --- a/google/cloud/bigtable/internal/bigtable_logging_decorator.h +++ b/google/cloud/bigtable/internal/bigtable_logging_decorator.h @@ -120,6 +120,12 @@ class BigtableLogging : public BigtableStub { google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request) override; + future> AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) override; + future> AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_metadata_decorator.cc b/google/cloud/bigtable/internal/bigtable_metadata_decorator.cc index 60c974265a565..acc434bc39dc0 100644 --- a/google/cloud/bigtable/internal/bigtable_metadata_decorator.cc +++ b/google/cloud/bigtable/internal/bigtable_metadata_decorator.cc @@ -658,6 +658,42 @@ BigtableMetadata::AsyncCheckAndMutateRow( std::move(options), request); } +future> +BigtableMetadata::AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) { + std::vector params; + params.reserve(2); + + static auto* name_matcher = [] { + return new google::cloud::internal::RoutingMatcher< + google::bigtable::v2::PingAndWarmRequest>{ + "name=", + { + {[](google::bigtable::v2::PingAndWarmRequest const& request) + -> std::string const& { return request.name(); }, + std::regex{"(projects/[^/]+/instances/[^/]+)", + std::regex::optimize}}, + }}; + }(); + name_matcher->AppendParam(request, params); + + if (!request.app_profile_id().empty()) { + params.push_back(absl::StrCat( + "app_profile_id=", internal::UrlEncode(request.app_profile_id()))); + } + + if (params.empty()) { + SetMetadata(*context, *options); + } else { + SetMetadata(*context, *options, absl::StrJoin(params, "&")); + } + return child_->AsyncPingAndWarm(cq, std::move(context), std::move(options), + request); +} + future> BigtableMetadata::AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_metadata_decorator.h b/google/cloud/bigtable/internal/bigtable_metadata_decorator.h index 62833cd40c71d..70cf99b4a72e6 100644 --- a/google/cloud/bigtable/internal/bigtable_metadata_decorator.h +++ b/google/cloud/bigtable/internal/bigtable_metadata_decorator.h @@ -120,6 +120,12 @@ class BigtableMetadata : public BigtableStub { google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request) override; + future> AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) override; + future> AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.cc b/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.cc new file mode 100644 index 0000000000000..82dff64f0cdd5 --- /dev/null +++ b/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.cc @@ -0,0 +1,343 @@ +// Copyright 2026 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 "google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.h" +#include "google/cloud/internal/async_streaming_read_rpc.h" +#include "google/cloud/internal/streaming_read_rpc.h" +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { + +template +class StreamingReadRpcTracking + : public google::cloud::internal::StreamingReadRpc { + public: + StreamingReadRpcTracking( + std::unique_ptr> child, + std::function on_destruction) + : child_(std::move(child)), on_destruction_(std::move(on_destruction)) {} + + ~StreamingReadRpcTracking() override { on_destruction_(); } + + void Cancel() override { child_->Cancel(); } + std::optional Read(T* response) override { + return child_->Read(response); + } + RpcMetadata GetRequestMetadata() const override { + return child_->GetRequestMetadata(); + } + + private: + std::unique_ptr> child_; + std::function on_destruction_; +}; + +template +class AsyncStreamingReadRpcTracking + : public google::cloud::internal::AsyncStreamingReadRpc { + public: + AsyncStreamingReadRpcTracking( + std::unique_ptr> child, + std::function on_destruction) + : child_(std::move(child)), on_destruction_(std::move(on_destruction)) {} + + ~AsyncStreamingReadRpcTracking() override { on_destruction_(); } + + void Cancel() override { child_->Cancel(); } + future Start() override { return child_->Start(); } + future> Read() override { return child_->Read(); } + future Finish() override { return child_->Finish(); } + RpcMetadata GetRequestMetadata() const override { + return child_->GetRequestMetadata(); + } + + private: + std::unique_ptr> child_; + std::function on_destruction_; +}; + +template +Response UnaryHelper(std::shared_ptr>& pool, + std::function fn) { + auto child = pool->GetChannelRandomTwoLeastUsed(); + auto stub = child->AcquireStub(); + auto result = fn(*stub); + child->ReleaseStub(); + return result; +} + +template +std::unique_ptr> +StreamingHelper( + std::shared_ptr>& pool, + std::function>(BigtableStub&)> + fn) { + auto child = pool->GetChannelRandomTwoLeastUsed(); + auto stub = child->AcquireStub(); + auto result = fn(*stub); + auto release_fn = [weak = child->MakeWeak()] { + auto child = weak.lock(); + if (child) child->ReleaseStub(); + }; + return std::make_unique>( + std::move(result), std::move(release_fn)); +} + +template +std::unique_ptr> +AsyncStreamingHelper( + std::shared_ptr>& pool, + std::function>( + BigtableStub&)> + fn) { + auto child = pool->GetChannelRandomTwoLeastUsed(); + auto stub = child->AcquireStub(); + auto result = fn(*stub); + auto release_fn = [weak = child->MakeWeak()] { + auto child = weak.lock(); + if (child) child->ReleaseStub(); + }; + return std::make_unique>( + std::move(result), std::move(release_fn)); +} + +} // namespace + +std::unique_ptr> +BigtableRandomTwoLeastUsed::ReadRows( + std::shared_ptr context, Options const& options, + google::bigtable::v2::ReadRowsRequest const& request) { + return StreamingHelper( + pool_, [&, context = std::move(context)](BigtableStub& stub) mutable { + return stub.ReadRows(std::move(context), options, request); + }); +} + +std::unique_ptr> +BigtableRandomTwoLeastUsed::SampleRowKeys( + std::shared_ptr context, Options const& options, + google::bigtable::v2::SampleRowKeysRequest const& request) { + return StreamingHelper( + pool_, [&, context = std::move(context)](BigtableStub& stub) mutable { + return stub.SampleRowKeys(std::move(context), options, request); + }); +} + +StatusOr +BigtableRandomTwoLeastUsed::MutateRow( + grpc::ClientContext& context, Options const& options, + google::bigtable::v2::MutateRowRequest const& request) { + return UnaryHelper>( + pool_, [&](BigtableStub& stub) { + return stub.MutateRow(context, options, request); + }); +} + +std::unique_ptr> +BigtableRandomTwoLeastUsed::MutateRows( + std::shared_ptr context, Options const& options, + google::bigtable::v2::MutateRowsRequest const& request) { + return StreamingHelper( + pool_, [&, context = std::move(context)](BigtableStub& stub) mutable { + return stub.MutateRows(std::move(context), options, request); + }); +} + +StatusOr +BigtableRandomTwoLeastUsed::CheckAndMutateRow( + grpc::ClientContext& context, Options const& options, + google::bigtable::v2::CheckAndMutateRowRequest const& request) { + return UnaryHelper>( + pool_, [&](BigtableStub& stub) { + return stub.CheckAndMutateRow(context, options, request); + }); +} + +StatusOr +BigtableRandomTwoLeastUsed::PingAndWarm( + grpc::ClientContext& context, Options const& options, + google::bigtable::v2::PingAndWarmRequest const& request) { + return UnaryHelper>( + pool_, [&](BigtableStub& stub) { + return stub.PingAndWarm(context, options, request); + }); +} + +StatusOr +BigtableRandomTwoLeastUsed::ReadModifyWriteRow( + grpc::ClientContext& context, Options const& options, + google::bigtable::v2::ReadModifyWriteRowRequest const& request) { + return UnaryHelper< + StatusOr>( + pool_, [&](BigtableStub& stub) { + return stub.ReadModifyWriteRow(context, options, request); + }); +} + +StatusOr +BigtableRandomTwoLeastUsed::PrepareQuery( + grpc::ClientContext& context, Options const& options, + google::bigtable::v2::PrepareQueryRequest const& request) { + return UnaryHelper>( + pool_, [&](BigtableStub& stub) { + return stub.PrepareQuery(context, options, request); + }); +} + +std::unique_ptr> +BigtableRandomTwoLeastUsed::ExecuteQuery( + std::shared_ptr context, Options const& options, + google::bigtable::v2::ExecuteQueryRequest const& request) { + return StreamingHelper( + pool_, [&, context = std::move(context)](BigtableStub& stub) mutable { + return stub.ExecuteQuery(std::move(context), options, request); + }); +} + +std::unique_ptr> +BigtableRandomTwoLeastUsed::AsyncReadRows( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::ReadRowsRequest const& request) { + return AsyncStreamingHelper( + pool_, [&, context = std::move(context), + options = std::move(options)](BigtableStub& stub) mutable { + return stub.AsyncReadRows(cq, std::move(context), std::move(options), + request); + }); +} + +std::unique_ptr> +BigtableRandomTwoLeastUsed::AsyncSampleRowKeys( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::SampleRowKeysRequest const& request) { + return AsyncStreamingHelper( + pool_, [&, context = std::move(context), + options = std::move(options)](BigtableStub& stub) mutable { + return stub.AsyncSampleRowKeys(cq, std::move(context), + std::move(options), request); + }); +} + +future> +BigtableRandomTwoLeastUsed::AsyncMutateRow( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::MutateRowRequest const& request) { + return UnaryHelper>>( + pool_, [&, context = std::move(context), + options = std::move(options)](BigtableStub& stub) mutable { + return stub.AsyncMutateRow(cq, std::move(context), std::move(options), + request); + }); +} + +std::unique_ptr> +BigtableRandomTwoLeastUsed::AsyncMutateRows( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::MutateRowsRequest const& request) { + return AsyncStreamingHelper( + pool_, [&, context = std::move(context), + options = std::move(options)](BigtableStub& stub) mutable { + return stub.AsyncMutateRows(cq, std::move(context), std::move(options), + request); + }); +} + +future> +BigtableRandomTwoLeastUsed::AsyncCheckAndMutateRow( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::CheckAndMutateRowRequest const& request) { + return UnaryHelper< + future>>( + pool_, [&, context = std::move(context), + options = std::move(options)](BigtableStub& stub) mutable { + return stub.AsyncCheckAndMutateRow(cq, std::move(context), + std::move(options), request); + }); +} + +future> +BigtableRandomTwoLeastUsed::AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) { + return UnaryHelper< + future>>( + pool_, [&, context = std::move(context), + options = std::move(options)](BigtableStub& stub) mutable { + return stub.AsyncPingAndWarm(cq, std::move(context), std::move(options), + request); + }); +} + +future> +BigtableRandomTwoLeastUsed::AsyncReadModifyWriteRow( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::ReadModifyWriteRowRequest const& request) { + return UnaryHelper< + future>>( + pool_, [&, context = std::move(context), + options = std::move(options)](BigtableStub& stub) mutable { + return stub.AsyncReadModifyWriteRow(cq, std::move(context), + std::move(options), request); + }); +} + +future> +BigtableRandomTwoLeastUsed::AsyncPrepareQuery( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PrepareQueryRequest const& request) { + return UnaryHelper< + future>>( + pool_, [&, context = std::move(context), + options = std::move(options)](BigtableStub& stub) mutable { + return stub.AsyncPrepareQuery(cq, std::move(context), + std::move(options), request); + }); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.h b/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.h new file mode 100644 index 0000000000000..eb6a765244a3c --- /dev/null +++ b/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.h @@ -0,0 +1,146 @@ +// Copyright 2026 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. + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_RANDOM_TWO_LEAST_USED_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_RANDOM_TWO_LEAST_USED_DECORATOR_H + +#include "google/cloud/bigtable/internal/bigtable_stub.h" +#include "google/cloud/bigtable/internal/dynamic_channel_pool.h" +#include "google/cloud/future.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class BigtableRandomTwoLeastUsed : public BigtableStub { + public: + explicit BigtableRandomTwoLeastUsed( + std::shared_ptr> pool) + : pool_(std::move(pool)) {} + + ~BigtableRandomTwoLeastUsed() override = default; + + std::unique_ptr> + ReadRows(std::shared_ptr context, Options const& options, + google::bigtable::v2::ReadRowsRequest const& request) override; + + std::unique_ptr> + SampleRowKeys( + std::shared_ptr context, Options const& options, + google::bigtable::v2::SampleRowKeysRequest const& request) override; + + StatusOr MutateRow( + grpc::ClientContext& context, Options const& options, + google::bigtable::v2::MutateRowRequest const& request) override; + + std::unique_ptr> + MutateRows(std::shared_ptr context, + Options const& options, + google::bigtable::v2::MutateRowsRequest const& request) override; + + StatusOr CheckAndMutateRow( + grpc::ClientContext& context, Options const& options, + google::bigtable::v2::CheckAndMutateRowRequest const& request) override; + + StatusOr PingAndWarm( + grpc::ClientContext& context, Options const& options, + google::bigtable::v2::PingAndWarmRequest const& request) override; + + StatusOr ReadModifyWriteRow( + grpc::ClientContext& context, Options const& options, + google::bigtable::v2::ReadModifyWriteRowRequest const& request) override; + + StatusOr PrepareQuery( + grpc::ClientContext& context, Options const& options, + google::bigtable::v2::PrepareQueryRequest const& request) override; + + std::unique_ptr> + ExecuteQuery( + std::shared_ptr context, Options const& options, + google::bigtable::v2::ExecuteQueryRequest const& request) override; + + std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< + google::bigtable::v2::ReadRowsResponse>> + AsyncReadRows(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::ReadRowsRequest const& request) override; + + std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< + google::bigtable::v2::SampleRowKeysResponse>> + AsyncSampleRowKeys( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::SampleRowKeysRequest const& request) override; + + future> AsyncMutateRow( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::MutateRowRequest const& request) override; + + std::unique_ptr<::google::cloud::internal::AsyncStreamingReadRpc< + google::bigtable::v2::MutateRowsResponse>> + AsyncMutateRows( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::MutateRowsRequest const& request) override; + + future> + AsyncCheckAndMutateRow( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::CheckAndMutateRowRequest const& request) override; + + future> AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) override; + + future> + AsyncReadModifyWriteRow( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::ReadModifyWriteRowRequest const& request) override; + + future> + AsyncPrepareQuery( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PrepareQueryRequest const& request) override; + + private: + std::shared_ptr> pool_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_RANDOM_TWO_LEAST_USED_DECORATOR_H diff --git a/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator_test.cc b/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator_test.cc new file mode 100644 index 0000000000000..a4ae1ba42a6aa --- /dev/null +++ b/google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator_test.cc @@ -0,0 +1,212 @@ +// Copyright 2026 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 "google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.h" +#include "google/cloud/bigtable/internal/dynamic_channel_pool.h" +#include "google/cloud/bigtable/testing/mock_bigtable_stub.h" +#include "google/cloud/testing_util/fake_completion_queue_impl.h" +#include + +namespace google { +namespace cloud { +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { + +using ::google::cloud::bigtable::testing::MockBigtableStub; +using ::google::cloud::testing_util::FakeCompletionQueueImpl; +using ::testing::MockFunction; + +class BigtableRandomTwoLeastUsedTest : public ::testing::Test { + protected: + BigtableRandomTwoLeastUsedTest() { + mock_stub_ = std::make_shared(); + + fake_cq_impl_ = std::make_shared(); + cq_ = CompletionQueue(fake_cq_impl_); + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + bigtable::experimental::DynamicChannelPoolSizingPolicy sizing_policy; + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + + std::vector>> channels; + channels.push_back( + std::make_shared>(mock_stub_, 0)); + + pool_ = DynamicChannelPool::Create( + instance_name, cq_, channels, refresh_state, + stub_factory_fn_.AsStdFunction(), sizing_policy); + } + + ~BigtableRandomTwoLeastUsedTest() override { + fake_cq_impl_->SimulateCompletion(false); + } + + std::shared_ptr mock_stub_; + std::shared_ptr> pool_; + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn_; + CompletionQueue cq_; + std::shared_ptr fake_cq_impl_; +}; + +TEST_F(BigtableRandomTwoLeastUsedTest, ReadRows) { + EXPECT_CALL(*mock_stub_, ReadRows).Times(1); + auto decorator = std::make_shared(pool_); + auto client_context = std::make_shared(); + google::bigtable::v2::ReadRowsRequest request; + auto response = decorator->ReadRows(client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, SampleRowKeys) { + EXPECT_CALL(*mock_stub_, SampleRowKeys).Times(1); + auto decorator = std::make_shared(pool_); + auto client_context = std::make_shared(); + google::bigtable::v2::SampleRowKeysRequest request; + auto response = decorator->SampleRowKeys(client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, MutateRow) { + EXPECT_CALL(*mock_stub_, MutateRow).Times(1); + auto decorator = std::make_shared(pool_); + grpc::ClientContext client_context; + google::bigtable::v2::MutateRowRequest request; + auto response = decorator->MutateRow(client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, MutateRows) { + EXPECT_CALL(*mock_stub_, MutateRows).Times(1); + auto decorator = std::make_shared(pool_); + auto client_context = std::make_shared(); + google::bigtable::v2::MutateRowsRequest request; + auto response = decorator->MutateRows(client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, CheckAndMutateRow) { + EXPECT_CALL(*mock_stub_, CheckAndMutateRow).Times(1); + auto decorator = std::make_shared(pool_); + grpc::ClientContext client_context; + google::bigtable::v2::CheckAndMutateRowRequest request; + auto response = decorator->CheckAndMutateRow(client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, PingAndWarm) { + EXPECT_CALL(*mock_stub_, PingAndWarm).Times(1); + auto decorator = std::make_shared(pool_); + grpc::ClientContext client_context; + google::bigtable::v2::PingAndWarmRequest request; + auto response = decorator->PingAndWarm(client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, ReadModifyWriteRow) { + EXPECT_CALL(*mock_stub_, ReadModifyWriteRow).Times(1); + auto decorator = std::make_shared(pool_); + grpc::ClientContext client_context; + google::bigtable::v2::ReadModifyWriteRowRequest request; + auto response = decorator->ReadModifyWriteRow(client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, PrepareQuery) { + EXPECT_CALL(*mock_stub_, PrepareQuery).Times(1); + auto decorator = std::make_shared(pool_); + grpc::ClientContext client_context; + google::bigtable::v2::PrepareQueryRequest request; + auto response = decorator->PrepareQuery(client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, ExecuteQuery) { + EXPECT_CALL(*mock_stub_, ExecuteQuery).Times(1); + auto decorator = std::make_shared(pool_); + auto client_context = std::make_shared(); + google::bigtable::v2::ExecuteQueryRequest request; + auto response = decorator->ExecuteQuery(client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, AsyncReadRows) { + EXPECT_CALL(*mock_stub_, AsyncReadRows).Times(1); + auto decorator = std::make_shared(pool_); + auto client_context = std::make_shared(); + google::bigtable::v2::ReadRowsRequest request; + auto response = decorator->AsyncReadRows(cq_, client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, AsyncSampleRowKeys) { + EXPECT_CALL(*mock_stub_, AsyncSampleRowKeys).Times(1); + auto decorator = std::make_shared(pool_); + auto client_context = std::make_shared(); + google::bigtable::v2::SampleRowKeysRequest request; + auto response = + decorator->AsyncSampleRowKeys(cq_, client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, AsyncMutateRow) { + EXPECT_CALL(*mock_stub_, AsyncMutateRow).Times(1); + auto decorator = std::make_shared(pool_); + auto client_context = std::make_shared(); + google::bigtable::v2::MutateRowRequest request; + auto response = decorator->AsyncMutateRow(cq_, client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, AsyncMutateRows) { + EXPECT_CALL(*mock_stub_, AsyncMutateRows).Times(1); + auto decorator = std::make_shared(pool_); + auto client_context = std::make_shared(); + google::bigtable::v2::MutateRowsRequest request; + auto response = decorator->AsyncMutateRows(cq_, client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, AsyncCheckAndMutateRow) { + EXPECT_CALL(*mock_stub_, AsyncCheckAndMutateRow).Times(1); + auto decorator = std::make_shared(pool_); + auto client_context = std::make_shared(); + google::bigtable::v2::CheckAndMutateRowRequest request; + auto response = + decorator->AsyncCheckAndMutateRow(cq_, client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, AsyncPingAndWarm) { + EXPECT_CALL(*mock_stub_, AsyncPingAndWarm).Times(1); + auto decorator = std::make_shared(pool_); + auto client_context = std::make_shared(); + google::bigtable::v2::PingAndWarmRequest request; + auto response = decorator->AsyncPingAndWarm(cq_, client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, AsyncReadModifyWriteRow) { + EXPECT_CALL(*mock_stub_, AsyncReadModifyWriteRow).Times(1); + auto decorator = std::make_shared(pool_); + auto client_context = std::make_shared(); + google::bigtable::v2::ReadModifyWriteRowRequest request; + auto response = + decorator->AsyncReadModifyWriteRow(cq_, client_context, {}, request); +} + +TEST_F(BigtableRandomTwoLeastUsedTest, AsyncPrepareQuery) { + EXPECT_CALL(*mock_stub_, AsyncPrepareQuery).Times(1); + auto decorator = std::make_shared(pool_); + auto client_context = std::make_shared(); + google::bigtable::v2::PrepareQueryRequest request; + auto response = + decorator->AsyncPrepareQuery(cq_, client_context, {}, request); +} + +} // namespace +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/bigtable/internal/bigtable_round_robin_decorator.cc b/google/cloud/bigtable/internal/bigtable_round_robin_decorator.cc index 529f757131695..00149b2b4d04d 100644 --- a/google/cloud/bigtable/internal/bigtable_round_robin_decorator.cc +++ b/google/cloud/bigtable/internal/bigtable_round_robin_decorator.cc @@ -152,6 +152,16 @@ BigtableRoundRobin::AsyncCheckAndMutateRow( std::move(options), request); } +future> +BigtableRoundRobin::AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) { + return Child()->AsyncPingAndWarm(cq, std::move(context), std::move(options), + request); +} + future> BigtableRoundRobin::AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_round_robin_decorator.h b/google/cloud/bigtable/internal/bigtable_round_robin_decorator.h index 5b7c9e2206e85..5d434d139c51b 100644 --- a/google/cloud/bigtable/internal/bigtable_round_robin_decorator.h +++ b/google/cloud/bigtable/internal/bigtable_round_robin_decorator.h @@ -118,6 +118,12 @@ class BigtableRoundRobin : public BigtableStub { google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request) override; + future> AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) override; + future> AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_stub.cc b/google/cloud/bigtable/internal/bigtable_stub.cc index d8b313019507c..f86035de2de67 100644 --- a/google/cloud/bigtable/internal/bigtable_stub.cc +++ b/google/cloud/bigtable/internal/bigtable_stub.cc @@ -229,6 +229,24 @@ DefaultBigtableStub::AsyncCheckAndMutateRow( request, std::move(context)); } +future> +DefaultBigtableStub::AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + // NOLINTNEXTLINE(performance-unnecessary-value-param) + google::cloud::internal::ImmutableOptions, + google::bigtable::v2::PingAndWarmRequest const& request) { + return internal::MakeUnaryRpcImpl( + cq, + [this](grpc::ClientContext* context, + google::bigtable::v2::PingAndWarmRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncPingAndWarm(context, request, cq); + }, + request, std::move(context)); +} + future> DefaultBigtableStub::AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_stub.h b/google/cloud/bigtable/internal/bigtable_stub.h index 11fcb3cd985eb..3c101f57e4900 100644 --- a/google/cloud/bigtable/internal/bigtable_stub.h +++ b/google/cloud/bigtable/internal/bigtable_stub.h @@ -122,6 +122,12 @@ class BigtableStub { google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request) = 0; + virtual future> + AsyncPingAndWarm(google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) = 0; + virtual future> AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, @@ -222,6 +228,12 @@ class DefaultBigtableStub : public BigtableStub { google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request) override; + future> AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) override; + future> AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_stub_factory.cc b/google/cloud/bigtable/internal/bigtable_stub_factory.cc index 8f201cf522438..c95d23a0db618 100644 --- a/google/cloud/bigtable/internal/bigtable_stub_factory.cc +++ b/google/cloud/bigtable/internal/bigtable_stub_factory.cc @@ -17,6 +17,7 @@ #include "google/cloud/bigtable/internal/bigtable_channel_refresh.h" #include "google/cloud/bigtable/internal/bigtable_logging_decorator.h" #include "google/cloud/bigtable/internal/bigtable_metadata_decorator.h" +#include "google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.h" #include "google/cloud/bigtable/internal/bigtable_round_robin_decorator.h" #include "google/cloud/bigtable/internal/bigtable_tracing_stub.h" #include "google/cloud/bigtable/internal/connection_refresh_state.h" @@ -60,56 +61,154 @@ std::string FeaturesMetadata() { return *kFeatures; } +std::shared_ptr ApplyCommonDecorators( + std::shared_ptr auth, + std::shared_ptr stub, Options const& options) { + if (auth->RequiresConfigureContext()) { + stub = std::make_shared(std::move(auth), std::move(stub)); + } + stub = std::make_shared( + std::move(stub), + std::multimap{ + {"bigtable-features", FeaturesMetadata()}}, + internal::HandCraftedLibClientHeader()); + 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 = MakeBigtableTracingStub(std::move(stub)); + } + return stub; +} + } // namespace std::shared_ptr CreateBigtableStubRoundRobin( - Options const& options, - std::function(int)> child_factory) { + Options const& options, std::function(int)> + refreshing_channel_stub_factory) { std::vector> children( (std::max)(1, options.get())); int id = 0; std::generate(children.begin(), children.end(), - [&id, &child_factory] { return child_factory(id++); }); + [&id, &refreshing_channel_stub_factory] { + return refreshing_channel_stub_factory(id++); + }); return std::make_shared(std::move(children)); } +std::shared_ptr CreateBigtableStubRandomTwoLeastUsed( + std::shared_ptr auth, + std::shared_ptr cq_impl, + std::string_view instance_name, StubManager::Priming priming, + Options const& options, BaseBigtableStubFactory stub_factory, + std::shared_ptr refresh_state) { + auto refreshing_channel_stub_factory = + [stub_factory = std::move(stub_factory), cq_impl, refresh_state, + auth = std::move(auth), + options](std::uint32_t id, std::string_view instance_name, + StubManager::Priming priming) + -> StatusOr>> { + auto wrapper = std::make_shared>(); + auto connection_status_fn = [weak = wrapper->MakeWeak()](Status const& s) { + if (auto self = weak.lock()) { + self->set_last_refresh_status(s); + } + if (!s.ok()) { + GCP_LOG(WARNING) << "Failed to refresh connection. Error: " << s; + } + }; + + auto channel = CreateGrpcChannel(*auth, options, id); + auto stub = stub_factory(std::move(channel)); + if (priming == StubManager::Priming::kSynchronousPriming) { + grpc::ClientContext client_context; + google::bigtable::v2::PingAndWarmRequest request; + request.set_name(std::string{instance_name}); + auto response = + stub->PingAndWarm(client_context, options, std::move(request)); + if (!response.ok()) return response.status(); + } + + ScheduleStubRefresh(cq_impl, refresh_state, stub, + std::string{instance_name}, + std::move(connection_status_fn)); + + wrapper->set_stub(std::move(stub)); + return wrapper; + }; + + std::vector>> children; + children.reserve(std::max(1, options.get())); + std::uint32_t id = 0; + for (std::uint32_t i = 0; i < children.capacity(); ++i) { + auto stub = refreshing_channel_stub_factory(id++, instance_name, priming); + if (stub.ok()) { + children.push_back(*std::move(stub)); + } + } + + return std::make_shared( + DynamicChannelPool::Create( + std::string{instance_name}, CompletionQueue(std::move(cq_impl)), + std::move(children), std::move(refresh_state), + std::move(refreshing_channel_stub_factory))); +} + +std::shared_ptr CreateDecoratedStubs( + std::shared_ptr auth, + CompletionQueue const& cq, std::string_view instance_name, + StubManager::Priming priming, Options const& options, + BaseBigtableStubFactory const& stub_factory) { + auto cq_impl = internal::GetCompletionQueueImpl(cq); + auto refresh = std::make_shared( + cq_impl, options.get(), + options.get()); + auto stub = CreateBigtableStubRandomTwoLeastUsed( + auth, std::move(cq_impl), instance_name, priming, options, stub_factory, + std::move(refresh)); + return ApplyCommonDecorators(std::move(auth), std::move(stub), options); +} + std::shared_ptr CreateDecoratedStubs( std::shared_ptr auth, CompletionQueue const& cq, Options const& options, - BaseBigtableStubFactory const& base_factory) { + BaseBigtableStubFactory const& stub_factory) { auto cq_impl = internal::GetCompletionQueueImpl(cq); auto refresh = std::make_shared( cq_impl, options.get(), options.get()); - auto child_factory = [base_factory, cq_impl, refresh, &auth, - options](int id) { + // Cannot use Dynamic Channel Pool as it requires affinity. + auto refreshing_channel_stub_factory = [stub_factory, cq_impl, refresh, &auth, + options](int id) { auto channel = CreateGrpcChannel(*auth, options, id); if (refresh->enabled()) ScheduleChannelRefresh(cq_impl, refresh, channel); - return base_factory(std::move(channel)); + return stub_factory(std::move(channel)); }; - auto stub = CreateBigtableStubRoundRobin(options, std::move(child_factory)); + auto stub = CreateBigtableStubRoundRobin( + options, std::move(refreshing_channel_stub_factory)); if (refresh->enabled()) { stub = std::make_shared(std::move(stub), std::move(refresh)); } - if (auth->RequiresConfigureContext()) { - stub = std::make_shared(std::move(auth), std::move(stub)); - } - stub = std::make_shared( - std::move(stub), - std::multimap{ - {"bigtable-features", FeaturesMetadata()}}, - internal::HandCraftedLibClientHeader()); - 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 = MakeBigtableTracingStub(std::move(stub)); + return ApplyCommonDecorators(std::move(auth), std::move(stub), options); +} + +absl::flat_hash_map> +CreateBigtableAffinityStubs( + std::vector const& instances, + StubManager::StubCreationFn const& stub_creation_fn) { + absl::flat_hash_map> + affinity_stubs; + for (auto const& instance : instances) { + affinity_stubs.insert(std::make_pair( + instance.FullName(), + stub_creation_fn(instance.FullName(), + StubManager::Priming::kSynchronousPriming))); } - return stub; + return affinity_stubs; } std::shared_ptr CreateBigtableStub( @@ -122,6 +221,18 @@ std::shared_ptr CreateBigtableStub( }); } +std::shared_ptr CreateBigtableStub( + std::shared_ptr auth, + CompletionQueue const& cq, std::string_view instance_name, + StubManager::Priming priming, Options const& options) { + return CreateDecoratedStubs( + std::move(auth), cq, instance_name, priming, options, + [](std::shared_ptr c) { + return std::make_shared( + google::bigtable::v2::Bigtable::NewStub(std::move(c))); + }); +} + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud diff --git a/google/cloud/bigtable/internal/bigtable_stub_factory.h b/google/cloud/bigtable/internal/bigtable_stub_factory.h index cdf7a633b0f42..9400a6aec4253 100644 --- a/google/cloud/bigtable/internal/bigtable_stub_factory.h +++ b/google/cloud/bigtable/internal/bigtable_stub_factory.h @@ -15,7 +15,10 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_STUB_FACTORY_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_STUB_FACTORY_H +#include "google/cloud/bigtable/instance_resource.h" #include "google/cloud/bigtable/internal/bigtable_stub.h" +#include "google/cloud/bigtable/internal/connection_refresh_state.h" +#include "google/cloud/bigtable/internal/stub_manager.h" #include "google/cloud/completion_queue.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/options.h" @@ -31,21 +34,53 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN using BaseBigtableStubFactory = std::function( std::shared_ptr)>; +/// Creates a static pool of stubs that use a round-robin strategy to select. std::shared_ptr CreateBigtableStubRoundRobin( - Options const& options, - std::function(int)> child_factory); + Options const& options, std::function(int)> + refreshing_channel_stub_factory); + +/// Creates a dynamic pool of stubs that selects the least used from a random +/// pair of stubs. +std::shared_ptr CreateBigtableStubRandomTwoLeastUsed( + std::shared_ptr auth, + std::shared_ptr cq_impl, + std::string_view instance_name, StubManager::Priming priming, + Options const& options, BaseBigtableStubFactory stub_factory, + std::shared_ptr refresh_state); /// Used in testing to create decorated mocks. std::shared_ptr CreateDecoratedStubs( std::shared_ptr auth, CompletionQueue const& cq, Options const& options, - BaseBigtableStubFactory const& base_factory); + BaseBigtableStubFactory const& stub_factory); + +/// Used in testing to create decorated mocks. +std::shared_ptr CreateDecoratedStubs( + std::shared_ptr auth, + CompletionQueue const& cq, std::string_view instance_name, + StubManager::Priming priming, Options const& options, + BaseBigtableStubFactory const& stub_factory); /// Default function used by `DataConnectionImpl`. +/// No instance affinity, uses legacy grpc::GetState to refresh using the +/// round-robin channel selection strategy. std::shared_ptr CreateBigtableStub( std::shared_ptr auth, CompletionQueue const& cq, Options const& options); +/// Creates a stub with instance affinity using PingAndWarm priming using the +/// random two least used channel selection strategy. +std::shared_ptr CreateBigtableStub( + std::shared_ptr auth, + CompletionQueue const& cq, std::string_view instance_name, + StubManager::Priming priming, Options const& options); + +/// Creates a map of instance to stub pairs. +absl::flat_hash_map> +CreateBigtableAffinityStubs( + std::vector const& instances, + StubManager::StubCreationFn const& stub_creation_fn); + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud diff --git a/google/cloud/bigtable/internal/bigtable_stub_factory_test.cc b/google/cloud/bigtable/internal/bigtable_stub_factory_test.cc index a94e233fd2928..e188d05f6a6d6 100644 --- a/google/cloud/bigtable/internal/bigtable_stub_factory_test.cc +++ b/google/cloud/bigtable/internal/bigtable_stub_factory_test.cc @@ -21,6 +21,7 @@ #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/async_streaming_read_rpc_impl.h" #include "google/cloud/internal/make_status.h" +#include "google/cloud/testing_util/fake_completion_queue_impl.h" #include "google/cloud/testing_util/mock_grpc_authentication_strategy.h" #include "google/cloud/testing_util/opentelemetry_matchers.h" #include "google/cloud/testing_util/scoped_log.h" @@ -44,8 +45,10 @@ using ::google::cloud::testing_util::StatusIs; using ::google::cloud::testing_util::ValidateMetadataFixture; using ::testing::_; using ::testing::Contains; +using ::testing::Eq; using ::testing::HasSubstr; using ::testing::IsEmpty; +using ::testing::MockFunction; using ::testing::Not; using ::testing::Optional; using ::testing::Pair; @@ -107,6 +110,56 @@ TEST(BigtableStubFactory, RoundRobin) { } } +TEST(BigtableStubFactory, RandomTwoLeastUsed) { + auto constexpr kTestChannels = 3; + + MockFactory factory; + auto mock = std::make_shared(); + EXPECT_CALL(*mock, PingAndWarm) + .WillRepeatedly(Return(google::bigtable::v2::PingAndWarmResponse{})); + EXPECT_CALL(*mock, MutateRow) + .WillRepeatedly(Return(internal::AbortedError("fail"))); + + EXPECT_CALL(factory, Call) + .Times(kTestChannels) + .WillRepeatedly( + [&](std::shared_ptr const&) { return mock; }); + + auto expect_channel_id = [](int id) { + return ResultOf( + "channel ID", + [](grpc::ChannelArguments const& args) { + return internal::GetIntChannelArgument(args, "grpc.channel_id"); + }, + Optional(id)); + }; + + auto auth = MakeStubFactoryMockAuth(); + EXPECT_CALL(*auth, CreateChannel("localhost:1", expect_channel_id(0))); + EXPECT_CALL(*auth, CreateChannel("localhost:1", expect_channel_id(1))); + EXPECT_CALL(*auth, CreateChannel("localhost:1", expect_channel_id(2))); + EXPECT_CALL(*auth, RequiresConfigureContext).WillOnce(Return(false)); + + auto fake_cq_impl = std::make_shared(); + CompletionQueue cq(fake_cq_impl); + auto stub = CreateDecoratedStubs( + std::move(auth), cq, "projects/my-projects/instances/my-instance", + StubManager::Priming::kSynchronousPriming, + Options{} + .set(kTestChannels) + .set("localhost:1") + .set(MakeInsecureCredentials()), + factory.AsStdFunction()); + + grpc::ClientContext context; + for (int i = 0; i != kTestChannels; ++i) { + auto response = stub->MutateRow(context, Options{}, {}); + EXPECT_THAT(response, StatusIs(StatusCode::kAborted, "fail")); + } + + fake_cq_impl->SimulateCompletion(false); +} + // Note that the channel refreshing decorator is tested in // bigtable_channel_refresh_test.cc @@ -335,6 +388,35 @@ TEST(BigtableStubFactory, TracingDisabled) { EXPECT_THAT(span_catcher->GetSpans(), IsEmpty()); } +TEST(BigtableStubFactory, CreateBigtableAffinityStubs) { + bigtable::InstanceResource instance_a{Project("my-project"), "instance-a"}; + bigtable::InstanceResource instance_b{Project("my-project"), "instance-b"}; + std::vector instances; + instances.push_back(instance_a); + instances.push_back(instance_b); + + MockFunction(std::string_view, + StubManager::Priming)> + stub_creation_fn; + + EXPECT_CALL(stub_creation_fn, Call) + .WillOnce([&](std::string_view instance, StubManager::Priming priming) { + EXPECT_THAT(instance, Eq(instance_a.FullName())); + EXPECT_THAT(priming, Eq(StubManager::Priming::kSynchronousPriming)); + return std::make_shared(); + }) + .WillOnce([&](std::string_view instance, StubManager::Priming priming) { + EXPECT_THAT(instance, Eq(instance_b.FullName())); + EXPECT_THAT(priming, Eq(StubManager::Priming::kSynchronousPriming)); + return std::make_shared(); + }); + + auto stubs = + CreateBigtableAffinityStubs(instances, stub_creation_fn.AsStdFunction()); + + EXPECT_THAT(stubs, testing::SizeIs(2)); +} + } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal diff --git a/google/cloud/bigtable/internal/bigtable_tracing_stub.cc b/google/cloud/bigtable/internal/bigtable_tracing_stub.cc index 5e141b29e5621..80621c5222b38 100644 --- a/google/cloud/bigtable/internal/bigtable_tracing_stub.cc +++ b/google/cloud/bigtable/internal/bigtable_tracing_stub.cc @@ -234,6 +234,20 @@ BigtableTracingStub::AsyncCheckAndMutateRow( return internal::EndSpan(std::move(context), std::move(span), std::move(f)); } +future> +BigtableTracingStub::AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.bigtable.v2.Bigtable", "PingAndWarm"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncPingAndWarm(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + future> BigtableTracingStub::AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/bigtable_tracing_stub.h b/google/cloud/bigtable/internal/bigtable_tracing_stub.h index 18f5eb2d3da27..c269361225ecb 100644 --- a/google/cloud/bigtable/internal/bigtable_tracing_stub.h +++ b/google/cloud/bigtable/internal/bigtable_tracing_stub.h @@ -118,6 +118,12 @@ class BigtableTracingStub : public BigtableStub { google::cloud::internal::ImmutableOptions options, google::bigtable::v2::CheckAndMutateRowRequest const& request) override; + future> AsyncPingAndWarm( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::bigtable::v2::PingAndWarmRequest const& request) override; + future> AsyncReadModifyWriteRow( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/bigtable/internal/channel_usage.h b/google/cloud/bigtable/internal/channel_usage.h new file mode 100644 index 0000000000000..2a2e6b583c4bc --- /dev/null +++ b/google/cloud/bigtable/internal/channel_usage.h @@ -0,0 +1,92 @@ +// Copyright 2026 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. + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_CHANNEL_USAGE_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_CHANNEL_USAGE_H + +#include "google/cloud/internal/clock.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +// This class wraps a `T`, typically a BigtableStub, and tracks the number of +// outstanding RPCs by taking measurements when the wrapped stub is acquired +// and released. +template +class ChannelUsage : public std::enable_shared_from_this> { + public: + ChannelUsage() = default; + explicit ChannelUsage(std::shared_ptr stub) : stub_(std::move(stub)) {} + + // This constructor is only used in testing. + ChannelUsage(std::shared_ptr stub, int initial_outstanding_rpcs, + Status last_refresh_status = {}) + : stub_(std::move(stub)), + outstanding_rpcs_(initial_outstanding_rpcs), + last_refresh_status_(std::move(last_refresh_status)) {} + + StatusOr instant_outstanding_rpcs() { + std::scoped_lock lk(mu_); + if (!last_refresh_status_.ok()) return last_refresh_status_; + return outstanding_rpcs_; + } + + ChannelUsage& set_last_refresh_status(Status s) { + std::scoped_lock lk(mu_); + last_refresh_status_ = std::move(s); + return *this; + } + + // A channel can only be set if the current value is nullptr. This mutator + // exists only so that we can obtain a std::weak_ptr to the ChannelUsage + // object that will eventually hold the channel. + ChannelUsage& set_stub(std::shared_ptr stub) { + std::scoped_lock lk(mu_); + if (!stub_) stub_ = std::move(stub); + return *this; + } + + std::weak_ptr> MakeWeak() { return this->shared_from_this(); } + + std::shared_ptr AcquireStub() { + std::scoped_lock lk(mu_); + ++outstanding_rpcs_; + return stub_; + } + + void ReleaseStub() { + std::scoped_lock lk(mu_); + --outstanding_rpcs_; + } + + private: + mutable std::mutex mu_; + std::shared_ptr stub_; + int outstanding_rpcs_ = 0; + Status last_refresh_status_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_CHANNEL_USAGE_H diff --git a/google/cloud/bigtable/internal/channel_usage_test.cc b/google/cloud/bigtable/internal/channel_usage_test.cc new file mode 100644 index 0000000000000..baeccf1119198 --- /dev/null +++ b/google/cloud/bigtable/internal/channel_usage_test.cc @@ -0,0 +1,86 @@ +// Copyright 2026 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 "google/cloud/bigtable/internal/channel_usage.h" +#include "google/cloud/bigtable/testing/mock_bigtable_stub.h" +#include "google/cloud/internal/make_status.h" +#include "google/cloud/testing_util/fake_clock.h" +#include "google/cloud/testing_util/status_matchers.h" +#include + +namespace google { +namespace cloud { +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { + +using ::google::cloud::bigtable::testing::MockBigtableStub; +using ::google::cloud::testing_util::IsOkAndHolds; +using ::google::cloud::testing_util::StatusIs; +using ::testing::Eq; + +TEST(ChannelUsageTest, SetChannel) { + auto mock = std::make_shared(); + auto channel = std::make_shared>(); + EXPECT_THAT(channel->AcquireStub(), Eq(nullptr)); + channel->set_stub(mock); + EXPECT_THAT(channel->AcquireStub(), Eq(mock)); + auto mock2 = std::make_shared(); + channel->set_stub(mock2); + EXPECT_THAT(channel->AcquireStub(), Eq(mock)); +} + +TEST(ChannelUsageTest, InstantOutstandingRpcs) { + auto mock = std::make_shared(); + auto channel = std::make_shared>(mock); + + auto stub = channel->AcquireStub(); + EXPECT_THAT(stub, Eq(mock)); + EXPECT_THAT(channel->instant_outstanding_rpcs(), IsOkAndHolds(1)); + stub = channel->AcquireStub(); + EXPECT_THAT(stub, Eq(mock)); + stub = channel->AcquireStub(); + EXPECT_THAT(stub, Eq(mock)); + EXPECT_THAT(channel->instant_outstanding_rpcs(), IsOkAndHolds(3)); + channel->ReleaseStub(); + EXPECT_THAT(channel->instant_outstanding_rpcs(), IsOkAndHolds(2)); + channel->ReleaseStub(); + channel->ReleaseStub(); + EXPECT_THAT(channel->instant_outstanding_rpcs(), IsOkAndHolds(0)); +} + +TEST(ChannelUsageTest, SetLastRefreshStatus) { + auto mock = std::make_shared(); + auto channel = std::make_shared>(mock); + Status expected_status = internal::InternalError("uh oh"); + (void)channel->AcquireStub(); + EXPECT_THAT(channel->instant_outstanding_rpcs(), IsOkAndHolds(1)); + channel->set_last_refresh_status(expected_status); + EXPECT_THAT(channel->instant_outstanding_rpcs(), + StatusIs(expected_status.code())); +} + +TEST(ChannelUsageTest, MakeWeak) { + auto channel = std::make_shared>(); + auto weak = channel->MakeWeak(); + EXPECT_THAT(weak.lock(), Eq(channel)); + channel.reset(); + EXPECT_THAT(weak.lock(), Eq(nullptr)); +} + +} // namespace +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/bigtable/internal/connection_refresh_state.cc b/google/cloud/bigtable/internal/connection_refresh_state.cc index 2a6cdd052b6bc..89d0efb6038e0 100644 --- a/google/cloud/bigtable/internal/connection_refresh_state.cc +++ b/google/cloud/bigtable/internal/connection_refresh_state.cc @@ -30,6 +30,12 @@ namespace { */ auto constexpr kConnectionReadyTimeout = std::chrono::seconds(10); +void LogFailedConnectionRefresh(Status const& conn_status) { + if (!conn_status.ok()) { + GCP_LOG(WARNING) << "Failed to refresh connection. Error: " << conn_status; + } +} + } // namespace ConnectionRefreshState::ConnectionRefreshState( @@ -81,10 +87,7 @@ void ScheduleChannelRefresh( std::chrono::system_clock::now() + kConnectionReadyTimeout) .then([weak_channel, weak_cq_impl, state](future fut) { auto conn_status = fut.get(); - if (!conn_status.ok()) { - GCP_LOG(WARNING) << "Failed to refresh connection. Error: " - << conn_status; - } + LogFailedConnectionRefresh(conn_status); auto channel = weak_channel.lock(); if (!channel) return; auto cq_impl = weak_cq_impl.lock(); @@ -95,6 +98,65 @@ void ScheduleChannelRefresh( state->timers().RegisterTimer(std::move(timer_future)); } +void ScheduleStubRefresh( + std::shared_ptr const& cq_impl, + std::shared_ptr const& state, + std::shared_ptr const& stub, std::string const& instance_name, + std::function connection_status_fn) { + if (!connection_status_fn) { + connection_status_fn = LogFailedConnectionRefresh; + } + // The timers will only hold weak pointers to the channel or to the + // completion queue, so if either of them are destroyed, the timer chain + // will simply not continue. + std::weak_ptr weak_stub(stub); + std::weak_ptr weak_cq_impl(cq_impl); + auto cq = CompletionQueue(cq_impl); + using TimerFuture = future>; + auto timer_future = + cq.MakeRelativeTimer(state->RandomizedRefreshDelay()) + .then([weak_stub, weak_cq_impl, state, instance_name, + connection_status_fn = + std::move(connection_status_fn)](TimerFuture fut) mutable { + if (!fut.get()) { + // Timer cancelled. + return; + } + auto stub = weak_stub.lock(); + if (!stub) return; + auto cq_impl = weak_cq_impl.lock(); + if (!cq_impl) return; + auto cq = CompletionQueue(cq_impl); + + auto client_context = std::make_shared(); + google::cloud::internal::ImmutableOptions options; + google::bigtable::v2::PingAndWarmRequest request; + request.set_name(instance_name); + // Use the client_context to set a deadline similar to + // AsyncWaitConnectionReady. + client_context->set_deadline(std::chrono::system_clock::now() + + kConnectionReadyTimeout); + stub->AsyncPingAndWarm(cq, client_context, std::move(options), + request) + .then( + [weak_stub, weak_cq_impl, state, instance_name, + connection_status_fn = std::move(connection_status_fn)]( + future< + StatusOr> + fut) mutable { + auto response = fut.get(); + connection_status_fn(response.status()); + auto stub = weak_stub.lock(); + if (!stub) return; + auto cq_impl = weak_cq_impl.lock(); + if (!cq_impl) return; + ScheduleStubRefresh(cq_impl, state, stub, instance_name, + std::move(connection_status_fn)); + }); + }); + state->timers().RegisterTimer(std::move(timer_future)); +} + void OutstandingTimers::RegisterTimer(future fut) { std::unique_lock lk(mu_); if (shutdown_) { diff --git a/google/cloud/bigtable/internal/connection_refresh_state.h b/google/cloud/bigtable/internal/connection_refresh_state.h index 4e4f9f3dcfdd5..ed5d81ab4621f 100644 --- a/google/cloud/bigtable/internal/connection_refresh_state.h +++ b/google/cloud/bigtable/internal/connection_refresh_state.h @@ -15,6 +15,7 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_CONNECTION_REFRESH_STATE_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_CONNECTION_REFRESH_STATE_H +#include "google/cloud/bigtable/internal/bigtable_stub.h" #include "google/cloud/bigtable/version.h" #include "google/cloud/completion_queue.h" #include "google/cloud/future.h" @@ -81,13 +82,23 @@ class ConnectionRefreshState { }; /** - * Schedule a chain of timers to refresh the connection. + * Schedule a chain of timers to refresh the grpc::Channel using + * AsyncWaitConnectionReady which leverages grpc::Channel::GetState. */ void ScheduleChannelRefresh( std::shared_ptr const& cq, std::shared_ptr const& state, std::shared_ptr const& channel); +/** + * Schedule a chain of timers to refresh the BigtableStub using PingAndWarm. + */ +void ScheduleStubRefresh( + std::shared_ptr const& cq, + std::shared_ptr const& state, + std::shared_ptr const& stub, std::string const& instance_name, + std::function connection_status_fn = {}); + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud diff --git a/google/cloud/bigtable/internal/connection_refresh_state_test.cc b/google/cloud/bigtable/internal/connection_refresh_state_test.cc index 120e0c2077173..8d41d08b28c5c 100644 --- a/google/cloud/bigtable/internal/connection_refresh_state_test.cc +++ b/google/cloud/bigtable/internal/connection_refresh_state_test.cc @@ -12,14 +12,21 @@ // See the License for the specific language governing permissions and #include "google/cloud/bigtable/internal/connection_refresh_state.h" +#include "google/cloud/bigtable/testing/mock_bigtable_stub.h" #include "google/cloud/testing_util/status_matchers.h" #include +#include namespace google { namespace cloud { namespace bigtable_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +using ::google::cloud::bigtable::testing::MockBigtableStub; +using ::google::cloud::testing_util::IsOk; +using ::testing::Eq; +using ::testing::MockFunction; + using TimerFuture = future>; class OutstandingTimersTest : public ::testing::Test { @@ -118,6 +125,71 @@ TEST(ConnectionRefreshState, Disabled) { EXPECT_FALSE(state.enabled()); } +class ScheduleStubRefreshTest : public ::testing::Test { + public: + ScheduleStubRefreshTest() : thread1_([this] { cq_.Run(); }) {} + ~ScheduleStubRefreshTest() override { + cq_.Shutdown(); + thread1_.join(); + } + + protected: + CompletionQueue cq_; + std::thread thread1_; +}; + +TEST_F(ScheduleStubRefreshTest, RefreshedUsingAsyncPingAndWarm) { + auto cq_impl = internal::GetCompletionQueueImpl(cq_); + auto refresh_state = std::make_shared( + cq_impl, std::chrono::milliseconds(1), std::chrono::milliseconds(2)); + std::string instance_name = "projects/my-project/instances/my-instance"; + + // These promises are used to coordinate thread execution to ensure the test + // does not finish before the CompletionQueue thread executes all the tasks + // on the queue. + promise p; + promise> p2; + + auto mock_stub = std::make_shared(); + EXPECT_CALL(*mock_stub, AsyncPingAndWarm) + .WillRepeatedly( + [&](CompletionQueue&, std::shared_ptr const&, + internal::ImmutableOptions const&, + google::bigtable::v2::PingAndWarmRequest const& request) + -> future> { + EXPECT_THAT(request.name(), Eq(instance_name)); + return p2.get_future(); + }); + + MockFunction mock_fn; + EXPECT_CALL(mock_fn, Call).WillOnce([&p](Status const& s) -> void { + EXPECT_THAT(s, IsOk()); + p.set_value(); + }); + + ScheduleStubRefresh(cq_impl, refresh_state, mock_stub, instance_name, + mock_fn.AsStdFunction()); + p2.set_value(google::bigtable::v2::PingAndWarmResponse{}); + p.get_future().get(); +} + +TEST_F(ScheduleStubRefreshTest, RefreshTimerCancelled) { + auto cq_impl = internal::GetCompletionQueueImpl(cq_); + auto refresh_state = std::make_shared( + cq_impl, std::chrono::seconds(60), std::chrono::seconds(120)); + std::string instance_name = "projects/my-project/instances/my-instance"; + + auto mock_stub = std::make_shared(); + EXPECT_CALL(*mock_stub, AsyncPingAndWarm).Times(0); + + MockFunction mock_fn; + EXPECT_CALL(mock_fn, Call).Times(0); + + ScheduleStubRefresh(cq_impl, refresh_state, mock_stub, instance_name, + mock_fn.AsStdFunction()); + cq_impl->CancelAll(); +} + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigtable_internal } // namespace cloud diff --git a/google/cloud/bigtable/internal/data_connection_impl.cc b/google/cloud/bigtable/internal/data_connection_impl.cc index 87aeeadd0f7c4..9dd334aac532f 100644 --- a/google/cloud/bigtable/internal/data_connection_impl.cc +++ b/google/cloud/bigtable/internal/data_connection_impl.cc @@ -189,6 +189,12 @@ ResultType MakeStatusOnlyResult(Status status) { std::make_unique(std::move(status))); } +std::string_view InstanceNameFromTableName(std::string_view table_name) { + auto pos = table_name.rfind("/tables"); + if (pos == std::string_view::npos) return {}; + return table_name.substr(0, pos); +} + } // namespace bigtable::Row TransformReadModifyWriteRowResponse( @@ -213,10 +219,10 @@ bigtable::Row TransformReadModifyWriteRowResponse( DataConnectionImpl::DataConnectionImpl( std::unique_ptr background, - std::shared_ptr stub, + std::unique_ptr stub_manager, std::shared_ptr limiter, Options options) : background_(std::move(background)), - stub_(std::move(stub)), + stub_manager_(std::move(stub_manager)), limiter_(std::move(limiter)), options_(internal::MergeOptions(std::move(options), DataConnection::options())) { @@ -244,15 +250,33 @@ DataConnectionImpl::DataConnectionImpl( DataConnectionImpl::DataConnectionImpl( std::unique_ptr background, std::shared_ptr stub, + std::shared_ptr limiter, Options options) + : DataConnectionImpl(std::move(background), + std::make_unique(std::move(stub)), + std::move(limiter), std::move(options)) {} + +DataConnectionImpl::DataConnectionImpl( + std::unique_ptr background, + std::unique_ptr stub_manager, std::unique_ptr operation_context_factory, std::shared_ptr limiter, Options options) : background_(std::move(background)), - stub_(std::move(stub)), + stub_manager_(std::move(stub_manager)), operation_context_factory_(std::move(operation_context_factory)), limiter_(std::move(limiter)), options_(internal::MergeOptions(std::move(options), DataConnection::options())) {} +DataConnectionImpl::DataConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + std::unique_ptr operation_context_factory, + std::shared_ptr limiter, Options options) + : DataConnectionImpl(std::move(background), + std::make_unique(std::move(stub)), + std::move(operation_context_factory), + std::move(limiter), std::move(options)) {} + Status DataConnectionImpl::Apply(std::string const& table_name, bigtable::SingleRowMutation mut) { auto current = google::cloud::internal::SaveCurrentOptions(); @@ -270,14 +294,16 @@ Status DataConnectionImpl::Apply(std::string const& table_name, auto operation_context = operation_context_factory_->MutateRow( table_name, app_profile_id(*current)); + + auto stub = stub_manager_->GetStub(InstanceNameFromTableName(table_name)); auto sor = google::cloud::internal::RetryLoop( retry_policy(*current), backoff_policy(*current), is_idempotent ? Idempotency::kIdempotent : Idempotency::kNonIdempotent, - [this, &operation_context]( + [stub, &operation_context]( grpc::ClientContext& context, Options const& options, google::bigtable::v2::MutateRowRequest const& request) { operation_context->PreCall(context); - auto s = stub_->MutateRow(context, options, request); + auto s = stub->MutateRow(context, options, request); operation_context->PostCall(context, s.status()); return s; }, @@ -311,7 +337,9 @@ future DataConnectionImpl::AsyncApply(std::string const& table_name, is_idempotent ? Idempotency::kIdempotent : Idempotency::kNonIdempotent, background_->cq(), - [stub = stub_, operation_context]( + [stub = + stub_manager_->GetStub(InstanceNameFromTableName(table_name)), + operation_context]( CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, @@ -350,8 +378,9 @@ std::vector DataConnectionImpl::BulkApply( std::unique_ptr retry; std::unique_ptr backoff; Status status; + auto stub = stub_manager_->GetStub(InstanceNameFromTableName(table_name)); while (true) { - status = mutator.MakeOneRequest(*stub_, *limiter_, *current); + status = mutator.MakeOneRequest(*stub, *limiter_, *current); if (!mutator.HasPendingMutations()) break; if (!retry) retry = retry_policy(*current); if (!backoff) backoff = backoff_policy(*current); @@ -372,10 +401,12 @@ DataConnectionImpl::AsyncBulkApply(std::string const& table_name, auto operation_context = operation_context_factory_->MutateRows( table_name, app_profile_id(*current)); return AsyncBulkApplier::Create( - background_->cq(), stub_, limiter_, retry_policy(*current), - backoff_policy(*current), enable_server_retries(*current), - *idempotency_policy(*current), app_profile_id(*current), table_name, - std::move(mut), std::move(operation_context)); + background_->cq(), + stub_manager_->GetStub(InstanceNameFromTableName(table_name)), limiter_, + retry_policy(*current), backoff_policy(*current), + enable_server_retries(*current), *idempotency_policy(*current), + app_profile_id(*current), table_name, std::move(mut), + std::move(operation_context)); } bigtable::RowReader DataConnectionImpl::ReadRowsFull( @@ -383,7 +414,9 @@ bigtable::RowReader DataConnectionImpl::ReadRowsFull( auto current = google::cloud::internal::SaveCurrentOptions(); auto operation_context = operation_context_factory_->ReadRows( params.table_name, params.app_profile_id); - return ReadRowsHelper(stub_, current, std::move(params), + auto stub = + stub_manager_->GetStub(InstanceNameFromTableName(params.table_name)); + return ReadRowsHelper(stub, current, std::move(params), std::move(operation_context)); } @@ -398,8 +431,10 @@ StatusOr> DataConnectionImpl::ReadRow( // OperationContextFactory::ReadRow to create the operation_context. auto operation_context = operation_context_factory_->ReadRow(table_name, app_profile_id(*current)); + auto stub = stub_manager_->GetStub(InstanceNameFromTableName(table_name)); + auto reader = - ReadRowsHelper(stub_, current, + ReadRowsHelper(stub, current, bigtable::ReadRowsParams{ table_name, app_profile_id(*current), std::move(row_set), rows_limit, std::move(filter)}, @@ -439,13 +474,14 @@ StatusOr DataConnectionImpl::CheckAndMutateRow( : Idempotency::kNonIdempotent; auto operation_context = operation_context_factory_->CheckAndMutateRow( table_name, app_profile_id(*current)); + auto stub = stub_manager_->GetStub(InstanceNameFromTableName(table_name)); auto sor = google::cloud::internal::RetryLoop( retry_policy(*current), backoff_policy(*current), idempotency, - [this, &operation_context]( + [stub, &operation_context]( grpc::ClientContext& context, Options const& options, google::bigtable::v2::CheckAndMutateRowRequest const& request) { operation_context->PreCall(context); - auto s = stub_->CheckAndMutateRow(context, options, request); + auto s = stub->CheckAndMutateRow(context, options, request); operation_context->PostCall(context, s.status()); return s; }, @@ -483,10 +519,11 @@ DataConnectionImpl::AsyncCheckAndMutateRow( auto backoff = backoff_policy(*current); auto operation_context = operation_context_factory_->CheckAndMutateRow( table_name, app_profile_id(*current)); + auto stub = stub_manager_->GetStub(InstanceNameFromTableName(table_name)); return google::cloud::internal::AsyncRetryLoop( std::move(retry), std::move(backoff), idempotency, background_->cq(), - [stub = stub_, operation_context]( + [stub, operation_context]( CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, @@ -529,11 +566,12 @@ StatusOr> DataConnectionImpl::SampleRows( std::unique_ptr backoff; auto operation_context = operation_context_factory_->SampleRowKeys( table_name, app_profile_id(*current)); + auto stub = stub_manager_->GetStub(InstanceNameFromTableName(table_name)); while (true) { auto context = std::make_shared(); internal::ConfigureContext(*context, internal::CurrentOptions()); operation_context->PreCall(*context); - auto stream = stub_->SampleRowKeys(context, Options{}, request); + auto stream = stub->SampleRowKeys(context, Options{}, request); absl::optional status; while (true) { @@ -574,9 +612,11 @@ DataConnectionImpl::AsyncSampleRows(std::string const& table_name) { auto operation_context = operation_context_factory_->SampleRowKeys( table_name, app_profile_id(*current)); return AsyncRowSampler::Create( - background_->cq(), stub_, retry_policy(*current), - backoff_policy(*current), enable_server_retries(*current), - app_profile_id(*current), table_name, std::move(operation_context)); + background_->cq(), + stub_manager_->GetStub(InstanceNameFromTableName(table_name)), + retry_policy(*current), backoff_policy(*current), + enable_server_retries(*current), app_profile_id(*current), table_name, + std::move(operation_context)); } StatusOr DataConnectionImpl::ReadModifyWriteRow( @@ -584,14 +624,16 @@ StatusOr DataConnectionImpl::ReadModifyWriteRow( auto current = google::cloud::internal::SaveCurrentOptions(); auto operation_context = operation_context_factory_->ReadModifyWriteRow( request.table_name(), app_profile_id(*current)); + auto stub = + stub_manager_->GetStub(InstanceNameFromTableName(request.table_name())); auto sor = google::cloud::internal::RetryLoop( retry_policy(*current), backoff_policy(*current), Idempotency::kNonIdempotent, - [this, operation_context]( + [stub, operation_context]( grpc::ClientContext& context, Options const& options, google::bigtable::v2::ReadModifyWriteRowRequest const& request) { operation_context->PreCall(context); - auto result = stub_->ReadModifyWriteRow(context, options, request); + auto result = stub->ReadModifyWriteRow(context, options, request); operation_context->PostCall(context, result.status()); return result; }, @@ -608,10 +650,12 @@ future> DataConnectionImpl::AsyncReadModifyWriteRow( request.table_name(), app_profile_id(*current)); auto retry = retry_policy(*current); auto backoff = backoff_policy(*current); + auto stub = + stub_manager_->GetStub(InstanceNameFromTableName(request.table_name())); return google::cloud::internal::AsyncRetryLoop( std::move(retry), std::move(backoff), Idempotency::kNonIdempotent, background_->cq(), - [stub = stub_, operation_context]( + [stub, operation_context]( CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, @@ -648,11 +692,12 @@ void DataConnectionImpl::AsyncReadRowsHelper( std::shared_ptr operation_context) { auto reverse = internal::CurrentOptions().get(); bigtable_internal::AsyncRowReader::Create( - background_->cq(), stub_, app_profile_id(*current), table_name, - std::move(on_row), std::move(on_finish), std::move(row_set), rows_limit, - std::move(filter), reverse, retry_policy(*current), - backoff_policy(*current), enable_server_retries(*current), - std::move(operation_context)); + background_->cq(), + stub_manager_->GetStub(InstanceNameFromTableName(table_name)), + app_profile_id(*current), table_name, std::move(on_row), + std::move(on_finish), std::move(row_set), rows_limit, std::move(filter), + reverse, retry_policy(*current), backoff_policy(*current), + enable_server_retries(*current), std::move(operation_context)); } void DataConnectionImpl::AsyncReadRows( @@ -743,14 +788,15 @@ StatusOr DataConnectionImpl::PrepareQuery( } auto operation_context = operation_context_factory_->PrepareQuery( instance_full_name, app_profile_id(*current)); + auto stub = stub_manager_->GetStub(params.instance.FullName()); auto response = google::cloud::internal::RetryLoop( retry_policy(*current), backoff_policy(*current), Idempotency::kIdempotent, - [this, operation_context]( + [stub, operation_context]( grpc::ClientContext& context, Options const& options, google::bigtable::v2::PrepareQueryRequest const& request) { operation_context->PreCall(context); - auto const& result = stub_->PrepareQuery(context, options, request); + auto const& result = stub->PrepareQuery(context, options, request); operation_context->PostCall(context, result.status()); return result; }, @@ -779,17 +825,18 @@ StatusOr DataConnectionImpl::PrepareQuery( auto backoff = backoff_policy(*current); auto operation_context = operation_context_factory_->PrepareQuery( request.instance_name(), app_profile_id(*current)); + auto stub = stub_manager_->GetStub(request.instance_name()); return google::cloud::internal::AsyncRetryLoop( std::move(retry), std::move(backoff), Idempotency::kIdempotent, background_->cq(), - [this, operation_context]( + [stub, operation_context]( CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PrepareQueryRequest const& request) { operation_context->PreCall(*context); - auto f = stub_->AsyncPrepareQuery(cq, context, - std::move(options), request); + auto f = stub->AsyncPrepareQuery(cq, context, + std::move(options), request); return f.then( [operation_context, context = std::move(context)](auto f) { auto s = f.get(); @@ -827,17 +874,19 @@ future> DataConnectionImpl::AsyncPrepareQuery( auto operation_context = operation_context_factory_->PrepareQuery( instance_full_name, app_profile_id(*current)); auto const* func = __func__; + auto instance_name = params.instance.FullName(); + auto stub = stub_manager_->GetStub(instance_name); return google::cloud::internal::AsyncRetryLoop( std::move(retry), std::move(backoff), Idempotency::kIdempotent, background_->cq(), - [this, operation_context]( + [stub, instance_name, operation_context]( CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PrepareQueryRequest const& request) { operation_context->PreCall(*context); - auto f = stub_->AsyncPrepareQuery(cq, context, - std::move(options), request); + auto f = stub->AsyncPrepareQuery(cq, context, std::move(options), + request); return f.then( [operation_context, context = std::move(context)](auto f) { auto s = f.get(); @@ -846,7 +895,7 @@ future> DataConnectionImpl::AsyncPrepareQuery( }); }, current, request, func) - .then([this, request, operation_context, current, + .then([this, instance_name, request, operation_context, current, params = std::move(params), func](future> future) -> StatusOr { @@ -869,23 +918,25 @@ future> DataConnectionImpl::AsyncPrepareQuery( "Column type cannot be empty", GCP_ERROR_INFO())); } } - auto refresh_fn = [this, request, func]() mutable { + auto refresh_fn = [this, instance_name, request, func]() mutable { auto current = google::cloud::internal::SaveCurrentOptions(); auto retry = query_plan_refresh_function_retry_policy(*current); auto backoff = backoff_policy(*current); auto operation_context = operation_context_factory_->PrepareQuery( request.instance_name(), app_profile_id(*current)); + // Get a new stub here to take advantage of the pool. + auto stub = stub_manager_->GetStub(instance_name); return google::cloud::internal::AsyncRetryLoop( std::move(retry), std::move(backoff), Idempotency::kIdempotent, background_->cq(), - [this, operation_context]( + [stub, instance_name, operation_context]( CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::bigtable::v2::PrepareQueryRequest const& request) { operation_context->PreCall(*context); - auto f = stub_->AsyncPrepareQuery( + auto f = stub->AsyncPrepareQuery( cq, context, std::move(options), request); return f.then([operation_context, context = std::move(context)](auto f) { @@ -1052,9 +1103,9 @@ bigtable::RowStream DataConnectionImpl::ExecuteQuery( auto const tracing_enabled = RpcStreamTracingEnabled(); auto const& tracing_options = RpcTracingOptions(); - + auto stub = stub_manager_->GetStub(params.bound_query.instance().FullName()); auto source_fn = - [stub = stub_, tracing_enabled, tracing_options]( + [stub, tracing_enabled, tracing_options]( google::bigtable::v2::ExecuteQueryRequest& request, google::bigtable::v2::ResultSetMetadata metadata, std::unique_ptr retry_policy_prototype, diff --git a/google/cloud/bigtable/internal/data_connection_impl.h b/google/cloud/bigtable/internal/data_connection_impl.h index c5f23fc979a37..dffaeb365c993 100644 --- a/google/cloud/bigtable/internal/data_connection_impl.h +++ b/google/cloud/bigtable/internal/data_connection_impl.h @@ -20,6 +20,7 @@ #include "google/cloud/bigtable/internal/mutate_rows_limiter.h" #include "google/cloud/bigtable/internal/operation_context_factory.h" #include "google/cloud/bigtable/internal/partial_result_set_reader.h" +#include "google/cloud/bigtable/internal/stub_manager.h" #include "google/cloud/bigtable/prepared_query.h" #include "google/cloud/bigtable/result_source_interface.h" #include "google/cloud/background_threads.h" @@ -40,6 +41,18 @@ class DataConnectionImpl : public bigtable::DataConnection { public: ~DataConnectionImpl() override = default; + DataConnectionImpl(std::unique_ptr background, + std::unique_ptr stub_manager, + std::shared_ptr limiter, + Options options); + + // This constructor is used for testing. + DataConnectionImpl( + std::unique_ptr background, + std::unique_ptr stub_manager, + std::unique_ptr operation_context_factory, + std::shared_ptr limiter, Options options); + DataConnectionImpl(std::unique_ptr background, std::shared_ptr stub, std::shared_ptr limiter, @@ -120,7 +133,7 @@ class DataConnectionImpl : public bigtable::DataConnection { std::shared_ptr operation_context); std::unique_ptr background_; - std::shared_ptr stub_; + std::unique_ptr stub_manager_; std::unique_ptr operation_context_factory_; std::shared_ptr limiter_; Options options_; diff --git a/google/cloud/bigtable/internal/dynamic_channel_pool.h b/google/cloud/bigtable/internal/dynamic_channel_pool.h new file mode 100644 index 0000000000000..f7a18a4c8f7af --- /dev/null +++ b/google/cloud/bigtable/internal/dynamic_channel_pool.h @@ -0,0 +1,439 @@ +// Copyright 2026 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. + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_DYNAMIC_CHANNEL_POOL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_DYNAMIC_CHANNEL_POOL_H + +#include "google/cloud/bigtable/instance_resource.h" +#include "google/cloud/bigtable/internal/channel_usage.h" +#include "google/cloud/bigtable/internal/connection_refresh_state.h" +#include "google/cloud/bigtable/internal/stub_manager.h" +#include "google/cloud/bigtable/options.h" +#include "google/cloud/completion_queue.h" +#include "google/cloud/internal/random.h" +#include "google/cloud/version.h" +#include +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +// +// This class manages a pool of Stubs wrapped in a ChannelUsage object, and +// selects one for use using a "Random Two Least Used" strategy. +// +// Based on usage data from the ChannelUsage object, the pool will add and +// remove ChannelUsage objects per the configuration present in the +// DynamicChannelPoolSizingPolicyOption. +// +template +class DynamicChannelPool + : public std::enable_shared_from_this> { + public: + // This function should only return an error status if priming is attempted + // and it is unsuccessful. + using StubFactoryFn = + std::function>>( + std::uint32_t id, std::string const& instance_name, + StubManager::Priming priming)>; + + static std::shared_ptr Create( + std::string const& instance_name, CompletionQueue cq, + std::vector>> initial_channels, + std::shared_ptr refresh_state, + StubFactoryFn stub_factory_fn, + bigtable::experimental::DynamicChannelPoolSizingPolicy sizing_policy = + {}) { + auto pool = std::shared_ptr(new DynamicChannelPool( + std::move(instance_name), std::move(cq), std::move(initial_channels), + std::move(refresh_state), std::move(stub_factory_fn), + std::move(sizing_policy))); + return pool; + } + + ~DynamicChannelPool() { + std::scoped_lock lk(mu_); + // Eventually the channel refresh chain will terminate after this class is + // destroyed. But only after the timer futures expire on the CompletionQueue + // performing this work. We might as well cancel those timer futures now. + refresh_state_->timers().CancelAll(); + if (remove_channel_poll_timer_.valid()) remove_channel_poll_timer_.cancel(); + if (pool_size_decrease_cooldown_timer_.valid()) { + pool_size_decrease_cooldown_timer_.cancel(); + } + } + + // This is a snapshot aka dirty read as the size could immediately change + // after this function returns. + std::size_t size() const { + std::scoped_lock lk(mu_); + return channels_.size(); + } + + // This is a snapshot aka dirty read as the size could immediately change + // after this function returns. + bool empty() const { + std::scoped_lock lk(mu_); + return channels_.empty(); + } + + // Calls CheckPoolChannelHealth before picking a channel. + // + // Pick two random channels from channels_ and return the channel with the + // lower number of outstanding_rpcs. This is the "quick" path. + // + // If one or both of the random channels have been marked unhealthy after a + // refresh, continue choosing random channels to find a pair of healthy + // channels to compare. Any channels found to be unhealthy are moved from + // channels_ to draining_channels_ and ScheduleRemoveChannels is called. + // + // If there is only one health channel in the pool, use it. + // + // If there are no healthy channels in channels_, create a new channel and + // use that one. Also call ScheduleAddChannels to replenish channels_. + std::shared_ptr> GetChannelRandomTwoLeastUsed() { + std::scoped_lock lk(mu_); + CheckPoolChannelHealth(lk); + + ChannelSelectionData d; + d.iterators.reserve(channels_.size()); + for (auto iter = channels_.begin(); iter != channels_.end(); ++iter) { + d.iterators.push_back(iter); + } + std::shuffle(d.iterators.begin(), d.iterators.end(), rng_); + d.shuffle_iter = d.iterators.begin(); + + if (d.shuffle_iter != d.iterators.end()) { + d.channel_1_iter = *d.shuffle_iter; + d.channel_1_rpcs = (*d.channel_1_iter)->instant_outstanding_rpcs(); + ++d.shuffle_iter; + } + + if (d.shuffle_iter != d.iterators.end()) { + d.channel_2_iter = *d.shuffle_iter; + d.channel_2_rpcs = (*d.channel_2_iter)->instant_outstanding_rpcs(); + } + + // This is the most common case so we try it first. + if (d.channel_1_rpcs.ok() && d.channel_2_rpcs.ok()) { + return *d.channel_1_rpcs < *d.channel_2_rpcs ? *d.channel_1_iter + : *d.channel_2_iter; + } + if (d.iterators.size() == 1 && d.channel_1_rpcs.ok()) { + // Pool contains exactly 1 good channel. + return *d.channel_1_iter; + } + if (d.iterators.empty()) { + // Pool is empty, create a channel immediately and return it. While the + // return value is a StatusOr, it will only ever contain an error if + // priming is attempted. + channels_.push_back(stub_factory_fn_(next_channel_id_++, instance_name_, + StubManager::Priming::kNoPriming) + .value()); + return channels_.front(); + } + return HandleBadChannels(lk, d); + } + + private: + friend class DynamicChannelPoolTestWrapper; + + DynamicChannelPool( + std::string const& instance_name, CompletionQueue cq, + std::vector>> initial_wrapped_channels, + std::shared_ptr refresh_state, + StubFactoryFn stub_factory_fn, + bigtable::experimental::DynamicChannelPoolSizingPolicy sizing_policy) + : instance_name_(std::move(instance_name)), + cq_(std::move(cq)), + refresh_state_(std::move(refresh_state)), + stub_factory_fn_(std::move(stub_factory_fn)), + channels_(std::move(initial_wrapped_channels)), + sizing_policy_(std::move(sizing_policy)), + next_channel_id_(static_cast(channels_.size())) { + std::scoped_lock lk(mu_); + SetSizeDecreaseCooldownTimer(lk); + } + + struct ChannelSelectionData { + using ChannelSelect = + typename std::vector>>::iterator; + std::vector iterators; + ChannelSelect channel_1_iter; + ChannelSelect channel_2_iter; + StatusOr channel_1_rpcs = Status{StatusCode::kNotFound, ""}; + StatusOr channel_2_rpcs = Status{StatusCode::kNotFound, ""}; + typename std::vector::iterator shuffle_iter; + + static void FindGoodChannel( + std::vector& iterators, ChannelSelect& iter, + StatusOr& rpcs, + typename std::vector::iterator& shuffle_iter, + std::vector& bad_channel_iters) { + if (!rpcs.ok()) { + bad_channel_iters.push_back(iter); + while (shuffle_iter != iterators.end() && !rpcs.ok()) { + iter = *shuffle_iter; + rpcs = (*iter)->instant_outstanding_rpcs(); + if (!rpcs.ok()) bad_channel_iters.push_back(iter); + ++shuffle_iter; + } + } + } + }; + + // We have one or more bad channels. Spending time finding a good channel + // will be cheaper than trying to use a bad channel in the long run. + std::shared_ptr> HandleBadChannels( + std::scoped_lock const& lk, ChannelSelectionData& d) { + std::vector bad_channel_iters; + if (d.shuffle_iter != d.iterators.end()) ++d.shuffle_iter; + ChannelSelectionData::FindGoodChannel(d.iterators, d.channel_1_iter, + d.channel_1_rpcs, d.shuffle_iter, + bad_channel_iters); + ChannelSelectionData::FindGoodChannel(d.iterators, d.channel_2_iter, + d.channel_2_rpcs, d.shuffle_iter, + bad_channel_iters); + + std::shared_ptr> channel; + if (d.channel_1_rpcs.ok() || d.channel_2_rpcs.ok()) { + if (d.channel_1_rpcs.ok() && d.channel_2_rpcs.ok()) { + channel = *d.channel_1_rpcs < *d.channel_2_rpcs ? *d.channel_1_iter + : *d.channel_2_iter; + } else if (d.channel_1_rpcs.ok()) { + channel = *d.channel_1_iter; + } else if (d.channel_2_rpcs.ok()) { + channel = *d.channel_2_iter; + } + // Wait until we no longer need valid iterators to call EvictBadChannels. + EvictBadChannels(lk, bad_channel_iters); + } else { + // Call EvictBadChannels before we channels_.push_back to avoid + // invalidating bad_channel_iters if there is a realloc of the vector. + EvictBadChannels(lk, bad_channel_iters); + // We have no usable channels in the entire pool; this is bad. + // Create a channel immediately to unblock application. While the + // return value is a StatusOr, it will only ever contain an error if + // priming is attempted. + channels_.push_back(stub_factory_fn_(next_channel_id_++, instance_name_, + StubManager::Priming::kNoPriming) + .value()); + std::swap(channels_.front(), channels_.back()); + channel = channels_.front(); + } + ScheduleRemoveChannels(lk); + return channel; + } + + // Determines the number of channels to add and reserves the channel ids to + // be used. Lastly, it calls CompletionQueue::RunAsync with a callback that + // executes AddChannels with the reserved ids. + void ScheduleAddChannels( + std::scoped_lock const&, + std::function const&)> const& test_fn = nullptr) { + constexpr std::size_t kOneAddedChannel = 1; + std::size_t num_channels_to_add; + // If we're undersized due to bad channels, get us back to the minimum size. + if (channels_.size() < sizing_policy_.minimum_channel_pool_size) { + num_channels_to_add = + sizing_policy_.minimum_channel_pool_size - channels_.size(); + } else { + num_channels_to_add = + std::min(sizing_policy_.maximum_channel_pool_size - channels_.size(), + kOneAddedChannel); + } + num_pending_channels_ += num_channels_to_add; + std::vector new_channel_ids; + new_channel_ids.reserve(num_channels_to_add); + for (std::size_t i = 0; i < num_channels_to_add; ++i) { + new_channel_ids.push_back(next_channel_id_++); + } + + if (test_fn) test_fn(new_channel_ids); + + std::weak_ptr> weak_self = this->shared_from_this(); + cq_.RunAsync([new_channel_ids = std::move(new_channel_ids), + weak = std::move(weak_self)]() { + if (auto self = weak.lock()) { + self->AddChannels(new_channel_ids); + } + }); + } + + // Creates the new channels using the stub_factory_fn and only after that + // locks the mutex to add the new channels. + void AddChannels(std::vector const& new_channel_ids) { + std::vector>> new_stubs; + new_stubs.reserve(new_channel_ids.size()); + for (auto const& id : new_channel_ids) { + auto new_stub = stub_factory_fn_( + id, instance_name_, StubManager::Priming::kSynchronousPriming); + if (new_stub.ok()) new_stubs.push_back(*std::move(new_stub)); + } + std::scoped_lock lk(mu_); + num_pending_channels_ -= new_channel_ids.size(); + channels_.insert(channels_.end(), + std::make_move_iterator(new_stubs.begin()), + std::make_move_iterator(new_stubs.end())); + } + + // Calls CompletionQueuer::MakeRelativeTimer using + // remove_channel_polling_interval with a callback that executes + // RemoveChannels. + void ScheduleRemoveChannels(std::scoped_lock const&) { + if (remove_channel_poll_timer_.valid()) return; + std::weak_ptr> foo = this->shared_from_this(); + remove_channel_poll_timer_ = + cq_.MakeRelativeTimer(sizing_policy_.remove_channel_polling_interval) + .then( + [weak = std::move(foo)]( + future> f) { + if (f.get().ok()) { + if (auto self = weak.lock()) { + self->RemoveChannels(); + } + } + }); + } + + // Locks the mutex, reverse sorts draining_channels_, calling pop_back until + // either draining_channels_ is empty or a channel with outstanding_rpcs is + // encountered. Calls ScheduleRemoveChannels if draining_channels_ is + // non-empty. + void RemoveChannels() { + std::scoped_lock lk(mu_); + std::sort(draining_channels_.begin(), draining_channels_.end(), + [](std::shared_ptr> const& a, + std::shared_ptr> const& b) { + auto rpcs_a = a->instant_outstanding_rpcs(); + auto rpcs_b = b->instant_outstanding_rpcs(); + if (!rpcs_a.ok()) return false; + if (!rpcs_b.ok()) return true; + return *rpcs_a > *rpcs_b; + }); + while (!draining_channels_.empty()) { + auto outstanding_rpcs = + draining_channels_.back()->instant_outstanding_rpcs(); + if (outstanding_rpcs.ok() && *outstanding_rpcs > 0) { + ScheduleRemoveChannels(lk); + return; + } + + draining_channels_.pop_back(); + } + } + + void EvictBadChannels( + std::scoped_lock const&, + std::vector< + typename std::vector>>::iterator>& + bad_channel_iters) { + auto back_iter = channels_.rbegin(); + for (auto& bad_channel_iter : bad_channel_iters) { + bool swapped = false; + while (!swapped && back_iter != channels_.rend()) { + auto b = (*back_iter)->instant_outstanding_rpcs(); + if (b.ok()) { + std::swap(*back_iter, *bad_channel_iter); + draining_channels_.push_back(std::move(*back_iter)); + swapped = true; + } + ++back_iter; + } + } + for (std::size_t i = 0; i < bad_channel_iters.size(); ++i) { + channels_.pop_back(); + } + } + + void SetSizeDecreaseCooldownTimer(std::scoped_lock const&) { + pool_size_decrease_cooldown_timer_ = cq_.MakeRelativeTimer( + sizing_policy_.pool_size_decrease_cooldown_interval); + } + + // Computes the average RPCs per channel across all channels in the pool, + // by summing the outstanding_rpc from each channel and dividing by the + // number of active channels plus the num_pending_channels_. + // Any channels that are awaiting removal in draining_channels_ are excluded + // from this calculation. + // The computed average is compared to the thresholds in the sizing policy + // and calls either ScheduleRemoveChannel or ScheduleAddChannel as + // appropriate. If ScheduleRemoveChannel is called the resize_cooldown_timer + // is also set. + void CheckPoolChannelHealth(std::scoped_lock const& lk) { + int average_rpcs_per_channel = + channels_.empty() + ? 0 + : std::accumulate(channels_.begin(), channels_.end(), 0, + [](int a, auto const& b) { + auto rpcs_b = b->instant_outstanding_rpcs(); + return a + (rpcs_b.ok() ? *rpcs_b : 0); + }) / + static_cast(channels_.size() + num_pending_channels_); + if (channels_.size() < sizing_policy_.minimum_channel_pool_size || + (average_rpcs_per_channel > + sizing_policy_.maximum_average_outstanding_rpcs_per_channel && + channels_.size() < sizing_policy_.maximum_channel_pool_size)) { + // Channel/stub creation is expensive, instead of making the current RPC + // wait on this, use an existing channel right now, and schedule a channel + // to be added. + ScheduleAddChannels(lk); + return; + } + + if ((!pool_size_decrease_cooldown_timer_.valid() || + pool_size_decrease_cooldown_timer_.is_ready()) && + average_rpcs_per_channel < + sizing_policy_.minimum_average_outstanding_rpcs_per_channel && + channels_.size() > sizing_policy_.minimum_channel_pool_size) { + if (pool_size_decrease_cooldown_timer_.is_ready()) { + pool_size_decrease_cooldown_timer_.get(); + } + auto random_channel = std::uniform_int_distribution( + 0, channels_.size() - 1)(rng_); + std::swap(channels_[random_channel], channels_.back()); + draining_channels_.push_back(std::move(channels_.back())); + channels_.pop_back(); + ScheduleRemoveChannels(lk); + SetSizeDecreaseCooldownTimer(lk); + } + } + + mutable std::mutex mu_; + std::string instance_name_; + CompletionQueue cq_; + google::cloud::internal::DefaultPRNG rng_; + std::shared_ptr refresh_state_; + StubFactoryFn stub_factory_fn_; + std::vector>> channels_; + std::size_t num_pending_channels_ = 0; + bigtable::experimental::DynamicChannelPoolSizingPolicy sizing_policy_; + std::vector>> draining_channels_; + future remove_channel_poll_timer_; + future> + pool_size_decrease_cooldown_timer_; + std::uint32_t next_channel_id_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_DYNAMIC_CHANNEL_POOL_H diff --git a/google/cloud/bigtable/internal/dynamic_channel_pool_test.cc b/google/cloud/bigtable/internal/dynamic_channel_pool_test.cc new file mode 100644 index 0000000000000..c2f7d9a2675d9 --- /dev/null +++ b/google/cloud/bigtable/internal/dynamic_channel_pool_test.cc @@ -0,0 +1,1194 @@ +// Copyright 2026 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 "google/cloud/bigtable/internal/dynamic_channel_pool.h" +#include "google/cloud/bigtable/testing/mock_bigtable_stub.h" +#include "google/cloud/internal/make_status.h" +#include "google/cloud/testing_util/fake_completion_queue_impl.h" +#include "google/cloud/testing_util/mock_completion_queue_impl.h" +#include "google/cloud/testing_util/status_matchers.h" +#include +#include + +namespace google { +namespace cloud { +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DynamicChannelPoolTestWrapper { + public: + explicit DynamicChannelPoolTestWrapper( + std::shared_ptr> pool) + : pool_(std::move(pool)) {} + + using ChannelSelectionData = + DynamicChannelPool::ChannelSelectionData; + + std::shared_ptr> HandleBadChannels( + std::scoped_lock const& lk, + DynamicChannelPool::ChannelSelectionData& d) { + return pool_->HandleBadChannels(lk, d); + } + + void ScheduleAddChannels( + std::scoped_lock const& lk, + std::function const&)> const& test_fn) { + pool_->ScheduleAddChannels(lk, test_fn); + } + + void AddChannels(std::vector const& new_channel_ids) { + pool_->AddChannels(new_channel_ids); + } + + void ScheduleRemoveChannels(std::scoped_lock const& lk) { + pool_->ScheduleRemoveChannels(lk); + } + + void RemoveChannels() { pool_->RemoveChannels(); } + + void EvictBadChannels( + std::scoped_lock const& lk, + std::vector>>::iterator>& + bad_channel_iters) { + pool_->EvictBadChannels(lk, bad_channel_iters); + } + + void SetSizeDecreaseCooldownTimer(std::scoped_lock const& lk) { + pool_->SetSizeDecreaseCooldownTimer(lk); + } + + void CheckPoolChannelHealth(std::scoped_lock const& lk) { + pool_->CheckPoolChannelHealth(lk); + } + + std::scoped_lock CreateLock() { + return std::scoped_lock(pool_->mu_); + } + + void SetRemoveChannelPollTimer(promise& p) { + pool_->remove_channel_poll_timer_ = p.get_future(); + } + + std::vector>> const& + SetDrainingChannels(std::vector>> + draining_channels) { + pool_->draining_channels_ = std::move(draining_channels); + return pool_->draining_channels_; + } + + std::size_t num_pending_channels() const { + return pool_->num_pending_channels_; + } + + DynamicChannelPoolTestWrapper& set_num_pending_channels(std::size_t n) { + pool_->num_pending_channels_ = n; + return *this; + } + + protected: + std::shared_ptr> pool_; +}; + +namespace { + +using ::google::cloud::bigtable::experimental::DynamicChannelPoolSizingPolicy; +using ::google::cloud::bigtable::testing::MockBigtableStub; +using ::google::cloud::testing_util::FakeCompletionQueueImpl; +using ::google::cloud::testing_util::MockCompletionQueueImpl; +using ::testing::Eq; +using ::testing::IsEmpty; +using ::testing::MockFunction; + +class DynamicChannelPoolTest : public ::testing::Test { + public: + DynamicChannelPoolTest() + : fake_cq_impl_(std::make_shared()), + mock_cq_impl_(std::make_shared()), + thread_([this] { cq_.Run(); }) {} + + ~DynamicChannelPoolTest() override { + cq_.Shutdown(); + thread_.join(); + } + + protected: + std::shared_ptr fake_cq_impl_; + std::shared_ptr mock_cq_impl_; + CompletionQueue cq_; + std::thread thread_; +}; + +TEST_F(DynamicChannelPoolTest, SelectLeastUsedFromTwoChannels) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + DynamicChannelPoolSizingPolicy sizing_policy; + + // There should be no attempt to grow the pool. + EXPECT_CALL(*mock_cq_impl_, RunAsync).Times(0); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + + auto stub_factory_fn = [&](int, std::string const&, StubManager::Priming) { + return std::make_shared>( + std::make_shared(), 20); + }; + + std::vector>> channels; + auto mock_stub_0 = std::make_shared(); + EXPECT_CALL(*mock_stub_0, CheckAndMutateRow) + .WillOnce([](grpc::ClientContext&, Options const&, + google::bigtable::v2::CheckAndMutateRowRequest const&) { + google::bigtable::v2::CheckAndMutateRowResponse response; + response.set_predicate_matched(true); + return response; + }); + auto mock_stub_1 = std::make_shared(); + EXPECT_CALL(*mock_stub_1, CheckAndMutateRow).Times(0); + int initial_rpc_count = 0; + channels.push_back(std::make_shared>( + std::move(mock_stub_0), initial_rpc_count++)); + channels.push_back(std::make_shared>( + std::move(mock_stub_1), initial_rpc_count)); + + // Pool creation should set the pool size decrease cooldown timer. + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return make_ready_future(StatusOr(std::chrono::system_clock::now())); + }); + + sizing_policy.maximum_channel_pool_size = 2; + sizing_policy.minimum_channel_pool_size = 2; + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn, sizing_policy); + auto selected_stub = pool->GetChannelRandomTwoLeastUsed(); + grpc::ClientContext context; + auto response = + selected_stub->AcquireStub()->CheckAndMutateRow(context, {}, {}); + ASSERT_STATUS_OK(response); + EXPECT_TRUE(response->predicate_matched()); + + fake_cq_impl_->SimulateCompletion(false); +} + +TEST_F(DynamicChannelPoolTest, OneInitialChannel) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + DynamicChannelPoolSizingPolicy sizing_policy; + + // There should be no attempt to grow the pool after creation. + EXPECT_CALL(*mock_cq_impl_, RunAsync).Times(0); + + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + + { // Pool created with 1 channel. + auto mock_stub = std::make_shared(); + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + EXPECT_CALL(stub_factory_fn, Call).Times(0); + // .WillOnce(::testing::Return( + // std::make_shared>(mock_stub))); + + std::vector>> channels; + auto mock_stub_0 = std::make_shared(); + EXPECT_CALL(*mock_stub_0, CheckAndMutateRow) + .WillOnce([](grpc::ClientContext&, Options const&, + google::bigtable::v2::CheckAndMutateRowRequest const&) { + google::bigtable::v2::CheckAndMutateRowResponse response; + response.set_predicate_matched(true); + return response; + }); + + int initial_rpc_count = 0; + channels.push_back(std::make_shared>( + std::move(mock_stub_0), initial_rpc_count)); + + // Pool creation should set the pool size increase cooldown timer. + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return cq_.MakeRelativeTimer( + sizing_policy.pool_size_decrease_cooldown_interval); + }); + + sizing_policy.maximum_channel_pool_size = 1; + sizing_policy.minimum_channel_pool_size = 1; + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + EXPECT_THAT(pool->size(), Eq(1)); + + auto selected_stub = pool->GetChannelRandomTwoLeastUsed(); + grpc::ClientContext context; + auto response = + selected_stub->AcquireStub()->CheckAndMutateRow(context, {}, {}); + ASSERT_STATUS_OK(response); + EXPECT_TRUE(response->predicate_matched()); + } + + fake_cq_impl_->SimulateCompletion(false); +} + +TEST_F(DynamicChannelPoolTest, EmptyInitialPool) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + DynamicChannelPoolSizingPolicy sizing_policy; + + // There should be no attempt to grow the pool after creation. + EXPECT_CALL(*mock_cq_impl_, RunAsync).Times(0); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + + { // Pool created with 0 channels. + auto mock_stub = std::make_shared(); + EXPECT_CALL(*mock_stub, CheckAndMutateRow) + .WillOnce([](grpc::ClientContext&, Options const&, + google::bigtable::v2::CheckAndMutateRowRequest const&) { + google::bigtable::v2::CheckAndMutateRowResponse response; + response.set_predicate_matched(true); + return response; + }); + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + EXPECT_CALL(stub_factory_fn, Call) + .Times(1) + .WillOnce(::testing::Return( + std::make_shared>(mock_stub))); + + std::vector>> channels; + + // Pool creation should set the pool size increase cooldown timer. + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return make_ready_future(StatusOr(std::chrono::system_clock::now())); + }); + + sizing_policy.maximum_channel_pool_size = 1; + sizing_policy.minimum_channel_pool_size = 0; + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + + EXPECT_THAT(*pool, ::testing::IsEmpty()); + + auto selected_stub = pool->GetChannelRandomTwoLeastUsed(); + grpc::ClientContext context; + auto response = + selected_stub->AcquireStub()->CheckAndMutateRow(context, {}, {}); + ASSERT_STATUS_OK(response); + EXPECT_TRUE(response->predicate_matched()); + + EXPECT_THAT(pool->size(), Eq(1)); + } + fake_cq_impl_->SimulateCompletion(false); +} + +TEST_F(DynamicChannelPoolTest, ScheduleAddChannelsPoolUndersized) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + + std::vector>> channels; + DynamicChannelPoolSizingPolicy sizing_policy; + sizing_policy.minimum_channel_pool_size = 10; + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + + // Pool creation should set the pool size increase cooldown timer. + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return make_ready_future(StatusOr(std::chrono::system_clock::now())); + }); + + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + + { + EXPECT_CALL(*mock_cq_impl_, RunAsync).Times(1); + auto test_fn = [](std::vector const& new_channel_ids) { + EXPECT_THAT(new_channel_ids, + ::testing::ElementsAreArray({0, 1, 2, 3, 4, 5, 6, 7, 8, 9})); + }; + auto lk = wrapper.CreateLock(); + wrapper.ScheduleAddChannels(lk, test_fn); + EXPECT_THAT(wrapper.num_pending_channels(), Eq(10)); + } + + { + EXPECT_CALL(*mock_cq_impl_, RunAsync).Times(1); + auto test_fn = [](std::vector const& new_channel_ids) { + EXPECT_THAT(new_channel_ids, + ::testing::ElementsAreArray( + {10, 11, 12, 13, 14, 15, 16, 17, 18, 19})); + }; + auto lk = wrapper.CreateLock(); + wrapper.ScheduleAddChannels(lk, test_fn); + EXPECT_THAT(wrapper.num_pending_channels(), Eq(20)); + } +} + +TEST_F(DynamicChannelPoolTest, ScheduleAddChannelsPoolAtMax) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + + std::vector>> channels; + channels.push_back(std::make_shared>( + std::make_shared(), 0)); + channels.push_back(std::make_shared>( + std::make_shared(), 0)); + DynamicChannelPoolSizingPolicy sizing_policy; + sizing_policy.minimum_channel_pool_size = 2; + sizing_policy.maximum_channel_pool_size = 2; + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + + // Pool creation should set the pool size increase cooldown timer. + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return make_ready_future(StatusOr(std::chrono::system_clock::now())); + }); + + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + + EXPECT_CALL(*mock_cq_impl_, RunAsync).Times(1); + auto test_fn = [](std::vector const& new_channel_ids) { + EXPECT_THAT(new_channel_ids, IsEmpty()); + }; + + { + auto lk = wrapper.CreateLock(); + wrapper.ScheduleAddChannels(lk, test_fn); + } +} + +TEST_F(DynamicChannelPoolTest, ScheduleAddChannelsPoolBelowMax) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + + std::vector>> channels; + channels.push_back(std::make_shared>( + std::make_shared(), 0)); + channels.push_back(std::make_shared>( + std::make_shared(), 0)); + DynamicChannelPoolSizingPolicy sizing_policy; + sizing_policy.minimum_channel_pool_size = 2; + sizing_policy.maximum_channel_pool_size = 10; + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + + // Pool creation should set the pool size increase cooldown timer. + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return make_ready_future(StatusOr(std::chrono::system_clock::now())); + }); + + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + + EXPECT_CALL(*mock_cq_impl_, RunAsync).Times(1); + auto test_fn = [](std::vector const& new_channel_ids) { + EXPECT_THAT(new_channel_ids, ::testing::ElementsAreArray({2})); + }; + + { + auto lk = wrapper.CreateLock(); + wrapper.ScheduleAddChannels(lk, test_fn); + } +} + +TEST_F(DynamicChannelPoolTest, AddChannels) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + DynamicChannelPoolSizingPolicy sizing_policy; + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + auto mock_stub_0 = std::make_shared(); + auto mock_stub_1 = std::make_shared(); + EXPECT_CALL(stub_factory_fn, Call) + .WillOnce([&](int id, std::string const& instance, + StubManager::Priming priming) { + EXPECT_THAT(id, Eq(0)); + EXPECT_THAT(instance, Eq(instance_name)); + EXPECT_THAT(priming, Eq(StubManager::Priming::kSynchronousPriming)); + return std::make_shared>(mock_stub_0, 20); + }) + .WillOnce([&](int id, std::string const& instance, + StubManager::Priming priming) { + EXPECT_THAT(id, Eq(1)); + EXPECT_THAT(instance, Eq(instance_name)); + EXPECT_THAT(priming, Eq(StubManager::Priming::kSynchronousPriming)); + return std::make_shared>(mock_stub_1, 20); + }); + + std::vector>> channels; + // Pool creation should set the pool size increase cooldown timer. + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return make_ready_future(StatusOr(std::chrono::system_clock::now())); + }); + + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + std::vector new_channel_ids = {0, 1}; + wrapper.set_num_pending_channels(new_channel_ids.size()); + wrapper.AddChannels(new_channel_ids); + EXPECT_THAT(pool->size(), Eq(2)); + EXPECT_THAT(wrapper.num_pending_channels(), Eq(0)); + fake_cq_impl_->SimulateCompletion(false); +} + +TEST_F(DynamicChannelPoolTest, ScheduleRemoveChannelsAlreadyPending) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + + std::vector>> channels; + DynamicChannelPoolSizingPolicy sizing_policy; + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + + // Pool creation should set the pool size increase cooldown timer. + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return make_ready_future(StatusOr(std::chrono::system_clock::now())); + }); + + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + + promise p; + wrapper.SetRemoveChannelPollTimer(p); + { + auto lk = wrapper.CreateLock(); + wrapper.ScheduleRemoveChannels(lk); + } + + fake_cq_impl_->SimulateCompletion(false); +} + +TEST_F(DynamicChannelPoolTest, ScheduleRemoveChannelsNotAlreadyPending) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + + std::vector>> channels; + DynamicChannelPoolSizingPolicy sizing_policy; + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + + // Pool creation should set the pool size increase cooldown timer. + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return make_ready_future(StatusOr(std::chrono::system_clock::now())); + }); + + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.remove_channel_polling_interval) + .count())); + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }); + { + auto lk = wrapper.CreateLock(); + wrapper.ScheduleRemoveChannels(lk); + } + + fake_cq_impl_->SimulateCompletion(false); +} + +TEST_F(DynamicChannelPoolTest, RemoveChannelsLoneChannelDrained) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + + std::vector>> channels; + DynamicChannelPoolSizingPolicy sizing_policy; + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + + // Pool creation should set the pool size increase cooldown timer. + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return make_ready_future(StatusOr(std::chrono::system_clock::now())); + }); + + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + + std::vector>> draining_channels; + draining_channels.push_back(std::make_shared>( + std::make_shared(), 0)); + auto const& d = wrapper.SetDrainingChannels(draining_channels); + + wrapper.RemoveChannels(); + EXPECT_THAT(d, IsEmpty()); + + fake_cq_impl_->SimulateCompletion(false); +} + +TEST_F(DynamicChannelPoolTest, RemoveChannelsSomeChannelsDrained) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + + std::vector>> channels; + DynamicChannelPoolSizingPolicy sizing_policy; + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + + // Pool creation should set the pool size increase cooldown timer. + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return make_ready_future(StatusOr(std::chrono::system_clock::now())); + }); + + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + + std::vector>> draining_channels; + draining_channels.push_back(std::make_shared>( + std::make_shared(), 1)); + draining_channels.push_back(std::make_shared>( + std::make_shared(), 0)); + draining_channels.push_back(std::make_shared>( + std::make_shared(), 0)); + draining_channels.push_back(std::make_shared>( + std::make_shared(), 2)); + auto const& d = wrapper.SetDrainingChannels(draining_channels); + + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.remove_channel_polling_interval) + .count())); + // Set a timer that will NOT finish before it is cancelled by the test. + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }); + + wrapper.RemoveChannels(); + ASSERT_THAT(d.size(), Eq(2)); + EXPECT_THAT(d[0]->instant_outstanding_rpcs(), testing_util::IsOkAndHolds(2)); + EXPECT_THAT(d[1]->instant_outstanding_rpcs(), testing_util::IsOkAndHolds(1)); + + fake_cq_impl_->SimulateCompletion(false); +} + +TEST_F(DynamicChannelPoolTest, HandleBadChannelsTwoChannelsOneBad) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + std::vector>> channels; + DynamicChannelPoolSizingPolicy sizing_policy; + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + // Pool creation should set the pool size increase cooldown timer. + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }) + // HandleBadChannels will call ScheduleRemoveChannels. + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.remove_channel_polling_interval) + .count())); + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }); + + channels.push_back(std::make_shared>( + std::make_shared(), 0, + internal::InternalError("bad channel"))); + + auto mock_stub = std::make_shared(); + EXPECT_CALL(*mock_stub, CheckAndMutateRow) + .WillOnce([](grpc::ClientContext&, Options const&, + google::bigtable::v2::CheckAndMutateRowRequest const&) { + google::bigtable::v2::CheckAndMutateRowResponse response; + response.set_predicate_matched(true); + return response; + }); + + channels.push_back( + std::make_shared>(mock_stub, 1)); + + DynamicChannelPoolTestWrapper::ChannelSelectionData data; + for (auto iter = channels.begin(); iter != channels.end(); ++iter) { + data.iterators.push_back(iter); + } + data.shuffle_iter = data.iterators.begin(); + data.channel_1_iter = *data.shuffle_iter; + data.channel_1_rpcs = (*data.channel_1_iter)->instant_outstanding_rpcs(); + ++data.shuffle_iter; + data.channel_2_iter = *data.shuffle_iter; + data.channel_2_rpcs = (*data.channel_2_iter)->instant_outstanding_rpcs(); + + sizing_policy.minimum_channel_pool_size = 2; + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + auto draining_channels = wrapper.SetDrainingChannels({}); + + std::shared_ptr> selected_stub; + { + auto lock = wrapper.CreateLock(); + selected_stub = wrapper.HandleBadChannels(lock, data); + } + EXPECT_THAT(draining_channels, IsEmpty()); + + grpc::ClientContext context; + auto response = + selected_stub->AcquireStub()->CheckAndMutateRow(context, {}, {}); + ASSERT_STATUS_OK(response); + EXPECT_TRUE(response->predicate_matched()); + EXPECT_THAT(pool->size(), Eq(1)); + + fake_cq_impl_->SimulateCompletion(false); +} + +TEST_F(DynamicChannelPoolTest, HandleBadChannelsTwoChannelsOtherOneBad) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + std::vector>> channels; + DynamicChannelPoolSizingPolicy sizing_policy; + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + // Pool creation should set the pool size increase cooldown timer. + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }) + // HandleBadChannels will call ScheduleRemoveChannels. + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.remove_channel_polling_interval) + .count())); + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }); + + auto mock_stub = std::make_shared(); + EXPECT_CALL(*mock_stub, CheckAndMutateRow) + .WillOnce([](grpc::ClientContext&, Options const&, + google::bigtable::v2::CheckAndMutateRowRequest const&) { + google::bigtable::v2::CheckAndMutateRowResponse response; + response.set_predicate_matched(true); + return response; + }); + channels.push_back( + std::make_shared>(mock_stub, 1)); + channels.push_back(std::make_shared>( + std::make_shared(), 0, + internal::InternalError("bad channel"))); + + DynamicChannelPoolTestWrapper::ChannelSelectionData data; + for (auto iter = channels.begin(); iter != channels.end(); ++iter) { + data.iterators.push_back(iter); + } + data.shuffle_iter = data.iterators.begin(); + data.channel_1_iter = *data.shuffle_iter; + data.channel_1_rpcs = (*data.channel_1_iter)->instant_outstanding_rpcs(); + ++data.shuffle_iter; + data.channel_2_iter = *data.shuffle_iter; + data.channel_2_rpcs = (*data.channel_2_iter)->instant_outstanding_rpcs(); + + sizing_policy.minimum_channel_pool_size = 2; + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + auto draining_channels = wrapper.SetDrainingChannels({}); + + std::shared_ptr> selected_stub; + { + auto lock = wrapper.CreateLock(); + selected_stub = wrapper.HandleBadChannels(lock, data); + } + EXPECT_THAT(draining_channels, IsEmpty()); + + grpc::ClientContext context; + auto response = + selected_stub->AcquireStub()->CheckAndMutateRow(context, {}, {}); + ASSERT_STATUS_OK(response); + EXPECT_TRUE(response->predicate_matched()); + EXPECT_THAT(pool->size(), Eq(1)); + + fake_cq_impl_->SimulateCompletion(false); +} + +TEST_F(DynamicChannelPoolTest, HandleBadChannelsThreeChannelsOneBad) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + std::vector>> channels; + DynamicChannelPoolSizingPolicy sizing_policy; + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + // Pool creation should set the pool size increase cooldown timer. + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }) + // HandleBadChannels will call ScheduleRemoveChannels. + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.remove_channel_polling_interval) + .count())); + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }); + + auto mock_stub_0 = std::make_shared(); + EXPECT_CALL(*mock_stub_0, CheckAndMutateRow) + .WillOnce([](grpc::ClientContext&, Options const&, + google::bigtable::v2::CheckAndMutateRowRequest const&) { + google::bigtable::v2::CheckAndMutateRowResponse response; + response.set_predicate_matched(true); + return response; + }); + channels.push_back( + std::make_shared>(mock_stub_0, 1)); + + channels.push_back(std::make_shared>( + std::make_shared(), 0, + internal::InternalError("bad channel"))); + + auto mock_stub_1 = std::make_shared(); + EXPECT_CALL(*mock_stub_1, CheckAndMutateRow).Times(0); + channels.push_back( + std::make_shared>(mock_stub_1, 2)); + + DynamicChannelPoolTestWrapper::ChannelSelectionData data; + for (auto iter = channels.begin(); iter != channels.end(); ++iter) { + data.iterators.push_back(iter); + } + data.shuffle_iter = data.iterators.begin(); + data.channel_1_iter = *data.shuffle_iter; + data.channel_1_rpcs = (*data.channel_1_iter)->instant_outstanding_rpcs(); + ++data.shuffle_iter; + data.channel_2_iter = *data.shuffle_iter; + data.channel_2_rpcs = (*data.channel_2_iter)->instant_outstanding_rpcs(); + + sizing_policy.minimum_channel_pool_size = 2; + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + auto draining_channels = wrapper.SetDrainingChannels({}); + + std::shared_ptr> selected_stub; + { + auto lock = wrapper.CreateLock(); + selected_stub = wrapper.HandleBadChannels(lock, data); + } + EXPECT_THAT(draining_channels, IsEmpty()); + + grpc::ClientContext context; + auto response = + selected_stub->AcquireStub()->CheckAndMutateRow(context, {}, {}); + ASSERT_STATUS_OK(response); + EXPECT_TRUE(response->predicate_matched()); + EXPECT_THAT(pool->size(), Eq(2)); + + fake_cq_impl_->SimulateCompletion(false); +} + +TEST_F(DynamicChannelPoolTest, HandleBadChannelsAllChannelsBad) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + std::vector>> channels; + DynamicChannelPoolSizingPolicy sizing_policy; + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + // Pool creation should set the pool size increase cooldown timer. + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }) + // HandleBadChannels will call ScheduleRemoveChannels. + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.remove_channel_polling_interval) + .count())); + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }); + + auto mock_stub = std::make_shared(); + EXPECT_CALL(*mock_stub, CheckAndMutateRow) + .WillOnce([](grpc::ClientContext&, Options const&, + google::bigtable::v2::CheckAndMutateRowRequest const&) { + google::bigtable::v2::CheckAndMutateRowResponse response; + response.set_predicate_matched(true); + return response; + }); + + EXPECT_CALL(stub_factory_fn, Call) + .WillOnce( + [&](std::uint32_t id, std::string const&, StubManager::Priming p) { + EXPECT_THAT(id, Eq(4)); + EXPECT_THAT(p, Eq(StubManager::Priming::kNoPriming)); + return std::make_shared>(mock_stub); + }); + + channels.push_back(std::make_shared>( + std::make_shared(), 0, + internal::InternalError("bad channel 0"))); + channels.push_back(std::make_shared>( + std::make_shared(), 0, + internal::InternalError("bad channel 1"))); + channels.push_back(std::make_shared>( + std::make_shared(), 0, + internal::InternalError("bad channel 2"))); + channels.push_back(std::make_shared>( + std::make_shared(), 0, + internal::InternalError("bad channel 3"))); + + DynamicChannelPoolTestWrapper::ChannelSelectionData data; + for (auto iter = channels.begin(); iter != channels.end(); ++iter) { + data.iterators.push_back(iter); + } + data.shuffle_iter = data.iterators.begin(); + data.channel_1_iter = *data.shuffle_iter; + data.channel_1_rpcs = (*data.channel_1_iter)->instant_outstanding_rpcs(); + ++data.shuffle_iter; + data.channel_2_iter = *data.shuffle_iter; + data.channel_2_rpcs = (*data.channel_2_iter)->instant_outstanding_rpcs(); + + sizing_policy.minimum_channel_pool_size = 2; + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + auto draining_channels = wrapper.SetDrainingChannels({}); + + std::shared_ptr> selected_stub; + { + auto lock = wrapper.CreateLock(); + selected_stub = wrapper.HandleBadChannels(lock, data); + } + EXPECT_THAT(draining_channels, IsEmpty()); + + grpc::ClientContext context; + auto response = + selected_stub->AcquireStub()->CheckAndMutateRow(context, {}, {}); + ASSERT_STATUS_OK(response); + EXPECT_TRUE(response->predicate_matched()); + EXPECT_THAT(pool->size(), Eq(1)); + + fake_cq_impl_->SimulateCompletion(false); +} + +TEST_F(DynamicChannelPoolTest, CheckChannelPoolHealthNeedsIncrease) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + std::vector>> channels; + DynamicChannelPoolSizingPolicy sizing_policy; + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + // Pool creation should set the pool size increase cooldown timer. + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }) + // Pool creation should set the pool size increase cooldown timer. + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }); + + channels.push_back(std::make_shared>( + std::make_shared(), 30)); + + { + sizing_policy.minimum_channel_pool_size = 1; + sizing_policy.maximum_channel_pool_size = 1; + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + + // ScheduleAddChannels will NOT be called as the pool has max channels. + EXPECT_CALL(*mock_cq_impl_, RunAsync).Times(0); + auto lock = wrapper.CreateLock(); + wrapper.CheckPoolChannelHealth(lock); + EXPECT_THAT(wrapper.num_pending_channels(), Eq(0)); + } + { + sizing_policy.minimum_channel_pool_size = 2; + sizing_policy.maximum_channel_pool_size = 10; + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + + // ScheduleAddChannels will be called. + EXPECT_CALL(*mock_cq_impl_, RunAsync).Times(1); + auto lock = wrapper.CreateLock(); + wrapper.CheckPoolChannelHealth(lock); + EXPECT_THAT(wrapper.num_pending_channels(), Eq(1)); + } +} + +TEST_F(DynamicChannelPoolTest, CheckChannelPoolHealthNeedsDecrease) { + auto instance_name = + bigtable::InstanceResource(Project("my-project"), "my-instance") + .FullName(); + auto refresh_state = std::make_shared( + fake_cq_impl_, std::chrono::milliseconds(1), + std::chrono::milliseconds(10)); + std::vector>> channels; + DynamicChannelPoolSizingPolicy sizing_policy; + + MockFunction>>( + std::uint32_t, std::string const&, StubManager::Priming)> + stub_factory_fn; + + EXPECT_CALL(*mock_cq_impl_, MakeRelativeTimer) + // Pool creation should set the pool size increase cooldown timer. + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return make_ready_future(StatusOr(std::chrono::system_clock::now())); + }) + // ScheduleRemoveChannels should start polling. + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.remove_channel_polling_interval) + .count())); + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }) + // ScheduleRemoveChannels should set the pool size increase cooldown + // timer. + .WillOnce([&](std::chrono::nanoseconds ns) { + EXPECT_THAT(ns.count(), + Eq(std::chrono::nanoseconds( + sizing_policy.pool_size_decrease_cooldown_interval) + .count())); + return cq_.MakeRelativeTimer(std::chrono::seconds(600)); + }); + + channels.push_back(std::make_shared>( + std::make_shared(), 2)); + channels.push_back(std::make_shared>( + std::make_shared(), 2)); + channels.push_back(std::make_shared>( + std::make_shared(), 2)); + channels.push_back(std::make_shared>( + std::make_shared(), 2)); + + sizing_policy.minimum_channel_pool_size = 2; + sizing_policy.maximum_channel_pool_size = 10; + sizing_policy.minimum_average_outstanding_rpcs_per_channel = 5; + auto pool = DynamicChannelPool::Create( + instance_name, CompletionQueue(mock_cq_impl_), channels, refresh_state, + stub_factory_fn.AsStdFunction(), sizing_policy); + DynamicChannelPoolTestWrapper wrapper(pool); + + // ScheduleAddChannels will NOT be called. + EXPECT_CALL(*mock_cq_impl_, RunAsync).Times(0); + + { + auto lock = wrapper.CreateLock(); + wrapper.CheckPoolChannelHealth(lock); + } + + EXPECT_THAT(wrapper.num_pending_channels(), Eq(0)); + EXPECT_THAT(pool->size(), Eq(3)); +} + +} // namespace +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/bigtable/internal/stub_manager.cc b/google/cloud/bigtable/internal/stub_manager.cc new file mode 100644 index 0000000000000..9cfa7832d4652 --- /dev/null +++ b/google/cloud/bigtable/internal/stub_manager.cc @@ -0,0 +1,51 @@ +// Copyright 2026 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 "google/cloud/bigtable/internal/stub_manager.h" +#include + +namespace google { +namespace cloud { +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StubManager::StubManager(std::shared_ptr stub) + : stub_(std::move(stub)) {} + +StubManager::StubManager( + absl::flat_hash_map> + affinity_stubs, + StubCreationFn stub_creation_fn) + : stub_creation_fn_(std::move(stub_creation_fn)), + affinity_stubs_(std::move(affinity_stubs)) {} + +std::shared_ptr StubManager::GetStub( + std::string_view instance_name) { + if (stub_) return stub_; + + std::scoped_lock lk(mu_); + if (auto iter = affinity_stubs_.find(instance_name); + iter != affinity_stubs_.end()) { + return iter->second; + } + auto inserted = affinity_stubs_.emplace( + std::string{instance_name}, + stub_creation_fn_(instance_name, Priming::kNoPriming)); + return inserted.first->second; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/bigtable/internal/stub_manager.h b/google/cloud/bigtable/internal/stub_manager.h new file mode 100644 index 0000000000000..9a5b54c0b078f --- /dev/null +++ b/google/cloud/bigtable/internal/stub_manager.h @@ -0,0 +1,66 @@ +// Copyright 2026 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. + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_STUB_MANAGER_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_STUB_MANAGER_H + +#include "google/cloud/bigtable/internal/bigtable_stub.h" +#include "google/cloud/version.h" +#include "absl/container/flat_hash_map.h" +#include +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +// This class provides support for operating with a single BigtableStub which is +// not bound to any specific Bigtable instance, or with a collection of +// BigtableStubs of which each BigtableStub is bound to a specific instance. +class StubManager { + public: + enum class Priming { kNoPriming, kSynchronousPriming }; + + // This function must not send any RPCs as it is called while a lock is held. + // This means channels cannot be primed as part of construction, but instead + // must be scheduled to be primed asynchronously. + using StubCreationFn = std::function( + std::string_view instance_name, Priming priming)>; + + explicit StubManager(std::shared_ptr stub); + + StubManager(absl::flat_hash_map> + affinity_stubs, + StubCreationFn stub_creation_fn); + + std::shared_ptr GetStub(std::string_view instance_name); + + private: + std::mutex mu_; + StubCreationFn stub_creation_fn_; + std::shared_ptr stub_; + absl::flat_hash_map> + affinity_stubs_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_STUB_MANAGER_H diff --git a/google/cloud/bigtable/internal/stub_manager_test.cc b/google/cloud/bigtable/internal/stub_manager_test.cc new file mode 100644 index 0000000000000..97fb6562b76ef --- /dev/null +++ b/google/cloud/bigtable/internal/stub_manager_test.cc @@ -0,0 +1,128 @@ +// Copyright 2026 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 "google/cloud/bigtable/internal/stub_manager.h" +#include "google/cloud/bigtable/instance_resource.h" +#include "google/cloud/bigtable/table_resource.h" +#include "google/cloud/bigtable/testing/mock_bigtable_stub.h" +#include "google/cloud/testing_util/status_matchers.h" +#include + +namespace google { +namespace cloud { +namespace bigtable_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { + +using ::google::cloud::bigtable::testing::MockBigtableStub; +using ::google::cloud::testing_util::IsOk; +using ::testing::Eq; +using ::testing::MockFunction; +using ::testing::StartsWith; + +TEST(StubManagerTest, NoAffinity) { + bigtable::InstanceResource instance(Project("my-project"), "my-instance"); + bigtable::TableResource table(instance, "my-table"); + std::string const expected_table_name = table.FullName(); + auto mock = std::make_shared(); + EXPECT_CALL(*mock, MutateRow) + .WillOnce([&](grpc::ClientContext&, Options const&, + google::bigtable::v2::MutateRowRequest const& request) { + EXPECT_THAT(request.table_name(), Eq(expected_table_name)); + return google::bigtable::v2::MutateRowResponse{}; + }); + + StubManager manager(mock); + + auto stub = manager.GetStub({}); + grpc::ClientContext context; + google::bigtable::v2::MutateRowRequest request; + request.set_table_name(expected_table_name); + auto result = stub->MutateRow(context, {}, request); + EXPECT_THAT(result, IsOk()); +} + +TEST(StubManagerTest, AffinityToExistingInstance) { + bigtable::InstanceResource instance(Project("my-project"), "a"); + bigtable::TableResource table(instance, "my-table"); + std::string const expected_table_name = table.FullName(); + + auto mock_stub = std::make_shared(); + EXPECT_CALL(*mock_stub, MutateRow) + .WillOnce([instance_name = instance.FullName()]( + grpc::ClientContext&, Options const&, + google::bigtable::v2::MutateRowRequest const& request) { + EXPECT_THAT(request.table_name(), StartsWith(instance_name)); + return google::bigtable::v2::MutateRowResponse{}; + }); + + absl::flat_hash_map> + affinity_stubs; + affinity_stubs[instance.FullName()] = mock_stub; + + MockFunction(std::string_view, + StubManager::Priming)> + stub_creation_fn; + EXPECT_CALL(stub_creation_fn, Call).Times(0); + + StubManager manager(affinity_stubs, stub_creation_fn.AsStdFunction()); + + auto stub = manager.GetStub(instance.FullName()); + grpc::ClientContext context; + google::bigtable::v2::MutateRowRequest request; + request.set_table_name(expected_table_name); + auto result = stub->MutateRow(context, {}, request); + EXPECT_THAT(result, IsOk()); +} + +TEST(StubManagerTest, AffinityToMissingInstance) { + bigtable::InstanceResource instance_a(Project("my-project"), "a"); + bigtable::TableResource table_a(instance_a, "my-table"); + auto mock_stub_a = std::make_shared(); + EXPECT_CALL(*mock_stub_a, MutateRow).Times(0); + absl::flat_hash_map> + affinity_stubs; + affinity_stubs[instance_a.FullName()] = mock_stub_a; + + auto stub_creation_fn = [](std::string_view instance_name, + StubManager::Priming) { + auto mock_stub = std::make_shared(); + EXPECT_CALL(*mock_stub, MutateRow) + .WillOnce([instance_name = std::string{instance_name}]( + grpc::ClientContext&, Options const&, + google::bigtable::v2::MutateRowRequest const& request) { + EXPECT_THAT(request.table_name(), StartsWith(instance_name)); + return google::bigtable::v2::MutateRowResponse{}; + }); + return mock_stub; + }; + + StubManager manager(affinity_stubs, stub_creation_fn); + + bigtable::InstanceResource instance_b(Project("my-project"), "b"); + bigtable::TableResource table_b(instance_b, "my-table"); + std::string const expected_table_name = table_b.FullName(); + auto stub = manager.GetStub(instance_b.FullName()); + grpc::ClientContext context; + google::bigtable::v2::MutateRowRequest request; + request.set_table_name(expected_table_name); + auto result = stub->MutateRow(context, {}, request); + EXPECT_THAT(result, IsOk()); +} + +} // namespace +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace bigtable_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/bigtable/options.h b/google/cloud/bigtable/options.h index efc2d81ea607c..d75550400fa49 100644 --- a/google/cloud/bigtable/options.h +++ b/google/cloud/bigtable/options.h @@ -39,9 +39,9 @@ */ #include "google/cloud/bigtable/idempotent_mutation_policy.h" +#include "google/cloud/bigtable/instance_resource.h" #include "google/cloud/bigtable/internal/endpoint_options.h" #include "google/cloud/bigtable/retry_policy.h" -#include "google/cloud/bigtable/rpc_retry_policy.h" #include "google/cloud/bigtable/version.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/options.h" @@ -173,6 +173,56 @@ struct QueryPlanRefreshFunctionRetryPolicyOption { using Type = std::shared_ptr; }; +/** + * If set, a dynamic channel pool is created for each instance that requests + * are destined. Instances specified as part of this Option have dynamic + * channel pools created and primed as part of DataConnection construction. If + * no Instances are specified, then dynamic channel pool creation is deferred + * until the first request sent, increasing time to first byte latency. + * + * @note This option must be supplied to `MakeDataConnection()` in order to take + * effect. + */ +struct InstanceChannelAffinityOption { + using Type = std::vector; +}; + +/** + * If the `InstanceChannelAffinityOption` is set, then all connections will be + * managed by a Dynamic Channel Pool. The `DynamicChannelPoolSizingPolicy` can + * be provided via the `DynamicChannelPoolSizingPolicyOption` and configures + * the behavior of the `DynamicChannelPool`. + */ +struct DynamicChannelPoolSizingPolicy { + // Removing unused channels is not as performance critical as adding channels + // to handle a surge in RPC calls. Thus, there are separate cooldown settings + // for each. + std::chrono::milliseconds pool_size_decrease_cooldown_interval = + std::chrono::seconds(120); + + // If the average number of outstanding RPCs is below this threshold, + // the pool size will be decreased. + int minimum_average_outstanding_rpcs_per_channel = 1; + // If the average number of outstanding RPCs is above this threshold, + // the pool size will be increased. + int maximum_average_outstanding_rpcs_per_channel = 25; + + // When channels are removed from the pool, we have to wait until all + // outstanding RPCs on that channel are completed before destroying it. + std::chrono::milliseconds remove_channel_polling_interval = + std::chrono::seconds(30); + + // Limits how large the pool can grow. Default is twice the minimum_pool_size. + std::size_t maximum_channel_pool_size = 0; + + // This is set to the value of GrpcNumChannelsOption. + std::size_t minimum_channel_pool_size = 0; +}; + +struct DynamicChannelPoolSizingPolicyOption { + using Type = DynamicChannelPoolSizingPolicy; +}; + } // namespace experimental /// The complete list of options accepted by `bigtable::*Client` diff --git a/google/cloud/bigtable/quickstart/.bazelversion b/google/cloud/bigtable/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/bigtable/quickstart/.bazelversion +++ b/google/cloud/bigtable/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/bigtable/quickstart/MODULE.bazel b/google/cloud/bigtable/quickstart/MODULE.bazel index 769db68723a0d..e47bfb6fa8af0 100644 --- a/google/cloud/bigtable/quickstart/MODULE.bazel +++ b/google/cloud/bigtable/quickstart/MODULE.bazel @@ -17,4 +17,4 @@ module( version = "0.0.0", ) -bazel_dep(name = "google_cloud_cpp", version = "3.1.0") +bazel_dep(name = "google_cloud_cpp", version = "3.2.0") diff --git a/google/cloud/bigtable/quickstart/WORKSPACE.bazel b/google/cloud/bigtable/quickstart/WORKSPACE.bazel index 433b08fe14924..7938b488f68fc 100644 --- a/google/cloud/bigtable/quickstart/WORKSPACE.bazel +++ b/google/cloud/bigtable/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/bigtable/testing/mock_bigtable_stub.h b/google/cloud/bigtable/testing/mock_bigtable_stub.h index 752780fe83a06..8e9ea4b398e97 100644 --- a/google/cloud/bigtable/testing/mock_bigtable_stub.h +++ b/google/cloud/bigtable/testing/mock_bigtable_stub.h @@ -111,6 +111,13 @@ class MockBigtableStub : public bigtable_internal::BigtableStub { google::cloud::internal::ImmutableOptions, google::bigtable::v2::CheckAndMutateRowRequest const&), (override)); + MOCK_METHOD(future>, + AsyncPingAndWarm, + (google::cloud::CompletionQueue&, + std::shared_ptr, + google::cloud::internal::ImmutableOptions, + google::bigtable::v2::PingAndWarmRequest const&), + (override)); MOCK_METHOD( future>, AsyncReadModifyWriteRow, diff --git a/google/cloud/bigtable/testing/table_integration_test.cc b/google/cloud/bigtable/testing/table_integration_test.cc index 6a09bacf62018..d70d1346d0997 100644 --- a/google/cloud/bigtable/testing/table_integration_test.cc +++ b/google/cloud/bigtable/testing/table_integration_test.cc @@ -122,7 +122,13 @@ void TableAdminTestEnvironment::TearDown() { } void TableIntegrationTest::SetUp() { - data_connection_ = MakeDataConnection(); + Options options; + if (google::cloud::internal::GetEnv( + "GOOGLE_CLOUD_CPP_BIGTABLE_TESTING_CHANNEL_POOL") + .value_or("") == "dynamic") { + options.set({}); + } + data_connection_ = MakeDataConnection(options); // In production, we cannot use `DropAllRows()` to cleanup the table because // the integration tests sometimes consume all the 'DropRowRangeGroup' quota. diff --git a/google/cloud/bigtable/tests/BUILD.bazel b/google/cloud/bigtable/tests/BUILD.bazel index c4974a2b00849..c68ea6994fdd4 100644 --- a/google/cloud/bigtable/tests/BUILD.bazel +++ b/google/cloud/bigtable/tests/BUILD.bazel @@ -21,12 +21,19 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 +VARIATIONS = { + "default": {"GOOGLE_CLOUD_CPP_BIGTABLE_TESTING_CHANNEL_POOL": "static"}, + "dynamic-pool": {"GOOGLE_CLOUD_CPP_BIGTABLE_TESTING_CHANNEL_POOL": "dynamic"}, +} + [cc_test( - name = test.replace("/", "_").replace(".cc", ""), + name = test.replace("/", "_").replace(".cc", "") + "-" + v_label, timeout = "long", srcs = [test], + env = v_env, tags = [ "integration-test", + "integration-test-" + v_label, ], deps = [ "//:bigtable", @@ -36,7 +43,7 @@ licenses(["notice"]) # Apache 2.0 "//google/cloud/testing_util:google_cloud_cpp_testing_private", "@googletest//:gtest_main", ], -) for test in bigtable_client_integration_tests] +) for test in bigtable_client_integration_tests for v_label, v_env in VARIATIONS.items()] cc_binary( name = "instance_admin_emulator", diff --git a/google/cloud/bigtable/tests/instance_admin_integration_test.cc b/google/cloud/bigtable/tests/instance_admin_integration_test.cc index 052dd212ecfb6..bf4f0edff506c 100644 --- a/google/cloud/bigtable/tests/instance_admin_integration_test.cc +++ b/google/cloud/bigtable/tests/instance_admin_integration_test.cc @@ -123,11 +123,13 @@ TEST_F(InstanceAdminIntegrationTest, ListAllClustersTest) { auto const id_2 = RandomInstanceId(generator_); auto const name_1 = bigtable::InstanceName(project_id_, id_1); auto const name_2 = bigtable::InstanceName(project_id_, id_2); + auto location_a = Location(Project(project_id_), zone_a_); + auto location_b = Location(Project(project_id_), zone_b_); auto config_1 = IntegrationTestConfig( - id_1, zone_a_, bigtable::InstanceConfig::PRODUCTION, 3); + id_1, location_a.FullName(), bigtable::InstanceConfig::PRODUCTION, 3); auto config_2 = IntegrationTestConfig( - id_2, zone_b_, bigtable::InstanceConfig::PRODUCTION, 3); + id_2, location_b.FullName(), bigtable::InstanceConfig::PRODUCTION, 3); auto create_request_1 = config_1.as_proto(); create_request_1.set_parent(Project(project_id_).FullName()); @@ -163,7 +165,8 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteAppProfile) { auto const instance_id = RandomInstanceId(generator_); auto const instance_name = bigtable::InstanceName(project_id_, instance_id); - auto config = IntegrationTestConfig(instance_id, zone_a_, + auto location = Location(Project(project_id_), zone_a_); + auto config = IntegrationTestConfig(instance_id, location.FullName(), bigtable::InstanceConfig::PRODUCTION, 3); auto create_request = config.as_proto(); create_request.set_parent(Project(project_id_).FullName()); @@ -268,7 +271,8 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteInstanceTest) { auto const instance_name = bigtable::InstanceName(project_id_, instance_id); // Create instance - auto config = IntegrationTestConfig(instance_id, zone_a_); + auto location = Location(Project(project_id_), zone_a_); + auto config = IntegrationTestConfig(instance_id, location.FullName()); auto create_request = config.as_proto(); create_request.set_parent(Project(project_id_).FullName()); auto instance = instance_admin_->CreateInstance(create_request).get(); @@ -328,9 +332,11 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteClusterTest) { auto const cluster_id = instance_id + "-cl2"; auto const cluster_name = bigtable::ClusterName(project_id_, instance_id, cluster_id); + auto location_a = Location(Project(project_id_), zone_a_); + auto location_b = Location(Project(project_id_), zone_b_); // Create instance prerequisites for cluster operations - auto config = IntegrationTestConfig(instance_id, zone_a_, + auto config = IntegrationTestConfig(instance_id, location_a.FullName(), bigtable::InstanceConfig::PRODUCTION, 3); auto create_request = config.as_proto(); create_request.set_parent(Project(project_id_).FullName()); @@ -338,8 +344,8 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteClusterTest) { ASSERT_STATUS_OK(instance); // Create cluster - auto cluster_config = - bigtable::ClusterConfig(zone_b_, 3, bigtable::ClusterConfig::HDD); + auto cluster_config = bigtable::ClusterConfig(location_b.FullName(), 3, + bigtable::ClusterConfig::HDD); auto cluster = instance_admin_ ->CreateCluster(instance_name, cluster_id, cluster_config.as_proto()) @@ -387,8 +393,9 @@ TEST_F(InstanceAdminIntegrationTest, SetGetTestIamNativeAPIsTest) { auto const instance_id = RandomInstanceId(generator_); auto const instance_name = InstanceName(project_id_, instance_id); + auto location = Location(Project(project_id_), zone_a_); // create instance prerequisites for cluster operations - auto config = IntegrationTestConfig(instance_id, zone_a_, + auto config = IntegrationTestConfig(instance_id, location.FullName(), bigtable::InstanceConfig::PRODUCTION, 3); auto create_request = config.as_proto(); create_request.set_parent(Project(project_id_).FullName()); @@ -436,7 +443,8 @@ TEST_F(InstanceAdminIntegrationTest, auto const zone_b = Location(project.FullName(), zone_b_); // Create instance - auto config = IntegrationTestConfig(instance_id, zone_a_); + auto location = Location(Project(project_id_), zone_a_); + auto config = IntegrationTestConfig(instance_id, location.FullName()); auto create_request = config.as_proto(); create_request.set_parent(project.FullName()); auto instance = instance_admin->CreateInstance(create_request).get(); @@ -508,8 +516,9 @@ TEST_F(InstanceAdminIntegrationTest, CustomWorkers) { // CompletionQueue `cq` is not being `Run()`, so this should never finish. auto const instance_id = RandomInstanceId(generator_); + auto location = Location(Project(project_id_), zone_a_); auto create_request = - IntegrationTestConfig(instance_id, zone_a_, + IntegrationTestConfig(instance_id, location.FullName(), bigtable::InstanceConfig::PRODUCTION, 3) .as_proto(); create_request.set_parent(Project(project_id_).FullName()); diff --git a/google/cloud/bigtable/tests/table_admin_backup_integration_test.cc b/google/cloud/bigtable/tests/table_admin_backup_integration_test.cc index be2795cbfe721..2ca5ff5dbfd18 100644 --- a/google/cloud/bigtable/tests/table_admin_backup_integration_test.cc +++ b/google/cloud/bigtable/tests/table_admin_backup_integration_test.cc @@ -81,6 +81,7 @@ TEST_F(AdminBackupIntegrationTest, CreateListGetUpdateRestoreDeleteBackup) { google::bigtable::admin::v2::Backup b; *b.mutable_expire_time() = ToProtoTimestamp(expire_time); + b.set_source_table(table_name); auto backup = table_admin_ ->CreateBackup(bigtable::ClusterName( project_id(), instance_id(), cluster_id), @@ -91,7 +92,7 @@ TEST_F(AdminBackupIntegrationTest, CreateListGetUpdateRestoreDeleteBackup) { EXPECT_EQ(backup->name(), backup_name); // List backups to verify new backup has been created - auto backups = table_admin_->ListBackups(table_name); + auto backups = table_admin_->ListBackups(cluster_name); std::vector backups_list; for (auto& b : backups) { ASSERT_STATUS_OK(b); @@ -121,7 +122,7 @@ TEST_F(AdminBackupIntegrationTest, CreateListGetUpdateRestoreDeleteBackup) { IsProtoEqual(ToProtoTimestamp(expire_time))); // Delete table - EXPECT_STATUS_OK(table_admin_->DeleteTable(table_id)); + EXPECT_STATUS_OK(table_admin_->DeleteTable(table_name)); // Verify the delete google::bigtable::admin::v2::ListTablesRequest list_request; @@ -140,7 +141,7 @@ TEST_F(AdminBackupIntegrationTest, CreateListGetUpdateRestoreDeleteBackup) { restore_request.set_parent( bigtable::InstanceName(project_id(), instance_id())); restore_request.set_backup(backup_name); - restore_request.set_table_id(table_name); + restore_request.set_table_id(table_id); auto table = table_admin_->RestoreTable(restore_request).get(); EXPECT_STATUS_OK(table); diff --git a/google/cloud/bigtable/tests/table_admin_integration_test.cc b/google/cloud/bigtable/tests/table_admin_integration_test.cc index 5fcb2a86468d0..1f79a23ba4bba 100644 --- a/google/cloud/bigtable/tests/table_admin_integration_test.cc +++ b/google/cloud/bigtable/tests/table_admin_integration_test.cc @@ -18,9 +18,11 @@ #include "google/cloud/bigtable/instance_config.h" #include "google/cloud/bigtable/table_config.h" #include "google/cloud/bigtable/testing/table_integration_test.h" +#include "google/cloud/location/locations.pb.h" #include "google/cloud/common_options.h" #include "google/cloud/internal/getenv.h" #include "google/cloud/internal/random.h" +#include "google/cloud/location.h" #include "google/cloud/testing_util/chrono_literals.h" #include "google/cloud/testing_util/scoped_environment.h" #include "google/cloud/testing_util/scoped_log.h" @@ -40,6 +42,8 @@ using ::testing::HasSubstr; using ::testing::IsSupersetOf; using ::testing::Not; +using ::google::cloud::bigtable::testing::TableTestEnvironment; + namespace btadmin = ::google::bigtable::admin::v2; class TableAdminIntegrationTest @@ -252,7 +256,7 @@ TEST_F(TableAdminIntegrationTest, CreateListGetDeleteTable) { TEST_F(TableAdminIntegrationTest, WaitForConsistencyCheck) { // WaitForConsistencyCheck() only makes sense on a replicated table, we need // to create an instance with at least 2 clusters to test it. - auto const id = bigtable::testing::TableTestEnvironment::RandomInstanceId(); + auto const id = TableTestEnvironment::RandomInstanceId(); auto const random_table_id = RandomTableId(); // Create a bigtable::InstanceAdmin and a bigtable::TableAdmin to create the @@ -270,12 +274,14 @@ TEST_F(TableAdminIntegrationTest, WaitForConsistencyCheck) { // they must be in different zones. Also, the display name cannot be longer // than 30 characters. auto display_name = ("IT " + id).substr(0, 30); - auto cluster_config_1 = - bigtable::ClusterConfig(bigtable::testing::TableTestEnvironment::zone_a(), - 3, bigtable::ClusterConfig::HDD); - auto cluster_config_2 = - bigtable::ClusterConfig(bigtable::testing::TableTestEnvironment::zone_b(), - 3, bigtable::ClusterConfig::HDD); + auto location_1 = Location(Project(TableTestEnvironment::project_id()), + TableTestEnvironment::zone_a()); + auto location_2 = Location(Project(TableTestEnvironment::project_id()), + TableTestEnvironment::zone_b()); + auto cluster_config_1 = bigtable::ClusterConfig(location_1.FullName(), 3, + bigtable::ClusterConfig::HDD); + auto cluster_config_2 = bigtable::ClusterConfig(location_2.FullName(), 3, + bigtable::ClusterConfig::HDD); bigtable::InstanceConfig config( id, display_name, {{id + "-c1", cluster_config_1}, {id + "-c2", cluster_config_2}}); diff --git a/google/cloud/billing/quickstart/.bazelversion b/google/cloud/billing/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/billing/quickstart/.bazelversion +++ b/google/cloud/billing/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/billing/quickstart/WORKSPACE.bazel b/google/cloud/billing/quickstart/WORKSPACE.bazel index 9e951faf5615c..9fb24308dea8f 100644 --- a/google/cloud/billing/quickstart/WORKSPACE.bazel +++ b/google/cloud/billing/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/binaryauthorization/quickstart/.bazelversion b/google/cloud/binaryauthorization/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/binaryauthorization/quickstart/.bazelversion +++ b/google/cloud/binaryauthorization/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/binaryauthorization/quickstart/WORKSPACE.bazel b/google/cloud/binaryauthorization/quickstart/WORKSPACE.bazel index c295ab756a490..8771cce536b93 100644 --- a/google/cloud/binaryauthorization/quickstart/WORKSPACE.bazel +++ b/google/cloud/binaryauthorization/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/certificatemanager/quickstart/.bazelversion b/google/cloud/certificatemanager/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/certificatemanager/quickstart/.bazelversion +++ b/google/cloud/certificatemanager/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/certificatemanager/quickstart/WORKSPACE.bazel b/google/cloud/certificatemanager/quickstart/WORKSPACE.bazel index 069792c55ddd9..5938fe893ef07 100644 --- a/google/cloud/certificatemanager/quickstart/WORKSPACE.bazel +++ b/google/cloud/certificatemanager/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/certificatemanager/v1/certificate_manager_client.h b/google/cloud/certificatemanager/v1/certificate_manager_client.h index 3cdbc90ed13de..209f1e58b194c 100644 --- a/google/cloud/certificatemanager/v1/certificate_manager_client.h +++ b/google/cloud/certificatemanager/v1/certificate_manager_client.h @@ -3293,7 +3293,7 @@ class CertificateManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -3332,7 +3332,7 @@ class CertificateManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/ces/BUILD.bazel b/google/cloud/ces/BUILD.bazel new file mode 100644 index 0000000000000..64030d2315962 --- /dev/null +++ b/google/cloud/ces/BUILD.bazel @@ -0,0 +1,31 @@ +# Copyright 2026 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 = [ + "@googleapis//google/cloud/ces/v1:ces_cc_grpc", +] + +cc_gapic_library( + name = "ces", + googleapis_deps = googleapis_deps, + service_dirs = service_dirs, +) diff --git a/google/cloud/ces/CMakeLists.txt b/google/cloud/ces/CMakeLists.txt new file mode 100644 index 0000000000000..58fb7bc79cdee --- /dev/null +++ b/google/cloud/ces/CMakeLists.txt @@ -0,0 +1,36 @@ +# ~~~ +# Copyright 2026 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( + ces "Gemini Enterprise for Customer Experience API" SERVICE_DIRS "v1/") + +if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) + add_executable(ces_quickstart "quickstart/quickstart.cc") + target_link_libraries(ces_quickstart PRIVATE google-cloud-cpp::ces) + google_cloud_cpp_add_common_options(ces_quickstart) + add_test( + NAME ces_quickstart + COMMAND + cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" + $ GOOGLE_CLOUD_PROJECT + GOOGLE_CLOUD_CPP_TEST_REGION) + set_tests_properties( + ces_quickstart + PROPERTIES LABELS "integration-test;quickstart" PASS_REGULAR_EXPRESSION + "Permanent error.*gcloud-cpp.retry.function=ListApps") +endif () diff --git a/google/cloud/ces/README.md b/google/cloud/ces/README.md new file mode 100644 index 0000000000000..22706c2382515 --- /dev/null +++ b/google/cloud/ces/README.md @@ -0,0 +1,58 @@ +# Gemini Enterprise for Customer Experience API C++ Client Library + +This directory contains an idiomatic C++ client library for the +[Gemini Enterprise for Customer Experience API][cloud-service-docs]. + +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/ces/v1/agent_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 ces = ::google::cloud::ces_v1; + auto client = ces::AgentServiceClient(ces::MakeAgentServiceConnection()); + + for (auto r : client.ListApps(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 + [Gemini Enterprise for Customer Experience 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://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps +[doxygen-link]: https://cloud.google.com/cpp/docs/reference/ces/latest/ +[source-link]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/ces diff --git a/google/cloud/ces/doc/environment-variables.dox b/google/cloud/ces/doc/environment-variables.dox new file mode 100644 index 0000000000000..dabca87b6c348 --- /dev/null +++ b/google/cloud/ces/doc/environment-variables.dox @@ -0,0 +1,61 @@ +/*! +@page ces-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 ces-env-endpoint Endpoint Overrides + + + +- `GOOGLE_CLOUD_CPP_AGENT_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "ces.googleapis.com") + used by `MakeAgentServiceConnection()`. + +- `GOOGLE_CLOUD_CPP_SESSION_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "ces.googleapis.com") + used by `MakeSessionServiceConnection()`. + +- `GOOGLE_CLOUD_CPP_TOOL_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "ces.googleapis.com") + used by `MakeToolServiceConnection()`. + +- `GOOGLE_CLOUD_CPP_WIDGET_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "ces.googleapis.com") + used by `MakeWidgetServiceConnection()`. + + + +@see google::cloud::EndpointOption + +@section ces-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 ces-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/ces/doc/main.dox b/google/cloud/ces/doc/main.dox new file mode 100644 index 0000000000000..edda9ef02d7f2 --- /dev/null +++ b/google/cloud/ces/doc/main.dox @@ -0,0 +1,56 @@ +/*! + +@mainpage Gemini Enterprise for Customer Experience API C++ Client Library + +An idiomatic C++ client library for the [Gemini Enterprise for Customer Experience API][cloud-service-docs]. + + + +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/ces/quickstart/` directory, +which should give you a taste of the Gemini Enterprise for Customer Experience API C++ client library API. + +@snippet quickstart.cc all + +## Main classes + + +This library offers multiple `*Client` classes, which are listed below. Each one +of these classes exposes all the RPCs for a service as member functions of the +class. This library groups multiple services because they are part of the same +product or are often used together. A typical example may be the administrative +and data plane operations for a single product. + +The library also has other classes that provide helpers, configuration +parameters, and infrastructure to mock the `*Client` classes when testing your +application. + +- [\c ces_v1::AgentServiceClient](@ref google::cloud::ces_v1::AgentServiceClient) +- [\c ces_v1::SessionServiceClient](@ref google::cloud::ces_v1::SessionServiceClient) +- [\c ces_v1::ToolServiceClient](@ref google::cloud::ces_v1::ToolServiceClient) +- [\c ces_v1::WidgetServiceClient](@ref google::cloud::ces_v1::WidgetServiceClient) + + +## More Information + +- @ref common-error-handling - describes how the library reports errors. +- @ref ces-override-endpoint - describes how to override the default + endpoint. +- @ref ces-override-authentication - describes how to change the + authentication credentials used by the library. +- @ref ces-override-retry - describes how to change the default retry + policies. +- @ref ces-env - describes environment variables that can configure the + behavior of the library. +- @ref ces-override-universe-domain - describes how to override the default universe domain. + +[cloud-service-docs]: https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps + +*/ diff --git a/google/cloud/ces/doc/options.dox b/google/cloud/ces/doc/options.dox new file mode 100644 index 0000000000000..86dc0ecaf31ab --- /dev/null +++ b/google/cloud/ces/doc/options.dox @@ -0,0 +1,10 @@ +/*! +@defgroup google-cloud-ces-options Gemini Enterprise for Customer Experience 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/ces/doc/override-authentication.dox b/google/cloud/ces/doc/override-authentication.dox new file mode 100644 index 0000000000000..c966661a1ed76 --- /dev/null +++ b/google/cloud/ces/doc/override-authentication.dox @@ -0,0 +1,60 @@ +/*! +@page ces-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 agent_client_samples.cc with-service-account + +Follow these links to find examples for other \c *Client classes: + +- [\c ces_v1::AgentServiceClient](@ref ces_v1::AgentServiceClient-service-account-snippet) +- [\c ces_v1::SessionServiceClient](@ref ces_v1::SessionServiceClient-service-account-snippet) +- [\c ces_v1::ToolServiceClient](@ref ces_v1::ToolServiceClient-service-account-snippet) +- [\c ces_v1::WidgetServiceClient](@ref ces_v1::WidgetServiceClient-service-account-snippet) + + + +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 ces_v1::AgentServiceClient-service-account-snippet Override ces_v1::AgentServiceClient Authentication Defaults + +@snippet google/cloud/ces/v1/samples/agent_client_samples.cc with-service-account + +*/ + +/*! @page ces_v1::SessionServiceClient-service-account-snippet Override ces_v1::SessionServiceClient Authentication Defaults + +@snippet google/cloud/ces/v1/samples/session_client_samples.cc with-service-account + +*/ + +/*! @page ces_v1::ToolServiceClient-service-account-snippet Override ces_v1::ToolServiceClient Authentication Defaults + +@snippet google/cloud/ces/v1/samples/tool_client_samples.cc with-service-account + +*/ + +/*! @page ces_v1::WidgetServiceClient-service-account-snippet Override ces_v1::WidgetServiceClient Authentication Defaults + +@snippet google/cloud/ces/v1/samples/widget_client_samples.cc with-service-account + +*/ +// diff --git a/google/cloud/ces/doc/override-endpoint.dox b/google/cloud/ces/doc/override-endpoint.dox new file mode 100644 index 0000000000000..818fb9eeb73b8 --- /dev/null +++ b/google/cloud/ces/doc/override-endpoint.dox @@ -0,0 +1,50 @@ +/*! +@page ces-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 `ces_v1::AgentServiceClient`: + +@snippet agent_client_samples.cc set-client-endpoint + +Follow these links to find examples for other \c *Client classes: + +- [\c ces_v1::AgentServiceClient](@ref ces_v1::AgentServiceClient-endpoint-snippet) +- [\c ces_v1::SessionServiceClient](@ref ces_v1::SessionServiceClient-endpoint-snippet) +- [\c ces_v1::ToolServiceClient](@ref ces_v1::ToolServiceClient-endpoint-snippet) +- [\c ces_v1::WidgetServiceClient](@ref ces_v1::WidgetServiceClient-endpoint-snippet) + + + +*/ + +// + +/*! @page ces_v1::AgentServiceClient-endpoint-snippet Override ces_v1::AgentServiceClient Endpoint Configuration + +@snippet google/cloud/ces/v1/samples/agent_client_samples.cc set-client-endpoint + +*/ + +/*! @page ces_v1::SessionServiceClient-endpoint-snippet Override ces_v1::SessionServiceClient Endpoint Configuration + +@snippet google/cloud/ces/v1/samples/session_client_samples.cc set-client-endpoint + +*/ + +/*! @page ces_v1::ToolServiceClient-endpoint-snippet Override ces_v1::ToolServiceClient Endpoint Configuration + +@snippet google/cloud/ces/v1/samples/tool_client_samples.cc set-client-endpoint + +*/ + +/*! @page ces_v1::WidgetServiceClient-endpoint-snippet Override ces_v1::WidgetServiceClient Endpoint Configuration + +@snippet google/cloud/ces/v1/samples/widget_client_samples.cc set-client-endpoint + +*/ +// diff --git a/google/cloud/ces/doc/override-retry-policies.dox b/google/cloud/ces/doc/override-retry-policies.dox new file mode 100644 index 0000000000000..5e15b48437254 --- /dev/null +++ b/google/cloud/ces/doc/override-retry-policies.dox @@ -0,0 +1,151 @@ +/*! +@page ces-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 ces-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 ces-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 ces-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 ces-override-retry-example Example + + +For example, this will override the retry policies for `ces_v1::AgentServiceClient`: + +@snippet agent_client_samples.cc set-retry-policy + +This assumes you have created a custom idempotency policy. Such as: + +@snippet agent_client_samples.cc custom-idempotency-policy + +This will override the polling policies for `ces_v1::AgentServiceClient` + +@snippet agent_client_samples.cc set-polling-policy + + +Follow these links to find examples for other \c *Client classes: + +- [\c ces_v1::AgentServiceClient](@ref ces_v1::AgentServiceClient-retry-snippet) +- [\c ces_v1::SessionServiceClient](@ref ces_v1::SessionServiceClient-retry-snippet) +- [\c ces_v1::ToolServiceClient](@ref ces_v1::ToolServiceClient-retry-snippet) +- [\c ces_v1::WidgetServiceClient](@ref ces_v1::WidgetServiceClient-retry-snippet) + + + +@section ces-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 ces_v1::AgentServiceClient-retry-snippet Override ces_v1::AgentServiceClient Retry Policies + +This shows how to override the retry policies for ces_v1::AgentServiceClient: + +@snippet google/cloud/ces/v1/samples/agent_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/ces/v1/samples/agent_client_samples.cc custom-idempotency-policy + +*/ + +/*! @page ces_v1::SessionServiceClient-retry-snippet Override ces_v1::SessionServiceClient Retry Policies + +This shows how to override the retry policies for ces_v1::SessionServiceClient: + +@snippet google/cloud/ces/v1/samples/session_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/ces/v1/samples/session_client_samples.cc custom-idempotency-policy + +*/ + +/*! @page ces_v1::ToolServiceClient-retry-snippet Override ces_v1::ToolServiceClient Retry Policies + +This shows how to override the retry policies for ces_v1::ToolServiceClient: + +@snippet google/cloud/ces/v1/samples/tool_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/ces/v1/samples/tool_client_samples.cc custom-idempotency-policy + +*/ + +/*! @page ces_v1::WidgetServiceClient-retry-snippet Override ces_v1::WidgetServiceClient Retry Policies + +This shows how to override the retry policies for ces_v1::WidgetServiceClient: + +@snippet google/cloud/ces/v1/samples/widget_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/ces/v1/samples/widget_client_samples.cc custom-idempotency-policy + +*/ +// diff --git a/google/cloud/ces/doc/override-universe-domain.dox b/google/cloud/ces/doc/override-universe-domain.dox new file mode 100644 index 0000000000000..5ff301d359767 --- /dev/null +++ b/google/cloud/ces/doc/override-universe-domain.dox @@ -0,0 +1,49 @@ +/*! +@page ces-override-universe-domain How to Override the Default Universe Domain + +In some cases, you may need to override the default universe domain used by the +client library. Use `AddUniverseDomainOption` when initializing the client +library to change this default. + + +For example, this will override the default universe domain for `ces_v1::AgentServiceClient`: + +@snippet agent_client_samples.cc set-client-universe-domain + +Follow these links to find examples for other \c *Client classes: + +- [\c ces_v1::AgentServiceClient](@ref ces_v1::AgentServiceClient-universe-domain-snippet) +- [\c ces_v1::SessionServiceClient](@ref ces_v1::SessionServiceClient-universe-domain-snippet) +- [\c ces_v1::ToolServiceClient](@ref ces_v1::ToolServiceClient-universe-domain-snippet) +- [\c ces_v1::WidgetServiceClient](@ref ces_v1::WidgetServiceClient-universe-domain-snippet) + + + +*/ + +// + +/*! @page ces_v1::AgentServiceClient-universe-domain-snippet Override ces_v1::AgentServiceClient Universe Domain + +@snippet google/cloud/ces/v1/samples/agent_client_samples.cc set-client-universe-domain + +*/ + +/*! @page ces_v1::SessionServiceClient-universe-domain-snippet Override ces_v1::SessionServiceClient Universe Domain + +@snippet google/cloud/ces/v1/samples/session_client_samples.cc set-client-universe-domain + +*/ + +/*! @page ces_v1::ToolServiceClient-universe-domain-snippet Override ces_v1::ToolServiceClient Universe Domain + +@snippet google/cloud/ces/v1/samples/tool_client_samples.cc set-client-universe-domain + +*/ + +/*! @page ces_v1::WidgetServiceClient-universe-domain-snippet Override ces_v1::WidgetServiceClient Universe Domain + +@snippet google/cloud/ces/v1/samples/widget_client_samples.cc set-client-universe-domain + +*/ +// diff --git a/google/cloud/ces/quickstart/.bazelrc b/google/cloud/ces/quickstart/.bazelrc new file mode 100644 index 0000000000000..c884db46c2b4d --- /dev/null +++ b/google/cloud/ces/quickstart/.bazelrc @@ -0,0 +1,30 @@ +# Copyright 2026 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/ces/quickstart/BUILD.bazel b/google/cloud/ces/quickstart/BUILD.bazel new file mode 100644 index 0000000000000..b2dff227bed3b --- /dev/null +++ b/google/cloud/ces/quickstart/BUILD.bazel @@ -0,0 +1,25 @@ +# Copyright 2026 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//:ces", + ], +) diff --git a/google/cloud/ces/quickstart/CMakeLists.txt b/google/cloud/ces/quickstart/CMakeLists.txt new file mode 100644 index 0000000000000..a7e65582e2519 --- /dev/null +++ b/google/cloud/ces/quickstart/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright 2026 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 Gemini Enterprise for Customer Experience API +# C++ client library from a larger CMake project. + +cmake_minimum_required(VERSION 3.22...3.31) +project(google-cloud-cpp-ces-quickstart CXX) + +find_package(google_cloud_cpp_ces 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::ces) diff --git a/google/cloud/ces/quickstart/Makefile b/google/cloud/ces/quickstart/Makefile new file mode 100644 index 0000000000000..25de5e91ee8c4 --- /dev/null +++ b/google/cloud/ces/quickstart/Makefile @@ -0,0 +1,35 @@ +# Copyright 2026 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 Gemini Enterprise for Customer Experience 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 Gemini Enterprise for Customer Experience API C++ +# client library. +CLIENT_MODULE := google_cloud_cpp_ces +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/ces/quickstart/README.md b/google/cloud/ces/quickstart/README.md new file mode 100644 index 0000000000000..dbabddbe94053 --- /dev/null +++ b/google/cloud/ces/quickstart/README.md @@ -0,0 +1,137 @@ +# HOWTO: using the Gemini Enterprise for Customer Experience API C++ client in your project + +This directory contains small examples showing how to use the Gemini Enterprise +for Customer Experience 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, Gemini Enterprise for Customer +Experience 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/ces/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,ces] + ``` + + 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/ces/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/ces/quickstart/WORKSPACE.bazel b/google/cloud/ces/quickstart/WORKSPACE.bazel new file mode 100644 index 0000000000000..1c53a79fa7482 --- /dev/null +++ b/google/cloud/ces/quickstart/WORKSPACE.bazel @@ -0,0 +1,53 @@ +# Copyright 2026 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 Gemini Enterprise for Customer Experience 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 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.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/ces/quickstart/quickstart.cc b/google/cloud/ces/quickstart/quickstart.cc new file mode 100644 index 0000000000000..d44947feeff5d --- /dev/null +++ b/google/cloud/ces/quickstart/quickstart.cc @@ -0,0 +1,41 @@ +// Copyright 2026 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/ces/v1/agent_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 ces = ::google::cloud::ces_v1; + auto client = ces::AgentServiceClient(ces::MakeAgentServiceConnection()); + + for (auto r : client.ListApps(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/ces/v1/.repo-metadata.json b/google/cloud/ces/v1/.repo-metadata.json new file mode 100644 index 0000000000000..1c8a196aa718b --- /dev/null +++ b/google/cloud/ces/v1/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "api_id": "ces.googleapis.com", + "api_shortname": "ces", + "client_documentation": "https://cloud.google.com/cpp/docs/reference/ces/latest", + "distribution_name": "google-cloud-cpp", + "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:1157150%20status=open", + "language": "cpp", + "library_type": "GAPIC_AUTO", + "name_pretty": "Gemini Enterprise for Customer Experience API", + "product_documentation": "https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps", + "release_level": "stable", + "repo": "googleapis/google-cloud-cpp", + "requires_billing": true +} diff --git a/google/cloud/ces/v1/agent_client.cc b/google/cloud/ces/v1/agent_client.cc new file mode 100644 index 0000000000000..615a0c041a50b --- /dev/null +++ b/google/cloud/ces/v1/agent_client.cc @@ -0,0 +1,1087 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#include "google/cloud/ces/v1/agent_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AgentServiceClient::AgentServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +AgentServiceClient::~AgentServiceClient() = default; + +StreamRange AgentServiceClient::ListApps( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ListAppsRequest request; + request.set_parent(parent); + return connection_->ListApps(request); +} + +StreamRange AgentServiceClient::ListApps( + google::cloud::ces::v1::ListAppsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListApps(std::move(request)); +} + +StatusOr AgentServiceClient::GetApp( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::GetAppRequest request; + request.set_name(name); + return connection_->GetApp(request); +} + +StatusOr AgentServiceClient::GetApp( + google::cloud::ces::v1::GetAppRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetApp(request); +} + +future> AgentServiceClient::CreateApp( + std::string const& parent, google::cloud::ces::v1::App const& app, + std::string const& app_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateAppRequest request; + request.set_parent(parent); + *request.mutable_app() = app; + request.set_app_id(app_id); + return connection_->CreateApp(request); +} + +StatusOr AgentServiceClient::CreateApp( + NoAwaitTag, std::string const& parent, + google::cloud::ces::v1::App const& app, std::string const& app_id, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateAppRequest request; + request.set_parent(parent); + *request.mutable_app() = app; + request.set_app_id(app_id); + return connection_->CreateApp(NoAwaitTag{}, request); +} + +future> AgentServiceClient::CreateApp( + std::string const& parent, google::cloud::ces::v1::App const& app, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateAppRequest request; + request.set_parent(parent); + *request.mutable_app() = app; + return connection_->CreateApp(request); +} + +StatusOr AgentServiceClient::CreateApp( + NoAwaitTag, std::string const& parent, + google::cloud::ces::v1::App const& app, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateAppRequest request; + request.set_parent(parent); + *request.mutable_app() = app; + return connection_->CreateApp(NoAwaitTag{}, request); +} + +future> AgentServiceClient::CreateApp( + google::cloud::ces::v1::CreateAppRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateApp(request); +} + +StatusOr AgentServiceClient::CreateApp( + NoAwaitTag, google::cloud::ces::v1::CreateAppRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateApp(NoAwaitTag{}, request); +} + +future> AgentServiceClient::CreateApp( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateApp(operation); +} + +StatusOr AgentServiceClient::UpdateApp( + google::cloud::ces::v1::App const& app, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::UpdateAppRequest request; + *request.mutable_app() = app; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateApp(request); +} + +StatusOr AgentServiceClient::UpdateApp( + google::cloud::ces::v1::UpdateAppRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateApp(request); +} + +future> +AgentServiceClient::DeleteApp(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::DeleteAppRequest request; + request.set_name(name); + return connection_->DeleteApp(request); +} + +StatusOr AgentServiceClient::DeleteApp( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::DeleteAppRequest request; + request.set_name(name); + return connection_->DeleteApp(NoAwaitTag{}, request); +} + +future> +AgentServiceClient::DeleteApp( + google::cloud::ces::v1::DeleteAppRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteApp(request); +} + +StatusOr AgentServiceClient::DeleteApp( + NoAwaitTag, google::cloud::ces::v1::DeleteAppRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteApp(NoAwaitTag{}, request); +} + +future> +AgentServiceClient::DeleteApp(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteApp(operation); +} + +future> +AgentServiceClient::ExportApp(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ExportAppRequest request; + request.set_name(name); + return connection_->ExportApp(request); +} + +StatusOr AgentServiceClient::ExportApp( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ExportAppRequest request; + request.set_name(name); + return connection_->ExportApp(NoAwaitTag{}, request); +} + +future> +AgentServiceClient::ExportApp( + google::cloud::ces::v1::ExportAppRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportApp(request); +} + +StatusOr AgentServiceClient::ExportApp( + NoAwaitTag, google::cloud::ces::v1::ExportAppRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportApp(NoAwaitTag{}, request); +} + +future> +AgentServiceClient::ExportApp(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportApp(operation); +} + +future> +AgentServiceClient::ImportApp(std::string const& parent, + std::string const& display_name, + std::string const& app_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ImportAppRequest request; + request.set_parent(parent); + request.set_display_name(display_name); + request.set_app_id(app_id); + return connection_->ImportApp(request); +} + +StatusOr AgentServiceClient::ImportApp( + NoAwaitTag, std::string const& parent, std::string const& display_name, + std::string const& app_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ImportAppRequest request; + request.set_parent(parent); + request.set_display_name(display_name); + request.set_app_id(app_id); + return connection_->ImportApp(NoAwaitTag{}, request); +} + +future> +AgentServiceClient::ImportApp( + google::cloud::ces::v1::ImportAppRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ImportApp(request); +} + +StatusOr AgentServiceClient::ImportApp( + NoAwaitTag, google::cloud::ces::v1::ImportAppRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ImportApp(NoAwaitTag{}, request); +} + +future> +AgentServiceClient::ImportApp(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ImportApp(operation); +} + +StreamRange AgentServiceClient::ListAgents( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ListAgentsRequest request; + request.set_parent(parent); + return connection_->ListAgents(request); +} + +StreamRange AgentServiceClient::ListAgents( + google::cloud::ces::v1::ListAgentsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListAgents(std::move(request)); +} + +StatusOr AgentServiceClient::GetAgent( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::GetAgentRequest request; + request.set_name(name); + return connection_->GetAgent(request); +} + +StatusOr AgentServiceClient::GetAgent( + google::cloud::ces::v1::GetAgentRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetAgent(request); +} + +StatusOr AgentServiceClient::CreateAgent( + std::string const& parent, google::cloud::ces::v1::Agent const& agent, + std::string const& agent_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateAgentRequest request; + request.set_parent(parent); + *request.mutable_agent() = agent; + request.set_agent_id(agent_id); + return connection_->CreateAgent(request); +} + +StatusOr AgentServiceClient::CreateAgent( + std::string const& parent, google::cloud::ces::v1::Agent const& agent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateAgentRequest request; + request.set_parent(parent); + *request.mutable_agent() = agent; + return connection_->CreateAgent(request); +} + +StatusOr AgentServiceClient::CreateAgent( + google::cloud::ces::v1::CreateAgentRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateAgent(request); +} + +StatusOr AgentServiceClient::UpdateAgent( + google::cloud::ces::v1::Agent const& agent, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::UpdateAgentRequest request; + *request.mutable_agent() = agent; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateAgent(request); +} + +StatusOr AgentServiceClient::UpdateAgent( + google::cloud::ces::v1::UpdateAgentRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateAgent(request); +} + +Status AgentServiceClient::DeleteAgent(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::DeleteAgentRequest request; + request.set_name(name); + return connection_->DeleteAgent(request); +} + +Status AgentServiceClient::DeleteAgent( + google::cloud::ces::v1::DeleteAgentRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteAgent(request); +} + +StreamRange AgentServiceClient::ListExamples( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ListExamplesRequest request; + request.set_parent(parent); + return connection_->ListExamples(request); +} + +StreamRange AgentServiceClient::ListExamples( + google::cloud::ces::v1::ListExamplesRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListExamples(std::move(request)); +} + +StatusOr AgentServiceClient::GetExample( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::GetExampleRequest request; + request.set_name(name); + return connection_->GetExample(request); +} + +StatusOr AgentServiceClient::GetExample( + google::cloud::ces::v1::GetExampleRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetExample(request); +} + +StatusOr AgentServiceClient::CreateExample( + std::string const& parent, google::cloud::ces::v1::Example const& example, + std::string const& example_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateExampleRequest request; + request.set_parent(parent); + *request.mutable_example() = example; + request.set_example_id(example_id); + return connection_->CreateExample(request); +} + +StatusOr AgentServiceClient::CreateExample( + std::string const& parent, google::cloud::ces::v1::Example const& example, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateExampleRequest request; + request.set_parent(parent); + *request.mutable_example() = example; + return connection_->CreateExample(request); +} + +StatusOr AgentServiceClient::CreateExample( + google::cloud::ces::v1::CreateExampleRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateExample(request); +} + +StatusOr AgentServiceClient::UpdateExample( + google::cloud::ces::v1::Example const& example, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::UpdateExampleRequest request; + *request.mutable_example() = example; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateExample(request); +} + +StatusOr AgentServiceClient::UpdateExample( + google::cloud::ces::v1::UpdateExampleRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateExample(request); +} + +Status AgentServiceClient::DeleteExample(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::DeleteExampleRequest request; + request.set_name(name); + return connection_->DeleteExample(request); +} + +Status AgentServiceClient::DeleteExample( + google::cloud::ces::v1::DeleteExampleRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteExample(request); +} + +StreamRange AgentServiceClient::ListTools( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ListToolsRequest request; + request.set_parent(parent); + return connection_->ListTools(request); +} + +StreamRange AgentServiceClient::ListTools( + google::cloud::ces::v1::ListToolsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListTools(std::move(request)); +} + +StatusOr AgentServiceClient::GetTool( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::GetToolRequest request; + request.set_name(name); + return connection_->GetTool(request); +} + +StatusOr AgentServiceClient::GetTool( + google::cloud::ces::v1::GetToolRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetTool(request); +} + +StreamRange +AgentServiceClient::ListConversations(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ListConversationsRequest request; + request.set_parent(parent); + return connection_->ListConversations(request); +} + +StreamRange +AgentServiceClient::ListConversations( + google::cloud::ces::v1::ListConversationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListConversations(std::move(request)); +} + +StatusOr +AgentServiceClient::GetConversation(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::GetConversationRequest request; + request.set_name(name); + return connection_->GetConversation(request); +} + +StatusOr +AgentServiceClient::GetConversation( + google::cloud::ces::v1::GetConversationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetConversation(request); +} + +Status AgentServiceClient::DeleteConversation(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::DeleteConversationRequest request; + request.set_name(name); + return connection_->DeleteConversation(request); +} + +Status AgentServiceClient::DeleteConversation( + google::cloud::ces::v1::DeleteConversationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteConversation(request); +} + +future> +AgentServiceClient::BatchDeleteConversations(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::BatchDeleteConversationsRequest request; + request.set_parent(parent); + return connection_->BatchDeleteConversations(request); +} + +StatusOr +AgentServiceClient::BatchDeleteConversations(NoAwaitTag, + std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::BatchDeleteConversationsRequest request; + request.set_parent(parent); + return connection_->BatchDeleteConversations(NoAwaitTag{}, request); +} + +future> +AgentServiceClient::BatchDeleteConversations( + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->BatchDeleteConversations(request); +} + +StatusOr +AgentServiceClient::BatchDeleteConversations( + NoAwaitTag, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->BatchDeleteConversations(NoAwaitTag{}, request); +} + +future> +AgentServiceClient::BatchDeleteConversations( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->BatchDeleteConversations(operation); +} + +StatusOr AgentServiceClient::CreateTool( + std::string const& parent, google::cloud::ces::v1::Tool const& tool, + std::string const& tool_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateToolRequest request; + request.set_parent(parent); + *request.mutable_tool() = tool; + request.set_tool_id(tool_id); + return connection_->CreateTool(request); +} + +StatusOr AgentServiceClient::CreateTool( + std::string const& parent, google::cloud::ces::v1::Tool const& tool, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateToolRequest request; + request.set_parent(parent); + *request.mutable_tool() = tool; + return connection_->CreateTool(request); +} + +StatusOr AgentServiceClient::CreateTool( + google::cloud::ces::v1::CreateToolRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateTool(request); +} + +StatusOr AgentServiceClient::UpdateTool( + google::cloud::ces::v1::Tool const& tool, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::UpdateToolRequest request; + *request.mutable_tool() = tool; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateTool(request); +} + +StatusOr AgentServiceClient::UpdateTool( + google::cloud::ces::v1::UpdateToolRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateTool(request); +} + +Status AgentServiceClient::DeleteTool(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::DeleteToolRequest request; + request.set_name(name); + return connection_->DeleteTool(request); +} + +Status AgentServiceClient::DeleteTool( + google::cloud::ces::v1::DeleteToolRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteTool(request); +} + +StreamRange +AgentServiceClient::ListGuardrails(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ListGuardrailsRequest request; + request.set_parent(parent); + return connection_->ListGuardrails(request); +} + +StreamRange +AgentServiceClient::ListGuardrails( + google::cloud::ces::v1::ListGuardrailsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListGuardrails(std::move(request)); +} + +StatusOr AgentServiceClient::GetGuardrail( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::GetGuardrailRequest request; + request.set_name(name); + return connection_->GetGuardrail(request); +} + +StatusOr AgentServiceClient::GetGuardrail( + google::cloud::ces::v1::GetGuardrailRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetGuardrail(request); +} + +StatusOr AgentServiceClient::CreateGuardrail( + std::string const& parent, + google::cloud::ces::v1::Guardrail const& guardrail, + std::string const& guardrail_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateGuardrailRequest request; + request.set_parent(parent); + *request.mutable_guardrail() = guardrail; + request.set_guardrail_id(guardrail_id); + return connection_->CreateGuardrail(request); +} + +StatusOr AgentServiceClient::CreateGuardrail( + std::string const& parent, + google::cloud::ces::v1::Guardrail const& guardrail, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateGuardrailRequest request; + request.set_parent(parent); + *request.mutable_guardrail() = guardrail; + return connection_->CreateGuardrail(request); +} + +StatusOr AgentServiceClient::CreateGuardrail( + google::cloud::ces::v1::CreateGuardrailRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateGuardrail(request); +} + +StatusOr AgentServiceClient::UpdateGuardrail( + google::cloud::ces::v1::Guardrail const& guardrail, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::UpdateGuardrailRequest request; + *request.mutable_guardrail() = guardrail; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateGuardrail(request); +} + +StatusOr AgentServiceClient::UpdateGuardrail( + google::cloud::ces::v1::UpdateGuardrailRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateGuardrail(request); +} + +Status AgentServiceClient::DeleteGuardrail(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::DeleteGuardrailRequest request; + request.set_name(name); + return connection_->DeleteGuardrail(request); +} + +Status AgentServiceClient::DeleteGuardrail( + google::cloud::ces::v1::DeleteGuardrailRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteGuardrail(request); +} + +StreamRange +AgentServiceClient::ListDeployments(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ListDeploymentsRequest request; + request.set_parent(parent); + return connection_->ListDeployments(request); +} + +StreamRange +AgentServiceClient::ListDeployments( + google::cloud::ces::v1::ListDeploymentsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListDeployments(std::move(request)); +} + +StatusOr AgentServiceClient::GetDeployment( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::GetDeploymentRequest request; + request.set_name(name); + return connection_->GetDeployment(request); +} + +StatusOr AgentServiceClient::GetDeployment( + google::cloud::ces::v1::GetDeploymentRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetDeployment(request); +} + +StatusOr +AgentServiceClient::CreateDeployment( + std::string const& parent, + google::cloud::ces::v1::Deployment const& deployment, + std::string const& deployment_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateDeploymentRequest request; + request.set_parent(parent); + *request.mutable_deployment() = deployment; + request.set_deployment_id(deployment_id); + return connection_->CreateDeployment(request); +} + +StatusOr +AgentServiceClient::CreateDeployment( + std::string const& parent, + google::cloud::ces::v1::Deployment const& deployment, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateDeploymentRequest request; + request.set_parent(parent); + *request.mutable_deployment() = deployment; + return connection_->CreateDeployment(request); +} + +StatusOr +AgentServiceClient::CreateDeployment( + google::cloud::ces::v1::CreateDeploymentRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDeployment(request); +} + +StatusOr +AgentServiceClient::UpdateDeployment( + google::cloud::ces::v1::Deployment const& deployment, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::UpdateDeploymentRequest request; + *request.mutable_deployment() = deployment; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateDeployment(request); +} + +StatusOr +AgentServiceClient::UpdateDeployment( + google::cloud::ces::v1::UpdateDeploymentRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDeployment(request); +} + +Status AgentServiceClient::DeleteDeployment(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::DeleteDeploymentRequest request; + request.set_name(name); + return connection_->DeleteDeployment(request); +} + +Status AgentServiceClient::DeleteDeployment( + google::cloud::ces::v1::DeleteDeploymentRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDeployment(request); +} + +StreamRange AgentServiceClient::ListToolsets( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ListToolsetsRequest request; + request.set_parent(parent); + return connection_->ListToolsets(request); +} + +StreamRange AgentServiceClient::ListToolsets( + google::cloud::ces::v1::ListToolsetsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListToolsets(std::move(request)); +} + +StatusOr AgentServiceClient::GetToolset( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::GetToolsetRequest request; + request.set_name(name); + return connection_->GetToolset(request); +} + +StatusOr AgentServiceClient::GetToolset( + google::cloud::ces::v1::GetToolsetRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetToolset(request); +} + +StatusOr AgentServiceClient::CreateToolset( + std::string const& parent, google::cloud::ces::v1::Toolset const& toolset, + std::string const& toolset_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateToolsetRequest request; + request.set_parent(parent); + *request.mutable_toolset() = toolset; + request.set_toolset_id(toolset_id); + return connection_->CreateToolset(request); +} + +StatusOr AgentServiceClient::CreateToolset( + std::string const& parent, google::cloud::ces::v1::Toolset const& toolset, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateToolsetRequest request; + request.set_parent(parent); + *request.mutable_toolset() = toolset; + return connection_->CreateToolset(request); +} + +StatusOr AgentServiceClient::CreateToolset( + google::cloud::ces::v1::CreateToolsetRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateToolset(request); +} + +StatusOr AgentServiceClient::UpdateToolset( + google::cloud::ces::v1::Toolset const& toolset, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::UpdateToolsetRequest request; + *request.mutable_toolset() = toolset; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateToolset(request); +} + +StatusOr AgentServiceClient::UpdateToolset( + google::cloud::ces::v1::UpdateToolsetRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateToolset(request); +} + +Status AgentServiceClient::DeleteToolset(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::DeleteToolsetRequest request; + request.set_name(name); + return connection_->DeleteToolset(request); +} + +Status AgentServiceClient::DeleteToolset( + google::cloud::ces::v1::DeleteToolsetRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteToolset(request); +} + +StreamRange +AgentServiceClient::ListAppVersions(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ListAppVersionsRequest request; + request.set_parent(parent); + return connection_->ListAppVersions(request); +} + +StreamRange +AgentServiceClient::ListAppVersions( + google::cloud::ces::v1::ListAppVersionsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListAppVersions(std::move(request)); +} + +StatusOr AgentServiceClient::GetAppVersion( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::GetAppVersionRequest request; + request.set_name(name); + return connection_->GetAppVersion(request); +} + +StatusOr AgentServiceClient::GetAppVersion( + google::cloud::ces::v1::GetAppVersionRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetAppVersion(request); +} + +StatusOr +AgentServiceClient::CreateAppVersion( + std::string const& parent, + google::cloud::ces::v1::AppVersion const& app_version, + std::string const& app_version_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateAppVersionRequest request; + request.set_parent(parent); + *request.mutable_app_version() = app_version; + request.set_app_version_id(app_version_id); + return connection_->CreateAppVersion(request); +} + +StatusOr +AgentServiceClient::CreateAppVersion( + std::string const& parent, + google::cloud::ces::v1::AppVersion const& app_version, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::CreateAppVersionRequest request; + request.set_parent(parent); + *request.mutable_app_version() = app_version; + return connection_->CreateAppVersion(request); +} + +StatusOr +AgentServiceClient::CreateAppVersion( + google::cloud::ces::v1::CreateAppVersionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateAppVersion(request); +} + +Status AgentServiceClient::DeleteAppVersion(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::DeleteAppVersionRequest request; + request.set_name(name); + return connection_->DeleteAppVersion(request); +} + +Status AgentServiceClient::DeleteAppVersion( + google::cloud::ces::v1::DeleteAppVersionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteAppVersion(request); +} + +future> +AgentServiceClient::RestoreAppVersion(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::RestoreAppVersionRequest request; + request.set_name(name); + return connection_->RestoreAppVersion(request); +} + +StatusOr AgentServiceClient::RestoreAppVersion( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::RestoreAppVersionRequest request; + request.set_name(name); + return connection_->RestoreAppVersion(NoAwaitTag{}, request); +} + +future> +AgentServiceClient::RestoreAppVersion( + google::cloud::ces::v1::RestoreAppVersionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RestoreAppVersion(request); +} + +StatusOr AgentServiceClient::RestoreAppVersion( + NoAwaitTag, google::cloud::ces::v1::RestoreAppVersionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RestoreAppVersion(NoAwaitTag{}, request); +} + +future> +AgentServiceClient::RestoreAppVersion( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RestoreAppVersion(operation); +} + +StreamRange +AgentServiceClient::ListChangelogs(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::ListChangelogsRequest request; + request.set_parent(parent); + return connection_->ListChangelogs(request); +} + +StreamRange +AgentServiceClient::ListChangelogs( + google::cloud::ces::v1::ListChangelogsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListChangelogs(std::move(request)); +} + +StatusOr AgentServiceClient::GetChangelog( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::ces::v1::GetChangelogRequest request; + request.set_name(name); + return connection_->GetChangelog(request); +} + +StatusOr AgentServiceClient::GetChangelog( + google::cloud::ces::v1::GetChangelogRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetChangelog(request); +} + +StreamRange +AgentServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr AgentServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange AgentServiceClient::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 AgentServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr AgentServiceClient::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 AgentServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status AgentServiceClient::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 AgentServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status AgentServiceClient::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 AgentServiceClient::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 ces_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/agent_client.h b/google/cloud/ces/v1/agent_client.h new file mode 100644 index 0000000000000..fe86dd21e9868 --- /dev/null +++ b/google/cloud/ces/v1/agent_client.h @@ -0,0 +1,3912 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_AGENT_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_AGENT_CLIENT_H + +#include "google/cloud/ces/v1/agent_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 "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// The service that manages agent-related resources in Gemini Enterprise for +/// Customer Engagement (CES). +/// +/// @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 AgentServiceClient { + public: + explicit AgentServiceClient( + std::shared_ptr connection, Options opts = {}); + ~AgentServiceClient(); + + ///@{ + /// @name Copy and move support + AgentServiceClient(AgentServiceClient const&) = default; + AgentServiceClient& operator=(AgentServiceClient const&) = default; + AgentServiceClient(AgentServiceClient&&) = default; + AgentServiceClient& operator=(AgentServiceClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(AgentServiceClient const& a, + AgentServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(AgentServiceClient const& a, + AgentServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Lists apps in the given project and location. + /// + /// @param parent Required. The resource name of the location to list apps from. + /// @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.ces.v1.App], 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.ces.v1.App]: @googleapis_reference_link{google/cloud/ces/v1/app.proto#L50} + /// [google.cloud.ces.v1.ListAppsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L503} + /// + // clang-format on + StreamRange ListApps(std::string const& parent, + Options opts = {}); + + // clang-format off + /// + /// Lists apps in the 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.ces.v1.ListAppsRequest]. + /// 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.ces.v1.App], 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.ces.v1.App]: @googleapis_reference_link{google/cloud/ces/v1/app.proto#L50} + /// [google.cloud.ces.v1.ListAppsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L503} + /// + // clang-format on + StreamRange ListApps( + google::cloud::ces::v1::ListAppsRequest request, Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified app. + /// + /// @param name Required. The resource name of the app to retrieve. + /// @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.ces.v1.App]) + /// 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.ces.v1.App]: @googleapis_reference_link{google/cloud/ces/v1/app.proto#L50} + /// [google.cloud.ces.v1.GetAppRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L548} + /// + // clang-format on + StatusOr GetApp(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified app. + /// + /// @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.ces.v1.GetAppRequest]. + /// 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.ces.v1.App]) + /// 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.ces.v1.App]: @googleapis_reference_link{google/cloud/ces/v1/app.proto#L50} + /// [google.cloud.ces.v1.GetAppRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L548} + /// + // clang-format on + StatusOr GetApp( + google::cloud::ces::v1::GetAppRequest const& request, Options opts = {}); + + // clang-format off + /// + /// Creates a new app in the given project and location. + /// + /// @param parent Required. The resource name of the location to create an app in. + /// @param app Required. The app to create. + /// @param app_id Optional. The ID to use for the app, which will become the final component + /// of the app's resource name. If not provided, a unique ID will be + /// automatically assigned for the app. + /// @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.ces.v1.App] 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.ces.v1.App]: @googleapis_reference_link{google/cloud/ces/v1/app.proto#L50} + /// [google.cloud.ces.v1.CreateAppRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L558} + /// + // clang-format on + future> CreateApp( + std::string const& parent, google::cloud::ces::v1::App const& app, + std::string const& app_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateApp + /// + /// 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 CreateApp( + NoAwaitTag, std::string const& parent, + google::cloud::ces::v1::App const& app, std::string const& app_id, + Options opts = {}); + + // clang-format off + /// + /// Creates a new app in the given project and location. + /// + /// @param parent Required. The resource name of the location to create an app in. + /// @param app Required. The app to create. + /// @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.ces.v1.App] 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.ces.v1.App]: @googleapis_reference_link{google/cloud/ces/v1/app.proto#L50} + /// [google.cloud.ces.v1.CreateAppRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L558} + /// + // clang-format on + future> CreateApp( + std::string const& parent, google::cloud::ces::v1::App const& app, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateApp + /// + /// 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 CreateApp( + NoAwaitTag, std::string const& parent, + google::cloud::ces::v1::App const& app, Options opts = {}); + + // clang-format off + /// + /// Creates a new app in the 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.ces.v1.CreateAppRequest]. + /// 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.ces.v1.App] 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.ces.v1.App]: @googleapis_reference_link{google/cloud/ces/v1/app.proto#L50} + /// [google.cloud.ces.v1.CreateAppRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L558} + /// + // clang-format on + future> CreateApp( + google::cloud::ces::v1::CreateAppRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateApp + /// + /// 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 CreateApp( + NoAwaitTag, google::cloud::ces::v1::CreateAppRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateApp + /// + /// 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> CreateApp( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the specified app. + /// + /// @param app Required. The app to update. + /// @param update_mask Optional. Field mask is used to control which fields get updated. If the + /// mask is not present, all fields will be updated. + /// @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.ces.v1.App]) + /// 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.ces.v1.App]: @googleapis_reference_link{google/cloud/ces/v1/app.proto#L50} + /// [google.cloud.ces.v1.UpdateAppRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L576} + /// + // clang-format on + StatusOr UpdateApp( + google::cloud::ces::v1::App const& app, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the specified app. + /// + /// @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.ces.v1.UpdateAppRequest]. + /// 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.ces.v1.App]) + /// 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.ces.v1.App]: @googleapis_reference_link{google/cloud/ces/v1/app.proto#L50} + /// [google.cloud.ces.v1.UpdateAppRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L576} + /// + // clang-format on + StatusOr UpdateApp( + google::cloud::ces::v1::UpdateAppRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes the specified app. + /// + /// @param name Required. The resource name of the app to delete. + /// @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.ces.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.ces.v1.DeleteAppRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L588} + /// [google.cloud.ces.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L859} + /// + // clang-format on + future> DeleteApp( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteApp + /// + /// 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 DeleteApp(NoAwaitTag, + std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Deletes the specified app. + /// + /// @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.ces.v1.DeleteAppRequest]. + /// 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.ces.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.ces.v1.DeleteAppRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L588} + /// [google.cloud.ces.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L859} + /// + // clang-format on + future> DeleteApp( + google::cloud::ces::v1::DeleteAppRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteApp + /// + /// 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 DeleteApp( + NoAwaitTag, google::cloud::ces::v1::DeleteAppRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteApp + /// + /// 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> DeleteApp( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Exports the specified app. + /// + /// @param name Required. The resource name of the app to export. + /// @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.ces.v1.ExportAppResponse] 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.ces.v1.ExportAppRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L604} + /// [google.cloud.ces.v1.ExportAppResponse]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L643} + /// + // clang-format on + future> ExportApp( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportApp + /// + /// 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 ExportApp(NoAwaitTag, + std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Exports the specified app. + /// + /// @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.ces.v1.ExportAppRequest]. + /// 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.ces.v1.ExportAppResponse] 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.ces.v1.ExportAppRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L604} + /// [google.cloud.ces.v1.ExportAppResponse]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L643} + /// + // clang-format on + future> ExportApp( + google::cloud::ces::v1::ExportAppRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportApp + /// + /// 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 ExportApp( + NoAwaitTag, google::cloud::ces::v1::ExportAppRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportApp + /// + /// 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> ExportApp( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Imports the specified app. + /// + /// @param parent Required. The parent resource name with the location of the app to import. + /// @param display_name Optional. The display name of the app to import. + /// * If the app is created on import, and the display name is specified, + /// the imported app will use this display name. If a conflict is detected + /// with an existing app, a timestamp will be appended to the display name + /// to make it unique. + /// * If the app is a reimport, this field should not be set. Providing a + /// display name during reimport will result in an INVALID_ARGUMENT error. + /// @param app_id Optional. The ID to use for the imported app. + /// * If not specified, a unique ID will be automatically assigned for + /// the app. + /// * Otherwise, the imported app will use this ID as the final component of + /// its resource name. If an app with the same ID already exists at the + /// specified location in the project, the content of the existing app will be + /// replaced. + /// @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.ces.v1.ImportAppResponse] 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.ces.v1.ImportAppRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L657} + /// [google.cloud.ces.v1.ImportAppResponse]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L740} + /// + // clang-format on + future> ImportApp( + std::string const& parent, std::string const& display_name, + std::string const& app_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief ImportApp + /// + /// 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 ImportApp( + NoAwaitTag, std::string const& parent, std::string const& display_name, + std::string const& app_id, Options opts = {}); + + // clang-format off + /// + /// Imports the specified app. + /// + /// @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.ces.v1.ImportAppRequest]. + /// 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.ces.v1.ImportAppResponse] 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.ces.v1.ImportAppRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L657} + /// [google.cloud.ces.v1.ImportAppResponse]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L740} + /// + // clang-format on + future> ImportApp( + google::cloud::ces::v1::ImportAppRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ImportApp + /// + /// 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 ImportApp( + NoAwaitTag, google::cloud::ces::v1::ImportAppRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ImportApp + /// + /// 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> ImportApp( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Lists agents in the given app. + /// + /// @param parent Required. The resource name of the app to list agents from. + /// @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.ces.v1.Agent], 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.ces.v1.Agent]: @googleapis_reference_link{google/cloud/ces/v1/agent.proto#L36} + /// [google.cloud.ces.v1.ListAgentsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L753} + /// + // clang-format on + StreamRange ListAgents( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists agents in the given app. + /// + /// @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.ces.v1.ListAgentsRequest]. + /// 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.ces.v1.Agent], 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.ces.v1.Agent]: @googleapis_reference_link{google/cloud/ces/v1/agent.proto#L36} + /// [google.cloud.ces.v1.ListAgentsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L753} + /// + // clang-format on + StreamRange ListAgents( + google::cloud::ces::v1::ListAgentsRequest request, Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified agent. + /// + /// @param name Required. The resource name of the agent to retrieve. + /// @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.ces.v1.Agent]) + /// 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.ces.v1.Agent]: @googleapis_reference_link{google/cloud/ces/v1/agent.proto#L36} + /// [google.cloud.ces.v1.GetAgentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L795} + /// + // clang-format on + StatusOr GetAgent(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified agent. + /// + /// @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.ces.v1.GetAgentRequest]. + /// 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.ces.v1.Agent]) + /// 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.ces.v1.Agent]: @googleapis_reference_link{google/cloud/ces/v1/agent.proto#L36} + /// [google.cloud.ces.v1.GetAgentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L795} + /// + // clang-format on + StatusOr GetAgent( + google::cloud::ces::v1::GetAgentRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new agent in the given app. + /// + /// @param parent Required. The resource name of the app to create an agent in. + /// @param agent Required. The agent to create. + /// @param agent_id Optional. The ID to use for the agent, which will become the final + /// component of the agent's resource name. If not provided, a unique ID will + /// be automatically assigned for the agent. + /// @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.ces.v1.Agent]) + /// 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.ces.v1.Agent]: @googleapis_reference_link{google/cloud/ces/v1/agent.proto#L36} + /// [google.cloud.ces.v1.CreateAgentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L805} + /// + // clang-format on + StatusOr CreateAgent( + std::string const& parent, google::cloud::ces::v1::Agent const& agent, + std::string const& agent_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new agent in the given app. + /// + /// @param parent Required. The resource name of the app to create an agent in. + /// @param agent Required. The agent to create. + /// @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.ces.v1.Agent]) + /// 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.ces.v1.Agent]: @googleapis_reference_link{google/cloud/ces/v1/agent.proto#L36} + /// [google.cloud.ces.v1.CreateAgentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L805} + /// + // clang-format on + StatusOr CreateAgent( + std::string const& parent, google::cloud::ces::v1::Agent const& agent, + Options opts = {}); + + // clang-format off + /// + /// Creates a new agent in the given app. + /// + /// @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.ces.v1.CreateAgentRequest]. + /// 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.ces.v1.Agent]) + /// 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.ces.v1.Agent]: @googleapis_reference_link{google/cloud/ces/v1/agent.proto#L36} + /// [google.cloud.ces.v1.CreateAgentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L805} + /// + // clang-format on + StatusOr CreateAgent( + google::cloud::ces::v1::CreateAgentRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates the specified agent. + /// + /// @param agent Required. The agent to update. + /// @param update_mask Optional. Field mask is used to control which fields get updated. If the + /// mask is not present, all fields will be updated. + /// @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.ces.v1.Agent]) + /// 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.ces.v1.Agent]: @googleapis_reference_link{google/cloud/ces/v1/agent.proto#L36} + /// [google.cloud.ces.v1.UpdateAgentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L823} + /// + // clang-format on + StatusOr UpdateAgent( + google::cloud::ces::v1::Agent const& agent, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the specified agent. + /// + /// @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.ces.v1.UpdateAgentRequest]. + /// 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.ces.v1.Agent]) + /// 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.ces.v1.Agent]: @googleapis_reference_link{google/cloud/ces/v1/agent.proto#L36} + /// [google.cloud.ces.v1.UpdateAgentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L823} + /// + // clang-format on + StatusOr UpdateAgent( + google::cloud::ces::v1::UpdateAgentRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes the specified agent. + /// + /// @param name Required. The resource name of the agent to delete. + /// @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.cloud.ces.v1.DeleteAgentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L835} + /// + // clang-format on + Status DeleteAgent(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes the specified agent. + /// + /// @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.ces.v1.DeleteAgentRequest]. + /// 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.cloud.ces.v1.DeleteAgentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L835} + /// + // clang-format on + Status DeleteAgent(google::cloud::ces::v1::DeleteAgentRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists examples in the given app. + /// + /// @param parent Required. The resource name of the app to list examples from. + /// @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.ces.v1.Example], 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.ces.v1.Example]: @googleapis_reference_link{google/cloud/ces/v1/example.proto#L32} + /// [google.cloud.ces.v1.ListExamplesRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L881} + /// + // clang-format on + StreamRange ListExamples( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists examples in the given app. + /// + /// @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.ces.v1.ListExamplesRequest]. + /// 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.ces.v1.Example], 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.ces.v1.Example]: @googleapis_reference_link{google/cloud/ces/v1/example.proto#L32} + /// [google.cloud.ces.v1.ListExamplesRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L881} + /// + // clang-format on + StreamRange ListExamples( + google::cloud::ces::v1::ListExamplesRequest request, Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified example. + /// + /// @param name Required. The resource name of the example to retrieve. + /// @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.ces.v1.Example]) + /// 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.ces.v1.Example]: @googleapis_reference_link{google/cloud/ces/v1/example.proto#L32} + /// [google.cloud.ces.v1.GetExampleRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L925} + /// + // clang-format on + StatusOr GetExample(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified example. + /// + /// @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.ces.v1.GetExampleRequest]. + /// 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.ces.v1.Example]) + /// 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.ces.v1.Example]: @googleapis_reference_link{google/cloud/ces/v1/example.proto#L32} + /// [google.cloud.ces.v1.GetExampleRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L925} + /// + // clang-format on + StatusOr GetExample( + google::cloud::ces::v1::GetExampleRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new example in the given app. + /// + /// @param parent Required. The resource name of the app to create an example in. + /// @param example Required. The example to create. + /// @param example_id Optional. The ID to use for the example, which will become the final + /// component of the example's resource name. If not provided, a unique ID will + /// be automatically assigned for the example. + /// @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.ces.v1.Example]) + /// 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.ces.v1.CreateExampleRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L935} + /// [google.cloud.ces.v1.Example]: @googleapis_reference_link{google/cloud/ces/v1/example.proto#L32} + /// + // clang-format on + StatusOr CreateExample( + std::string const& parent, google::cloud::ces::v1::Example const& example, + std::string const& example_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new example in the given app. + /// + /// @param parent Required. The resource name of the app to create an example in. + /// @param example Required. The example to create. + /// @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.ces.v1.Example]) + /// 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.ces.v1.CreateExampleRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L935} + /// [google.cloud.ces.v1.Example]: @googleapis_reference_link{google/cloud/ces/v1/example.proto#L32} + /// + // clang-format on + StatusOr CreateExample( + std::string const& parent, google::cloud::ces::v1::Example const& example, + Options opts = {}); + + // clang-format off + /// + /// Creates a new example in the given app. + /// + /// @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.ces.v1.CreateExampleRequest]. + /// 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.ces.v1.Example]) + /// 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.ces.v1.CreateExampleRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L935} + /// [google.cloud.ces.v1.Example]: @googleapis_reference_link{google/cloud/ces/v1/example.proto#L32} + /// + // clang-format on + StatusOr CreateExample( + google::cloud::ces::v1::CreateExampleRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates the specified example. + /// + /// @param example Required. The example to update. + /// @param update_mask Optional. Field mask is used to control which fields get updated. If the + /// mask is not present, all fields will be updated. + /// @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.ces.v1.Example]) + /// 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.ces.v1.Example]: @googleapis_reference_link{google/cloud/ces/v1/example.proto#L32} + /// [google.cloud.ces.v1.UpdateExampleRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L955} + /// + // clang-format on + StatusOr UpdateExample( + google::cloud::ces::v1::Example const& example, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the specified example. + /// + /// @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.ces.v1.UpdateExampleRequest]. + /// 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.ces.v1.Example]) + /// 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.ces.v1.Example]: @googleapis_reference_link{google/cloud/ces/v1/example.proto#L32} + /// [google.cloud.ces.v1.UpdateExampleRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L955} + /// + // clang-format on + StatusOr UpdateExample( + google::cloud::ces::v1::UpdateExampleRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes the specified example. + /// + /// @param name Required. The resource name of the example to delete. + /// @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.cloud.ces.v1.DeleteExampleRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L967} + /// + // clang-format on + Status DeleteExample(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes the specified example. + /// + /// @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.ces.v1.DeleteExampleRequest]. + /// 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.cloud.ces.v1.DeleteExampleRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L967} + /// + // clang-format on + Status DeleteExample( + google::cloud::ces::v1::DeleteExampleRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists tools in the given app. + /// + /// @param parent Required. The resource name of the app to list tools from. + /// @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.ces.v1.Tool], 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.ces.v1.ListToolsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L983} + /// [google.cloud.ces.v1.Tool]: @googleapis_reference_link{google/cloud/ces/v1/tool.proto#L43} + /// + // clang-format on + StreamRange ListTools(std::string const& parent, + Options opts = {}); + + // clang-format off + /// + /// Lists tools in the given app. + /// + /// @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.ces.v1.ListToolsRequest]. + /// 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.ces.v1.Tool], 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.ces.v1.ListToolsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L983} + /// [google.cloud.ces.v1.Tool]: @googleapis_reference_link{google/cloud/ces/v1/tool.proto#L43} + /// + // clang-format on + StreamRange ListTools( + google::cloud::ces::v1::ListToolsRequest request, Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified tool. + /// + /// @param name Required. The resource name of the tool to retrieve. + /// @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.ces.v1.Tool]) + /// 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.ces.v1.GetToolRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1025} + /// [google.cloud.ces.v1.Tool]: @googleapis_reference_link{google/cloud/ces/v1/tool.proto#L43} + /// + // clang-format on + StatusOr GetTool(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified tool. + /// + /// @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.ces.v1.GetToolRequest]. + /// 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.ces.v1.Tool]) + /// 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.ces.v1.GetToolRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1025} + /// [google.cloud.ces.v1.Tool]: @googleapis_reference_link{google/cloud/ces/v1/tool.proto#L43} + /// + // clang-format on + StatusOr GetTool( + google::cloud::ces::v1::GetToolRequest const& request, Options opts = {}); + + // clang-format off + /// + /// Lists conversations in the given app. + /// + /// @param parent Required. The resource name of the app to list conversations from. + /// @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.ces.v1.Conversation], 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.ces.v1.Conversation]: @googleapis_reference_link{google/cloud/ces/v1/conversation.proto#L31} + /// [google.cloud.ces.v1.ListConversationsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1090} + /// + // clang-format on + StreamRange ListConversations( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists conversations in the given app. + /// + /// @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.ces.v1.ListConversationsRequest]. + /// 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.ces.v1.Conversation], 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.ces.v1.Conversation]: @googleapis_reference_link{google/cloud/ces/v1/conversation.proto#L31} + /// [google.cloud.ces.v1.ListConversationsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1090} + /// + // clang-format on + StreamRange ListConversations( + google::cloud::ces::v1::ListConversationsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified conversation. + /// + /// @param name Required. The resource name of the conversation to retrieve. + /// @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.ces.v1.Conversation]) + /// 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.ces.v1.Conversation]: @googleapis_reference_link{google/cloud/ces/v1/conversation.proto#L31} + /// [google.cloud.ces.v1.GetConversationRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1139} + /// + // clang-format on + StatusOr GetConversation( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified conversation. + /// + /// @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.ces.v1.GetConversationRequest]. + /// 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.ces.v1.Conversation]) + /// 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.ces.v1.Conversation]: @googleapis_reference_link{google/cloud/ces/v1/conversation.proto#L31} + /// [google.cloud.ces.v1.GetConversationRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1139} + /// + // clang-format on + StatusOr GetConversation( + google::cloud::ces::v1::GetConversationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes the specified conversation. + /// + /// @param name Required. The resource name of the conversation to delete. + /// @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.cloud.ces.v1.DeleteConversationRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1156} + /// + // clang-format on + Status DeleteConversation(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes the specified conversation. + /// + /// @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.ces.v1.DeleteConversationRequest]. + /// 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.cloud.ces.v1.DeleteConversationRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1156} + /// + // clang-format on + Status DeleteConversation( + google::cloud::ces::v1::DeleteConversationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Batch deletes the specified conversations. + /// + /// @param parent Required. The resource name of the app to delete conversations from. + /// Format: + /// `projects/{project}/locations/{location}/apps/{app}` + /// @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.ces.v1.BatchDeleteConversationsResponse] 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.ces.v1.BatchDeleteConversationsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1173} + /// [google.cloud.ces.v1.BatchDeleteConversationsResponse]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1195} + /// + // clang-format on + future> + BatchDeleteConversations(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// @copybrief BatchDeleteConversations + /// + /// 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 BatchDeleteConversations( + NoAwaitTag, std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Batch deletes the specified conversations. + /// + /// @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.ces.v1.BatchDeleteConversationsRequest]. + /// 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.ces.v1.BatchDeleteConversationsResponse] 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.ces.v1.BatchDeleteConversationsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1173} + /// [google.cloud.ces.v1.BatchDeleteConversationsResponse]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1195} + /// + // clang-format on + future> + BatchDeleteConversations( + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief BatchDeleteConversations + /// + /// 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 BatchDeleteConversations( + NoAwaitTag, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief BatchDeleteConversations + /// + /// 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> + BatchDeleteConversations(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Creates a new tool in the given app. + /// + /// @param parent Required. The resource name of the app to create a tool in. + /// @param tool Required. The tool to create. + /// @param tool_id Optional. The ID to use for the tool, which will become the final component + /// of the tool's resource name. If not provided, a unique ID will be + /// automatically assigned for the tool. + /// @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.ces.v1.Tool]) + /// 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.ces.v1.CreateToolRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1035} + /// [google.cloud.ces.v1.Tool]: @googleapis_reference_link{google/cloud/ces/v1/tool.proto#L43} + /// + // clang-format on + StatusOr CreateTool( + std::string const& parent, google::cloud::ces::v1::Tool const& tool, + std::string const& tool_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new tool in the given app. + /// + /// @param parent Required. The resource name of the app to create a tool in. + /// @param tool Required. The tool to create. + /// @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.ces.v1.Tool]) + /// 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.ces.v1.CreateToolRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1035} + /// [google.cloud.ces.v1.Tool]: @googleapis_reference_link{google/cloud/ces/v1/tool.proto#L43} + /// + // clang-format on + StatusOr CreateTool( + std::string const& parent, google::cloud::ces::v1::Tool const& tool, + Options opts = {}); + + // clang-format off + /// + /// Creates a new tool in the given app. + /// + /// @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.ces.v1.CreateToolRequest]. + /// 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.ces.v1.Tool]) + /// 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.ces.v1.CreateToolRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1035} + /// [google.cloud.ces.v1.Tool]: @googleapis_reference_link{google/cloud/ces/v1/tool.proto#L43} + /// + // clang-format on + StatusOr CreateTool( + google::cloud::ces::v1::CreateToolRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates the specified tool. + /// + /// @param tool Required. The tool to update. + /// @param update_mask Optional. Field mask is used to control which fields get updated. If the + /// mask is not present, all fields will be updated. + /// @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.ces.v1.Tool]) + /// 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.ces.v1.Tool]: @googleapis_reference_link{google/cloud/ces/v1/tool.proto#L43} + /// [google.cloud.ces.v1.UpdateToolRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1053} + /// + // clang-format on + StatusOr UpdateTool( + google::cloud::ces::v1::Tool const& tool, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the specified tool. + /// + /// @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.ces.v1.UpdateToolRequest]. + /// 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.ces.v1.Tool]) + /// 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.ces.v1.Tool]: @googleapis_reference_link{google/cloud/ces/v1/tool.proto#L43} + /// [google.cloud.ces.v1.UpdateToolRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1053} + /// + // clang-format on + StatusOr UpdateTool( + google::cloud::ces::v1::UpdateToolRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes the specified tool. + /// + /// @param name Required. The resource name of the tool to delete. + /// @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.cloud.ces.v1.DeleteToolRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1065} + /// + // clang-format on + Status DeleteTool(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes the specified tool. + /// + /// @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.ces.v1.DeleteToolRequest]. + /// 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.cloud.ces.v1.DeleteToolRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1065} + /// + // clang-format on + Status DeleteTool(google::cloud::ces::v1::DeleteToolRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists guardrails in the given app. + /// + /// @param parent Required. The resource name of the app to list guardrails from. + /// @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.ces.v1.Guardrail], 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.ces.v1.Guardrail]: @googleapis_reference_link{google/cloud/ces/v1/guardrail.proto#L31} + /// [google.cloud.ces.v1.ListGuardrailsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1209} + /// + // clang-format on + StreamRange ListGuardrails( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists guardrails in the given app. + /// + /// @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.ces.v1.ListGuardrailsRequest]. + /// 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.ces.v1.Guardrail], 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.ces.v1.Guardrail]: @googleapis_reference_link{google/cloud/ces/v1/guardrail.proto#L31} + /// [google.cloud.ces.v1.ListGuardrailsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1209} + /// + // clang-format on + StreamRange ListGuardrails( + google::cloud::ces::v1::ListGuardrailsRequest request, Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified guardrail. + /// + /// @param name Required. The resource name of the guardrail to retrieve. + /// @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.ces.v1.Guardrail]) + /// 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.ces.v1.GetGuardrailRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1253} + /// [google.cloud.ces.v1.Guardrail]: @googleapis_reference_link{google/cloud/ces/v1/guardrail.proto#L31} + /// + // clang-format on + StatusOr GetGuardrail( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified guardrail. + /// + /// @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.ces.v1.GetGuardrailRequest]. + /// 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.ces.v1.Guardrail]) + /// 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.ces.v1.GetGuardrailRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1253} + /// [google.cloud.ces.v1.Guardrail]: @googleapis_reference_link{google/cloud/ces/v1/guardrail.proto#L31} + /// + // clang-format on + StatusOr GetGuardrail( + google::cloud::ces::v1::GetGuardrailRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new guardrail in the given app. + /// + /// @param parent Required. The resource name of the app to create a guardrail in. + /// @param guardrail Required. The guardrail to create. + /// @param guardrail_id Optional. The ID to use for the guardrail, which will become the final + /// component of the guardrail's resource name. If not provided, a unique ID + /// will be automatically assigned for the guardrail. + /// @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.ces.v1.Guardrail]) + /// 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.ces.v1.CreateGuardrailRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1263} + /// [google.cloud.ces.v1.Guardrail]: @googleapis_reference_link{google/cloud/ces/v1/guardrail.proto#L31} + /// + // clang-format on + StatusOr CreateGuardrail( + std::string const& parent, + google::cloud::ces::v1::Guardrail const& guardrail, + std::string const& guardrail_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new guardrail in the given app. + /// + /// @param parent Required. The resource name of the app to create a guardrail in. + /// @param guardrail Required. The guardrail to create. + /// @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.ces.v1.Guardrail]) + /// 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.ces.v1.CreateGuardrailRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1263} + /// [google.cloud.ces.v1.Guardrail]: @googleapis_reference_link{google/cloud/ces/v1/guardrail.proto#L31} + /// + // clang-format on + StatusOr CreateGuardrail( + std::string const& parent, + google::cloud::ces::v1::Guardrail const& guardrail, Options opts = {}); + + // clang-format off + /// + /// Creates a new guardrail in the given app. + /// + /// @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.ces.v1.CreateGuardrailRequest]. + /// 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.ces.v1.Guardrail]) + /// 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.ces.v1.CreateGuardrailRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1263} + /// [google.cloud.ces.v1.Guardrail]: @googleapis_reference_link{google/cloud/ces/v1/guardrail.proto#L31} + /// + // clang-format on + StatusOr CreateGuardrail( + google::cloud::ces::v1::CreateGuardrailRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates the specified guardrail. + /// + /// @param guardrail Required. The guardrail to update. + /// @param update_mask Optional. Field mask is used to control which fields get updated. If the + /// mask is not present, all fields will be updated. + /// @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.ces.v1.Guardrail]) + /// 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.ces.v1.Guardrail]: @googleapis_reference_link{google/cloud/ces/v1/guardrail.proto#L31} + /// [google.cloud.ces.v1.UpdateGuardrailRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1283} + /// + // clang-format on + StatusOr UpdateGuardrail( + google::cloud::ces::v1::Guardrail const& guardrail, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the specified guardrail. + /// + /// @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.ces.v1.UpdateGuardrailRequest]. + /// 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.ces.v1.Guardrail]) + /// 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.ces.v1.Guardrail]: @googleapis_reference_link{google/cloud/ces/v1/guardrail.proto#L31} + /// [google.cloud.ces.v1.UpdateGuardrailRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1283} + /// + // clang-format on + StatusOr UpdateGuardrail( + google::cloud::ces::v1::UpdateGuardrailRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes the specified guardrail. + /// + /// @param name Required. The resource name of the guardrail to delete. + /// @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.cloud.ces.v1.DeleteGuardrailRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1295} + /// + // clang-format on + Status DeleteGuardrail(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes the specified guardrail. + /// + /// @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.ces.v1.DeleteGuardrailRequest]. + /// 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.cloud.ces.v1.DeleteGuardrailRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1295} + /// + // clang-format on + Status DeleteGuardrail( + google::cloud::ces::v1::DeleteGuardrailRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists deployments in the given app. + /// + /// @param parent Required. The parent app. + /// Format: + /// `projects/{project}/locations/{location}/apps/{app}` + /// @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.ces.v1.Deployment], 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.ces.v1.Deployment]: @googleapis_reference_link{google/cloud/ces/v1/deployment.proto#L31} + /// [google.cloud.ces.v1.ListDeploymentsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1320} + /// + // clang-format on + StreamRange ListDeployments( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists deployments in the given app. + /// + /// @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.ces.v1.ListDeploymentsRequest]. + /// 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.ces.v1.Deployment], 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.ces.v1.Deployment]: @googleapis_reference_link{google/cloud/ces/v1/deployment.proto#L31} + /// [google.cloud.ces.v1.ListDeploymentsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1320} + /// + // clang-format on + StreamRange ListDeployments( + google::cloud::ces::v1::ListDeploymentsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified deployment. + /// + /// @param name Required. The name of the deployment. + /// Format: + /// `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + /// @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.ces.v1.Deployment]) + /// 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.ces.v1.Deployment]: @googleapis_reference_link{google/cloud/ces/v1/deployment.proto#L31} + /// [google.cloud.ces.v1.GetDeploymentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1362} + /// + // clang-format on + StatusOr GetDeployment( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified deployment. + /// + /// @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.ces.v1.GetDeploymentRequest]. + /// 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.ces.v1.Deployment]) + /// 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.ces.v1.Deployment]: @googleapis_reference_link{google/cloud/ces/v1/deployment.proto#L31} + /// [google.cloud.ces.v1.GetDeploymentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1362} + /// + // clang-format on + StatusOr GetDeployment( + google::cloud::ces::v1::GetDeploymentRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new deployment in the given app. + /// + /// @param parent Required. The parent app. + /// Format: + /// `projects/{project}/locations/{location}/apps/{app}` + /// @param deployment Required. The deployment to create. + /// @param deployment_id Optional. The ID to use for the deployment, which will become the final + /// component of the deployment's resource name. If not provided, a unique ID + /// will be automatically assigned for the deployment. + /// @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.ces.v1.Deployment]) + /// 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.ces.v1.CreateDeploymentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1374} + /// [google.cloud.ces.v1.Deployment]: @googleapis_reference_link{google/cloud/ces/v1/deployment.proto#L31} + /// + // clang-format on + StatusOr CreateDeployment( + std::string const& parent, + google::cloud::ces::v1::Deployment const& deployment, + std::string const& deployment_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new deployment in the given app. + /// + /// @param parent Required. The parent app. + /// Format: + /// `projects/{project}/locations/{location}/apps/{app}` + /// @param deployment Required. The deployment to create. + /// @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.ces.v1.Deployment]) + /// 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.ces.v1.CreateDeploymentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1374} + /// [google.cloud.ces.v1.Deployment]: @googleapis_reference_link{google/cloud/ces/v1/deployment.proto#L31} + /// + // clang-format on + StatusOr CreateDeployment( + std::string const& parent, + google::cloud::ces::v1::Deployment const& deployment, Options opts = {}); + + // clang-format off + /// + /// Creates a new deployment in the given app. + /// + /// @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.ces.v1.CreateDeploymentRequest]. + /// 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.ces.v1.Deployment]) + /// 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.ces.v1.CreateDeploymentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1374} + /// [google.cloud.ces.v1.Deployment]: @googleapis_reference_link{google/cloud/ces/v1/deployment.proto#L31} + /// + // clang-format on + StatusOr CreateDeployment( + google::cloud::ces::v1::CreateDeploymentRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates the specified deployment. + /// + /// @param deployment Required. The deployment to update. + /// @param update_mask Optional. The list of fields to update. + /// @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.ces.v1.Deployment]) + /// 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.ces.v1.Deployment]: @googleapis_reference_link{google/cloud/ces/v1/deployment.proto#L31} + /// [google.cloud.ces.v1.UpdateDeploymentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1396} + /// + // clang-format on + StatusOr UpdateDeployment( + google::cloud::ces::v1::Deployment const& deployment, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the specified deployment. + /// + /// @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.ces.v1.UpdateDeploymentRequest]. + /// 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.ces.v1.Deployment]) + /// 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.ces.v1.Deployment]: @googleapis_reference_link{google/cloud/ces/v1/deployment.proto#L31} + /// [google.cloud.ces.v1.UpdateDeploymentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1396} + /// + // clang-format on + StatusOr UpdateDeployment( + google::cloud::ces::v1::UpdateDeploymentRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes the specified deployment. + /// + /// @param name Required. The name of the deployment to delete. + /// Format: + /// `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}` + /// @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.cloud.ces.v1.DeleteDeploymentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1407} + /// + // clang-format on + Status DeleteDeployment(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes the specified deployment. + /// + /// @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.ces.v1.DeleteDeploymentRequest]. + /// 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.cloud.ces.v1.DeleteDeploymentRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1407} + /// + // clang-format on + Status DeleteDeployment( + google::cloud::ces::v1::DeleteDeploymentRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists toolsets in the given app. + /// + /// @param parent Required. The resource name of the app to list toolsets from. + /// @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.ces.v1.Toolset], 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.ces.v1.ListToolsetsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1424} + /// [google.cloud.ces.v1.Toolset]: @googleapis_reference_link{google/cloud/ces/v1/toolset.proto#L35} + /// + // clang-format on + StreamRange ListToolsets( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists toolsets in the given app. + /// + /// @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.ces.v1.ListToolsetsRequest]. + /// 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.ces.v1.Toolset], 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.ces.v1.ListToolsetsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1424} + /// [google.cloud.ces.v1.Toolset]: @googleapis_reference_link{google/cloud/ces/v1/toolset.proto#L35} + /// + // clang-format on + StreamRange ListToolsets( + google::cloud::ces::v1::ListToolsetsRequest request, Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified toolset. + /// + /// @param name Required. The resource name of the toolset to retrieve. + /// @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.ces.v1.Toolset]) + /// 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.ces.v1.GetToolsetRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1468} + /// [google.cloud.ces.v1.Toolset]: @googleapis_reference_link{google/cloud/ces/v1/toolset.proto#L35} + /// + // clang-format on + StatusOr GetToolset(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified toolset. + /// + /// @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.ces.v1.GetToolsetRequest]. + /// 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.ces.v1.Toolset]) + /// 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.ces.v1.GetToolsetRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1468} + /// [google.cloud.ces.v1.Toolset]: @googleapis_reference_link{google/cloud/ces/v1/toolset.proto#L35} + /// + // clang-format on + StatusOr GetToolset( + google::cloud::ces::v1::GetToolsetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new toolset in the given app. + /// + /// @param parent Required. The resource name of the app to create a toolset in. + /// @param toolset Required. The toolset to create. + /// @param toolset_id Optional. The ID to use for the toolset, which will become the final + /// component of the toolset's resource name. If not provided, a unique ID will + /// be automatically assigned for the toolset. + /// @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.ces.v1.Toolset]) + /// 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.ces.v1.CreateToolsetRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1478} + /// [google.cloud.ces.v1.Toolset]: @googleapis_reference_link{google/cloud/ces/v1/toolset.proto#L35} + /// + // clang-format on + StatusOr CreateToolset( + std::string const& parent, google::cloud::ces::v1::Toolset const& toolset, + std::string const& toolset_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new toolset in the given app. + /// + /// @param parent Required. The resource name of the app to create a toolset in. + /// @param toolset Required. The toolset to create. + /// @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.ces.v1.Toolset]) + /// 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.ces.v1.CreateToolsetRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1478} + /// [google.cloud.ces.v1.Toolset]: @googleapis_reference_link{google/cloud/ces/v1/toolset.proto#L35} + /// + // clang-format on + StatusOr CreateToolset( + std::string const& parent, google::cloud::ces::v1::Toolset const& toolset, + Options opts = {}); + + // clang-format off + /// + /// Creates a new toolset in the given app. + /// + /// @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.ces.v1.CreateToolsetRequest]. + /// 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.ces.v1.Toolset]) + /// 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.ces.v1.CreateToolsetRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1478} + /// [google.cloud.ces.v1.Toolset]: @googleapis_reference_link{google/cloud/ces/v1/toolset.proto#L35} + /// + // clang-format on + StatusOr CreateToolset( + google::cloud::ces::v1::CreateToolsetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates the specified toolset. + /// + /// @param toolset Required. The toolset to update. + /// @param update_mask Optional. Field mask is used to control which fields get updated. If the + /// mask is not present, all fields will be updated. + /// @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.ces.v1.Toolset]) + /// 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.ces.v1.Toolset]: @googleapis_reference_link{google/cloud/ces/v1/toolset.proto#L35} + /// [google.cloud.ces.v1.UpdateToolsetRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1498} + /// + // clang-format on + StatusOr UpdateToolset( + google::cloud::ces::v1::Toolset const& toolset, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the specified toolset. + /// + /// @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.ces.v1.UpdateToolsetRequest]. + /// 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.ces.v1.Toolset]) + /// 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.ces.v1.Toolset]: @googleapis_reference_link{google/cloud/ces/v1/toolset.proto#L35} + /// [google.cloud.ces.v1.UpdateToolsetRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1498} + /// + // clang-format on + StatusOr UpdateToolset( + google::cloud::ces::v1::UpdateToolsetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes the specified toolset. + /// + /// @param name Required. The resource name of the toolset to delete. + /// @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.cloud.ces.v1.DeleteToolsetRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1510} + /// + // clang-format on + Status DeleteToolset(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes the specified toolset. + /// + /// @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.ces.v1.DeleteToolsetRequest]. + /// 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.cloud.ces.v1.DeleteToolsetRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1510} + /// + // clang-format on + Status DeleteToolset( + google::cloud::ces::v1::DeleteToolsetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists all app versions in the given app. + /// + /// @param parent Required. The resource name of the app to list app versions from. + /// @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.ces.v1.AppVersion], 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.ces.v1.AppVersion]: @googleapis_reference_link{google/cloud/ces/v1/app_version.proto#L58} + /// [google.cloud.ces.v1.ListAppVersionsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1535} + /// + // clang-format on + StreamRange ListAppVersions( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists all app versions in the given app. + /// + /// @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.ces.v1.ListAppVersionsRequest]. + /// 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.ces.v1.AppVersion], 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.ces.v1.AppVersion]: @googleapis_reference_link{google/cloud/ces/v1/app_version.proto#L58} + /// [google.cloud.ces.v1.ListAppVersionsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1535} + /// + // clang-format on + StreamRange ListAppVersions( + google::cloud::ces::v1::ListAppVersionsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified app version. + /// + /// @param name Required. The resource name of the app version to retrieve. + /// @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.ces.v1.AppVersion]) + /// 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.ces.v1.AppVersion]: @googleapis_reference_link{google/cloud/ces/v1/app_version.proto#L58} + /// [google.cloud.ces.v1.GetAppVersionRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1579} + /// + // clang-format on + StatusOr GetAppVersion( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of the specified app version. + /// + /// @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.ces.v1.GetAppVersionRequest]. + /// 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.ces.v1.AppVersion]) + /// 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.ces.v1.AppVersion]: @googleapis_reference_link{google/cloud/ces/v1/app_version.proto#L58} + /// [google.cloud.ces.v1.GetAppVersionRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1579} + /// + // clang-format on + StatusOr GetAppVersion( + google::cloud::ces::v1::GetAppVersionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new app version in the given app. + /// + /// @param parent Required. The resource name of the app to create an app version in. + /// @param app_version Required. The app version to create. + /// @param app_version_id Optional. The ID to use for the app version, which will become the final + /// component of the app version's resource name. If not provided, a unique ID + /// will be automatically assigned for the app version. + /// @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.ces.v1.AppVersion]) + /// 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.ces.v1.AppVersion]: @googleapis_reference_link{google/cloud/ces/v1/app_version.proto#L58} + /// [google.cloud.ces.v1.CreateAppVersionRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1605} + /// + // clang-format on + StatusOr CreateAppVersion( + std::string const& parent, + google::cloud::ces::v1::AppVersion const& app_version, + std::string const& app_version_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new app version in the given app. + /// + /// @param parent Required. The resource name of the app to create an app version in. + /// @param app_version Required. The app version to create. + /// @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.ces.v1.AppVersion]) + /// 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.ces.v1.AppVersion]: @googleapis_reference_link{google/cloud/ces/v1/app_version.proto#L58} + /// [google.cloud.ces.v1.CreateAppVersionRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1605} + /// + // clang-format on + StatusOr CreateAppVersion( + std::string const& parent, + google::cloud::ces::v1::AppVersion const& app_version, Options opts = {}); + + // clang-format off + /// + /// Creates a new app version in the given app. + /// + /// @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.ces.v1.CreateAppVersionRequest]. + /// 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.ces.v1.AppVersion]) + /// 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.ces.v1.AppVersion]: @googleapis_reference_link{google/cloud/ces/v1/app_version.proto#L58} + /// [google.cloud.ces.v1.CreateAppVersionRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1605} + /// + // clang-format on + StatusOr CreateAppVersion( + google::cloud::ces::v1::CreateAppVersionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes the specified app version. + /// + /// @param name Required. The resource name of the app version to delete. + /// @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.cloud.ces.v1.DeleteAppVersionRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1589} + /// + // clang-format on + Status DeleteAppVersion(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes the specified app version. + /// + /// @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.ces.v1.DeleteAppVersionRequest]. + /// 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.cloud.ces.v1.DeleteAppVersionRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1589} + /// + // clang-format on + Status DeleteAppVersion( + google::cloud::ces::v1::DeleteAppVersionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Restores the specified app version. + /// This will create a new app version from the current draft app and overwrite + /// the current draft with the specified app version. + /// + /// @param name Required. The resource name of the app version to restore. + /// @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.ces.v1.RestoreAppVersionResponse] 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.ces.v1.RestoreAppVersionRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1625} + /// [google.cloud.ces.v1.RestoreAppVersionResponse]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1635} + /// + // clang-format on + future> + RestoreAppVersion(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief RestoreAppVersion + /// + /// 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 RestoreAppVersion( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Restores the specified app version. + /// This will create a new app version from the current draft app and overwrite + /// the current draft with the specified app version. + /// + /// @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.ces.v1.RestoreAppVersionRequest]. + /// 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.ces.v1.RestoreAppVersionResponse] 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.ces.v1.RestoreAppVersionRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1625} + /// [google.cloud.ces.v1.RestoreAppVersionResponse]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1635} + /// + // clang-format on + future> + RestoreAppVersion( + google::cloud::ces::v1::RestoreAppVersionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief RestoreAppVersion + /// + /// 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 RestoreAppVersion( + NoAwaitTag, + google::cloud::ces::v1::RestoreAppVersionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief RestoreAppVersion + /// + /// 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> + RestoreAppVersion(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists the changelogs of the specified app. + /// + /// @param parent Required. The resource name of the app to list changelogs from. + /// @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.ces.v1.Changelog], 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.ces.v1.Changelog]: @googleapis_reference_link{google/cloud/ces/v1/changelog.proto#L31} + /// [google.cloud.ces.v1.ListChangelogsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1639} + /// + // clang-format on + StreamRange ListChangelogs( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists the changelogs of the specified app. + /// + /// @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.ces.v1.ListChangelogsRequest]. + /// 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.ces.v1.Changelog], 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.ces.v1.Changelog]: @googleapis_reference_link{google/cloud/ces/v1/changelog.proto#L31} + /// [google.cloud.ces.v1.ListChangelogsRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1639} + /// + // clang-format on + StreamRange ListChangelogs( + google::cloud::ces::v1::ListChangelogsRequest request, Options opts = {}); + + // clang-format off + /// + /// Gets the specified changelog. + /// + /// @param name Required. The resource name of the changelog to retrieve. + /// @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.ces.v1.Changelog]) + /// 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.ces.v1.Changelog]: @googleapis_reference_link{google/cloud/ces/v1/changelog.proto#L31} + /// [google.cloud.ces.v1.GetChangelogRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1697} + /// + // clang-format on + StatusOr GetChangelog( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets the specified changelog. + /// + /// @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.ces.v1.GetChangelogRequest]. + /// 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.ces.v1.Changelog]) + /// 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.ces.v1.Changelog]: @googleapis_reference_link{google/cloud/ces/v1/changelog.proto#L31} + /// [google.cloud.ces.v1.GetChangelogRequest]: @googleapis_reference_link{google/cloud/ces/v1/agent_service.proto#L1697} + /// + // clang-format on + StatusOr GetChangelog( + google::cloud::ces::v1::GetChangelogRequest const& request, + 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_AGENT_CLIENT_H diff --git a/google/cloud/ces/v1/agent_connection.cc b/google/cloud/ces/v1/agent_connection.cc new file mode 100644 index 0000000000000..f25fda2932abd --- /dev/null +++ b/google/cloud/ces/v1/agent_connection.cc @@ -0,0 +1,473 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#include "google/cloud/ces/v1/agent_connection.h" +#include "google/cloud/ces/v1/agent_options.h" +#include "google/cloud/ces/v1/internal/agent_connection_impl.h" +#include "google/cloud/ces/v1/internal/agent_option_defaults.h" +#include "google/cloud/ces/v1/internal/agent_stub_factory.h" +#include "google/cloud/ces/v1/internal/agent_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 ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AgentServiceConnection::~AgentServiceConnection() = default; + +StreamRange AgentServiceConnection::ListApps( + google::cloud::ces::v1:: + ListAppsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr AgentServiceConnection::GetApp( + google::cloud::ces::v1::GetAppRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> AgentServiceConnection::CreateApp( + google::cloud::ces::v1::CreateAppRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AgentServiceConnection::CreateApp( + NoAwaitTag, google::cloud::ces::v1::CreateAppRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> AgentServiceConnection::CreateApp( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AgentServiceConnection::UpdateApp( + google::cloud::ces::v1::UpdateAppRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +AgentServiceConnection::DeleteApp( + google::cloud::ces::v1::DeleteAppRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AgentServiceConnection::DeleteApp( + NoAwaitTag, google::cloud::ces::v1::DeleteAppRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AgentServiceConnection::DeleteApp(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AgentServiceConnection::ExportApp( + google::cloud::ces::v1::ExportAppRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AgentServiceConnection::ExportApp( + NoAwaitTag, google::cloud::ces::v1::ExportAppRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AgentServiceConnection::ExportApp(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AgentServiceConnection::ImportApp( + google::cloud::ces::v1::ImportAppRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AgentServiceConnection::ImportApp( + NoAwaitTag, google::cloud::ces::v1::ImportAppRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AgentServiceConnection::ImportApp(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange AgentServiceConnection::ListAgents( + google::cloud::ces::v1:: + ListAgentsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr AgentServiceConnection::GetAgent( + google::cloud::ces::v1::GetAgentRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr AgentServiceConnection::CreateAgent( + google::cloud::ces::v1::CreateAgentRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr AgentServiceConnection::UpdateAgent( + google::cloud::ces::v1::UpdateAgentRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AgentServiceConnection::DeleteAgent( + google::cloud::ces::v1::DeleteAgentRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +AgentServiceConnection::ListExamples( + google::cloud::ces::v1:: + ListExamplesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr AgentServiceConnection::GetExample( + google::cloud::ces::v1::GetExampleRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr AgentServiceConnection::CreateExample( + google::cloud::ces::v1::CreateExampleRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr AgentServiceConnection::UpdateExample( + google::cloud::ces::v1::UpdateExampleRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AgentServiceConnection::DeleteExample( + google::cloud::ces::v1::DeleteExampleRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange AgentServiceConnection::ListTools( + google::cloud::ces::v1:: + ListToolsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr AgentServiceConnection::GetTool( + google::cloud::ces::v1::GetToolRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +AgentServiceConnection::ListConversations( + google::cloud::ces::v1:: + ListConversationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +AgentServiceConnection::GetConversation( + google::cloud::ces::v1::GetConversationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AgentServiceConnection::DeleteConversation( + google::cloud::ces::v1::DeleteConversationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +AgentServiceConnection::BatchDeleteConversations( + google::cloud::ces::v1::BatchDeleteConversationsRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AgentServiceConnection::BatchDeleteConversations( + NoAwaitTag, + google::cloud::ces::v1::BatchDeleteConversationsRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AgentServiceConnection::BatchDeleteConversations( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AgentServiceConnection::CreateTool( + google::cloud::ces::v1::CreateToolRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr AgentServiceConnection::UpdateTool( + google::cloud::ces::v1::UpdateToolRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AgentServiceConnection::DeleteTool( + google::cloud::ces::v1::DeleteToolRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +AgentServiceConnection::ListGuardrails( + google::cloud::ces::v1:: + ListGuardrailsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +AgentServiceConnection::GetGuardrail( + google::cloud::ces::v1::GetGuardrailRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +AgentServiceConnection::CreateGuardrail( + google::cloud::ces::v1::CreateGuardrailRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +AgentServiceConnection::UpdateGuardrail( + google::cloud::ces::v1::UpdateGuardrailRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AgentServiceConnection::DeleteGuardrail( + google::cloud::ces::v1::DeleteGuardrailRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +AgentServiceConnection::ListDeployments( + google::cloud::ces::v1:: + ListDeploymentsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +AgentServiceConnection::GetDeployment( + google::cloud::ces::v1::GetDeploymentRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +AgentServiceConnection::CreateDeployment( + google::cloud::ces::v1::CreateDeploymentRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +AgentServiceConnection::UpdateDeployment( + google::cloud::ces::v1::UpdateDeploymentRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AgentServiceConnection::DeleteDeployment( + google::cloud::ces::v1::DeleteDeploymentRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +AgentServiceConnection::ListToolsets( + google::cloud::ces::v1:: + ListToolsetsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr AgentServiceConnection::GetToolset( + google::cloud::ces::v1::GetToolsetRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr AgentServiceConnection::CreateToolset( + google::cloud::ces::v1::CreateToolsetRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr AgentServiceConnection::UpdateToolset( + google::cloud::ces::v1::UpdateToolsetRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AgentServiceConnection::DeleteToolset( + google::cloud::ces::v1::DeleteToolsetRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +AgentServiceConnection::ListAppVersions( + google::cloud::ces::v1:: + ListAppVersionsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +AgentServiceConnection::GetAppVersion( + google::cloud::ces::v1::GetAppVersionRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +AgentServiceConnection::CreateAppVersion( + google::cloud::ces::v1::CreateAppVersionRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AgentServiceConnection::DeleteAppVersion( + google::cloud::ces::v1::DeleteAppVersionRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +AgentServiceConnection::RestoreAppVersion( + google::cloud::ces::v1::RestoreAppVersionRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AgentServiceConnection::RestoreAppVersion( + NoAwaitTag, google::cloud::ces::v1::RestoreAppVersionRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AgentServiceConnection::RestoreAppVersion( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +AgentServiceConnection::ListChangelogs( + google::cloud::ces::v1:: + ListChangelogsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +AgentServiceConnection::GetChangelog( + google::cloud::ces::v1::GetChangelogRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +AgentServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr AgentServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +AgentServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr AgentServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AgentServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AgentServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeAgentServiceConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = ces_v1_internal::AgentServiceDefaultOptions(std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = + ces_v1_internal::CreateDefaultAgentServiceStub(std::move(auth), options); + return ces_v1_internal::MakeAgentServiceTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/agent_connection.h b/google/cloud/ces/v1/agent_connection.h new file mode 100644 index 0000000000000..c21fa2640bf7b --- /dev/null +++ b/google/cloud/ces/v1/agent_connection.h @@ -0,0 +1,423 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_AGENT_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_AGENT_CONNECTION_H + +#include "google/cloud/ces/v1/agent_connection_idempotency_policy.h" +#include "google/cloud/ces/v1/agent_service.pb.h" +#include "google/cloud/ces/v1/internal/agent_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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `AgentServiceConnection`. +class AgentServiceRetryPolicy : 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 `AgentServiceConnection` 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 AgentServiceLimitedErrorCountRetryPolicy + : public AgentServiceRetryPolicy { + 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 AgentServiceLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + AgentServiceLimitedErrorCountRetryPolicy( + AgentServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : AgentServiceLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + AgentServiceLimitedErrorCountRetryPolicy( + AgentServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : AgentServiceLimitedErrorCountRetryPolicy(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 = AgentServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + ces_v1_internal::AgentServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `AgentServiceConnection` 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 AgentServiceLimitedTimeRetryPolicy : public AgentServiceRetryPolicy { + 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 AgentServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + AgentServiceLimitedTimeRetryPolicy( + AgentServiceLimitedTimeRetryPolicy&& rhs) noexcept + : AgentServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + AgentServiceLimitedTimeRetryPolicy( + AgentServiceLimitedTimeRetryPolicy const& rhs) noexcept + : AgentServiceLimitedTimeRetryPolicy(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 = AgentServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + ces_v1_internal::AgentServiceRetryTraits> + impl_; +}; + +/** + * The `AgentServiceConnection` object for `AgentServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `AgentServiceClient`. This allows users to inject custom behavior + * (e.g., with a Google Mock object) when writing tests that use objects of type + * `AgentServiceClient`. + * + * To create a concrete instance, see `MakeAgentServiceConnection()`. + * + * For mocking, see `ces_v1_mocks::MockAgentServiceConnection`. + */ +class AgentServiceConnection { + public: + virtual ~AgentServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StreamRange ListApps( + google::cloud::ces::v1::ListAppsRequest request); + + virtual StatusOr GetApp( + google::cloud::ces::v1::GetAppRequest const& request); + + virtual future> CreateApp( + google::cloud::ces::v1::CreateAppRequest const& request); + + virtual StatusOr CreateApp( + NoAwaitTag, google::cloud::ces::v1::CreateAppRequest const& request); + + virtual future> CreateApp( + google::longrunning::Operation const& operation); + + virtual StatusOr UpdateApp( + google::cloud::ces::v1::UpdateAppRequest const& request); + + virtual future> DeleteApp( + google::cloud::ces::v1::DeleteAppRequest const& request); + + virtual StatusOr DeleteApp( + NoAwaitTag, google::cloud::ces::v1::DeleteAppRequest const& request); + + virtual future> DeleteApp( + google::longrunning::Operation const& operation); + + virtual future> ExportApp( + google::cloud::ces::v1::ExportAppRequest const& request); + + virtual StatusOr ExportApp( + NoAwaitTag, google::cloud::ces::v1::ExportAppRequest const& request); + + virtual future> ExportApp( + google::longrunning::Operation const& operation); + + virtual future> ImportApp( + google::cloud::ces::v1::ImportAppRequest const& request); + + virtual StatusOr ImportApp( + NoAwaitTag, google::cloud::ces::v1::ImportAppRequest const& request); + + virtual future> ImportApp( + google::longrunning::Operation const& operation); + + virtual StreamRange ListAgents( + google::cloud::ces::v1::ListAgentsRequest request); + + virtual StatusOr GetAgent( + google::cloud::ces::v1::GetAgentRequest const& request); + + virtual StatusOr CreateAgent( + google::cloud::ces::v1::CreateAgentRequest const& request); + + virtual StatusOr UpdateAgent( + google::cloud::ces::v1::UpdateAgentRequest const& request); + + virtual Status DeleteAgent( + google::cloud::ces::v1::DeleteAgentRequest const& request); + + virtual StreamRange ListExamples( + google::cloud::ces::v1::ListExamplesRequest request); + + virtual StatusOr GetExample( + google::cloud::ces::v1::GetExampleRequest const& request); + + virtual StatusOr CreateExample( + google::cloud::ces::v1::CreateExampleRequest const& request); + + virtual StatusOr UpdateExample( + google::cloud::ces::v1::UpdateExampleRequest const& request); + + virtual Status DeleteExample( + google::cloud::ces::v1::DeleteExampleRequest const& request); + + virtual StreamRange ListTools( + google::cloud::ces::v1::ListToolsRequest request); + + virtual StatusOr GetTool( + google::cloud::ces::v1::GetToolRequest const& request); + + virtual StreamRange ListConversations( + google::cloud::ces::v1::ListConversationsRequest request); + + virtual StatusOr GetConversation( + google::cloud::ces::v1::GetConversationRequest const& request); + + virtual Status DeleteConversation( + google::cloud::ces::v1::DeleteConversationRequest const& request); + + virtual future< + StatusOr> + BatchDeleteConversations( + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request); + + virtual StatusOr BatchDeleteConversations( + NoAwaitTag, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request); + + virtual future< + StatusOr> + BatchDeleteConversations(google::longrunning::Operation const& operation); + + virtual StatusOr CreateTool( + google::cloud::ces::v1::CreateToolRequest const& request); + + virtual StatusOr UpdateTool( + google::cloud::ces::v1::UpdateToolRequest const& request); + + virtual Status DeleteTool( + google::cloud::ces::v1::DeleteToolRequest const& request); + + virtual StreamRange ListGuardrails( + google::cloud::ces::v1::ListGuardrailsRequest request); + + virtual StatusOr GetGuardrail( + google::cloud::ces::v1::GetGuardrailRequest const& request); + + virtual StatusOr CreateGuardrail( + google::cloud::ces::v1::CreateGuardrailRequest const& request); + + virtual StatusOr UpdateGuardrail( + google::cloud::ces::v1::UpdateGuardrailRequest const& request); + + virtual Status DeleteGuardrail( + google::cloud::ces::v1::DeleteGuardrailRequest const& request); + + virtual StreamRange ListDeployments( + google::cloud::ces::v1::ListDeploymentsRequest request); + + virtual StatusOr GetDeployment( + google::cloud::ces::v1::GetDeploymentRequest const& request); + + virtual StatusOr CreateDeployment( + google::cloud::ces::v1::CreateDeploymentRequest const& request); + + virtual StatusOr UpdateDeployment( + google::cloud::ces::v1::UpdateDeploymentRequest const& request); + + virtual Status DeleteDeployment( + google::cloud::ces::v1::DeleteDeploymentRequest const& request); + + virtual StreamRange ListToolsets( + google::cloud::ces::v1::ListToolsetsRequest request); + + virtual StatusOr GetToolset( + google::cloud::ces::v1::GetToolsetRequest const& request); + + virtual StatusOr CreateToolset( + google::cloud::ces::v1::CreateToolsetRequest const& request); + + virtual StatusOr UpdateToolset( + google::cloud::ces::v1::UpdateToolsetRequest const& request); + + virtual Status DeleteToolset( + google::cloud::ces::v1::DeleteToolsetRequest const& request); + + virtual StreamRange ListAppVersions( + google::cloud::ces::v1::ListAppVersionsRequest request); + + virtual StatusOr GetAppVersion( + google::cloud::ces::v1::GetAppVersionRequest const& request); + + virtual StatusOr CreateAppVersion( + google::cloud::ces::v1::CreateAppVersionRequest const& request); + + virtual Status DeleteAppVersion( + google::cloud::ces::v1::DeleteAppVersionRequest const& request); + + virtual future> + RestoreAppVersion( + google::cloud::ces::v1::RestoreAppVersionRequest const& request); + + virtual StatusOr RestoreAppVersion( + NoAwaitTag, + google::cloud::ces::v1::RestoreAppVersionRequest const& request); + + virtual future> + RestoreAppVersion(google::longrunning::Operation const& operation); + + virtual StreamRange ListChangelogs( + google::cloud::ces::v1::ListChangelogsRequest request); + + virtual StatusOr GetChangelog( + google::cloud::ces::v1::GetChangelogRequest const& request); + + 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 `AgentServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of AgentServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `AgentServiceConnection`. Expected options are any of the types in + * the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::ces_v1::AgentServicePolicyOptionList` + * + * @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 `AgentServiceConnection` created by + * this function. + */ +std::shared_ptr MakeAgentServiceConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_AGENT_CONNECTION_H diff --git a/google/cloud/ces/v1/agent_connection_idempotency_policy.cc b/google/cloud/ces/v1/agent_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..19fc2844fdc84 --- /dev/null +++ b/google/cloud/ces/v1/agent_connection_idempotency_policy.cc @@ -0,0 +1,315 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#include "google/cloud/ces/v1/agent_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +AgentServiceConnectionIdempotencyPolicy:: + ~AgentServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +AgentServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ListApps( + google::cloud::ces::v1::ListAppsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::GetApp( + google::cloud::ces::v1::GetAppRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::CreateApp( + google::cloud::ces::v1::CreateAppRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::UpdateApp( + google::cloud::ces::v1::UpdateAppRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::DeleteApp( + google::cloud::ces::v1::DeleteAppRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ExportApp( + google::cloud::ces::v1::ExportAppRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ImportApp( + google::cloud::ces::v1::ImportAppRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ListAgents( + google::cloud::ces::v1::ListAgentsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::GetAgent( + google::cloud::ces::v1::GetAgentRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::CreateAgent( + google::cloud::ces::v1::CreateAgentRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::UpdateAgent( + google::cloud::ces::v1::UpdateAgentRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::DeleteAgent( + google::cloud::ces::v1::DeleteAgentRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ListExamples( + google::cloud::ces::v1::ListExamplesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::GetExample( + google::cloud::ces::v1::GetExampleRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::CreateExample( + google::cloud::ces::v1::CreateExampleRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::UpdateExample( + google::cloud::ces::v1::UpdateExampleRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::DeleteExample( + google::cloud::ces::v1::DeleteExampleRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ListTools( + google::cloud::ces::v1::ListToolsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::GetTool( + google::cloud::ces::v1::GetToolRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ListConversations( + google::cloud::ces::v1::ListConversationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::GetConversation( + google::cloud::ces::v1::GetConversationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::DeleteConversation( + google::cloud::ces::v1::DeleteConversationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::BatchDeleteConversations( + google::cloud::ces::v1::BatchDeleteConversationsRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::CreateTool( + google::cloud::ces::v1::CreateToolRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::UpdateTool( + google::cloud::ces::v1::UpdateToolRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::DeleteTool( + google::cloud::ces::v1::DeleteToolRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ListGuardrails( + google::cloud::ces::v1::ListGuardrailsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::GetGuardrail( + google::cloud::ces::v1::GetGuardrailRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::CreateGuardrail( + google::cloud::ces::v1::CreateGuardrailRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::UpdateGuardrail( + google::cloud::ces::v1::UpdateGuardrailRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::DeleteGuardrail( + google::cloud::ces::v1::DeleteGuardrailRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ListDeployments( + google::cloud::ces::v1::ListDeploymentsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::GetDeployment( + google::cloud::ces::v1::GetDeploymentRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::CreateDeployment( + google::cloud::ces::v1::CreateDeploymentRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::UpdateDeployment( + google::cloud::ces::v1::UpdateDeploymentRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::DeleteDeployment( + google::cloud::ces::v1::DeleteDeploymentRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ListToolsets( + google::cloud::ces::v1::ListToolsetsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::GetToolset( + google::cloud::ces::v1::GetToolsetRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::CreateToolset( + google::cloud::ces::v1::CreateToolsetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::UpdateToolset( + google::cloud::ces::v1::UpdateToolsetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::DeleteToolset( + google::cloud::ces::v1::DeleteToolsetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ListAppVersions( + google::cloud::ces::v1::ListAppVersionsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::GetAppVersion( + google::cloud::ces::v1::GetAppVersionRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::CreateAppVersion( + google::cloud::ces::v1::CreateAppVersionRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::DeleteAppVersion( + google::cloud::ces::v1::DeleteAppVersionRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::RestoreAppVersion( + google::cloud::ces::v1::RestoreAppVersionRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ListChangelogs( + google::cloud::ces::v1::ListChangelogsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::GetChangelog( + google::cloud::ces::v1::GetChangelogRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AgentServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultAgentServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/agent_connection_idempotency_policy.h b/google/cloud/ces/v1/agent_connection_idempotency_policy.h new file mode 100644 index 0000000000000..d8012d45f3499 --- /dev/null +++ b/google/cloud/ces/v1/agent_connection_idempotency_policy.h @@ -0,0 +1,213 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_AGENT_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_AGENT_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/ces/v1/agent_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AgentServiceConnectionIdempotencyPolicy { + public: + virtual ~AgentServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() + const; + + virtual google::cloud::Idempotency ListApps( + google::cloud::ces::v1::ListAppsRequest request); + + virtual google::cloud::Idempotency GetApp( + google::cloud::ces::v1::GetAppRequest const& request); + + virtual google::cloud::Idempotency CreateApp( + google::cloud::ces::v1::CreateAppRequest const& request); + + virtual google::cloud::Idempotency UpdateApp( + google::cloud::ces::v1::UpdateAppRequest const& request); + + virtual google::cloud::Idempotency DeleteApp( + google::cloud::ces::v1::DeleteAppRequest const& request); + + virtual google::cloud::Idempotency ExportApp( + google::cloud::ces::v1::ExportAppRequest const& request); + + virtual google::cloud::Idempotency ImportApp( + google::cloud::ces::v1::ImportAppRequest const& request); + + virtual google::cloud::Idempotency ListAgents( + google::cloud::ces::v1::ListAgentsRequest request); + + virtual google::cloud::Idempotency GetAgent( + google::cloud::ces::v1::GetAgentRequest const& request); + + virtual google::cloud::Idempotency CreateAgent( + google::cloud::ces::v1::CreateAgentRequest const& request); + + virtual google::cloud::Idempotency UpdateAgent( + google::cloud::ces::v1::UpdateAgentRequest const& request); + + virtual google::cloud::Idempotency DeleteAgent( + google::cloud::ces::v1::DeleteAgentRequest const& request); + + virtual google::cloud::Idempotency ListExamples( + google::cloud::ces::v1::ListExamplesRequest request); + + virtual google::cloud::Idempotency GetExample( + google::cloud::ces::v1::GetExampleRequest const& request); + + virtual google::cloud::Idempotency CreateExample( + google::cloud::ces::v1::CreateExampleRequest const& request); + + virtual google::cloud::Idempotency UpdateExample( + google::cloud::ces::v1::UpdateExampleRequest const& request); + + virtual google::cloud::Idempotency DeleteExample( + google::cloud::ces::v1::DeleteExampleRequest const& request); + + virtual google::cloud::Idempotency ListTools( + google::cloud::ces::v1::ListToolsRequest request); + + virtual google::cloud::Idempotency GetTool( + google::cloud::ces::v1::GetToolRequest const& request); + + virtual google::cloud::Idempotency ListConversations( + google::cloud::ces::v1::ListConversationsRequest request); + + virtual google::cloud::Idempotency GetConversation( + google::cloud::ces::v1::GetConversationRequest const& request); + + virtual google::cloud::Idempotency DeleteConversation( + google::cloud::ces::v1::DeleteConversationRequest const& request); + + virtual google::cloud::Idempotency BatchDeleteConversations( + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request); + + virtual google::cloud::Idempotency CreateTool( + google::cloud::ces::v1::CreateToolRequest const& request); + + virtual google::cloud::Idempotency UpdateTool( + google::cloud::ces::v1::UpdateToolRequest const& request); + + virtual google::cloud::Idempotency DeleteTool( + google::cloud::ces::v1::DeleteToolRequest const& request); + + virtual google::cloud::Idempotency ListGuardrails( + google::cloud::ces::v1::ListGuardrailsRequest request); + + virtual google::cloud::Idempotency GetGuardrail( + google::cloud::ces::v1::GetGuardrailRequest const& request); + + virtual google::cloud::Idempotency CreateGuardrail( + google::cloud::ces::v1::CreateGuardrailRequest const& request); + + virtual google::cloud::Idempotency UpdateGuardrail( + google::cloud::ces::v1::UpdateGuardrailRequest const& request); + + virtual google::cloud::Idempotency DeleteGuardrail( + google::cloud::ces::v1::DeleteGuardrailRequest const& request); + + virtual google::cloud::Idempotency ListDeployments( + google::cloud::ces::v1::ListDeploymentsRequest request); + + virtual google::cloud::Idempotency GetDeployment( + google::cloud::ces::v1::GetDeploymentRequest const& request); + + virtual google::cloud::Idempotency CreateDeployment( + google::cloud::ces::v1::CreateDeploymentRequest const& request); + + virtual google::cloud::Idempotency UpdateDeployment( + google::cloud::ces::v1::UpdateDeploymentRequest const& request); + + virtual google::cloud::Idempotency DeleteDeployment( + google::cloud::ces::v1::DeleteDeploymentRequest const& request); + + virtual google::cloud::Idempotency ListToolsets( + google::cloud::ces::v1::ListToolsetsRequest request); + + virtual google::cloud::Idempotency GetToolset( + google::cloud::ces::v1::GetToolsetRequest const& request); + + virtual google::cloud::Idempotency CreateToolset( + google::cloud::ces::v1::CreateToolsetRequest const& request); + + virtual google::cloud::Idempotency UpdateToolset( + google::cloud::ces::v1::UpdateToolsetRequest const& request); + + virtual google::cloud::Idempotency DeleteToolset( + google::cloud::ces::v1::DeleteToolsetRequest const& request); + + virtual google::cloud::Idempotency ListAppVersions( + google::cloud::ces::v1::ListAppVersionsRequest request); + + virtual google::cloud::Idempotency GetAppVersion( + google::cloud::ces::v1::GetAppVersionRequest const& request); + + virtual google::cloud::Idempotency CreateAppVersion( + google::cloud::ces::v1::CreateAppVersionRequest const& request); + + virtual google::cloud::Idempotency DeleteAppVersion( + google::cloud::ces::v1::DeleteAppVersionRequest const& request); + + virtual google::cloud::Idempotency RestoreAppVersion( + google::cloud::ces::v1::RestoreAppVersionRequest const& request); + + virtual google::cloud::Idempotency ListChangelogs( + google::cloud::ces::v1::ListChangelogsRequest request); + + virtual google::cloud::Idempotency GetChangelog( + google::cloud::ces::v1::GetChangelogRequest 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 +MakeDefaultAgentServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_AGENT_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/ces/v1/agent_options.h b/google/cloud/ces/v1/agent_options.h new file mode 100644 index 0000000000000..bba4b38c1073b --- /dev/null +++ b/google/cloud/ces/v1/agent_options.h @@ -0,0 +1,86 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_AGENT_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_AGENT_OPTIONS_H + +#include "google/cloud/ces/v1/agent_connection.h" +#include "google/cloud/ces/v1/agent_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 ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-ces-options + */ +struct AgentServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-ces-options + */ +struct AgentServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-ces-options + */ +struct AgentServiceConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-ces-options + */ +struct AgentServicePollingPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to AgentService. + * + * @ingroup google-cloud-ces-options + */ +using AgentServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_AGENT_OPTIONS_H diff --git a/google/cloud/ces/v1/internal/agent_auth_decorator.cc b/google/cloud/ces/v1/internal/agent_auth_decorator.cc new file mode 100644 index 0000000000000..b93ef66c78491 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_auth_decorator.cc @@ -0,0 +1,642 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#include "google/cloud/ces/v1/internal/agent_auth_decorator.h" +#include "google/cloud/ces/v1/agent_service.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AgentServiceAuth::AgentServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr AgentServiceAuth::ListApps( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListApps(context, options, request); +} + +StatusOr AgentServiceAuth::GetApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetApp(context, options, request); +} + +future> +AgentServiceAuth::AsyncCreateApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::CreateAppRequest 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->AsyncCreateApp(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AgentServiceAuth::CreateApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::CreateAppRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateApp(context, options, request); +} + +StatusOr AgentServiceAuth::UpdateApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAppRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateApp(context, options, request); +} + +future> +AgentServiceAuth::AsyncDeleteApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::DeleteAppRequest 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->AsyncDeleteApp(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AgentServiceAuth::DeleteApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::DeleteAppRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteApp(context, options, request); +} + +future> +AgentServiceAuth::AsyncExportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ExportAppRequest 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->AsyncExportApp(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AgentServiceAuth::ExportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ExportAppRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ExportApp(context, options, request); +} + +future> +AgentServiceAuth::AsyncImportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ImportAppRequest 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->AsyncImportApp(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AgentServiceAuth::ImportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ImportAppRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ImportApp(context, options, request); +} + +StatusOr +AgentServiceAuth::ListAgents( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAgentsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListAgents(context, options, request); +} + +StatusOr AgentServiceAuth::GetAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAgentRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetAgent(context, options, request); +} + +StatusOr AgentServiceAuth::CreateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAgentRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateAgent(context, options, request); +} + +StatusOr AgentServiceAuth::UpdateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAgentRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateAgent(context, options, request); +} + +Status AgentServiceAuth::DeleteAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAgentRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteAgent(context, options, request); +} + +StatusOr +AgentServiceAuth::ListExamples( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListExamplesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListExamples(context, options, request); +} + +StatusOr AgentServiceAuth::GetExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetExampleRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetExample(context, options, request); +} + +StatusOr AgentServiceAuth::CreateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateExampleRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateExample(context, options, request); +} + +StatusOr AgentServiceAuth::UpdateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateExampleRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateExample(context, options, request); +} + +Status AgentServiceAuth::DeleteExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteExampleRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteExample(context, options, request); +} + +StatusOr AgentServiceAuth::ListTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListTools(context, options, request); +} + +StatusOr AgentServiceAuth::GetTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetTool(context, options, request); +} + +StatusOr +AgentServiceAuth::ListConversations( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListConversationsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListConversations(context, options, request); +} + +StatusOr +AgentServiceAuth::GetConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetConversationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetConversation(context, options, request); +} + +Status AgentServiceAuth::DeleteConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteConversationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteConversation(context, options, request); +} + +future> +AgentServiceAuth::AsyncBatchDeleteConversations( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::BatchDeleteConversationsRequest 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->AsyncBatchDeleteConversations( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +AgentServiceAuth::BatchDeleteConversations( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->BatchDeleteConversations(context, options, request); +} + +StatusOr AgentServiceAuth::CreateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateTool(context, options, request); +} + +StatusOr AgentServiceAuth::UpdateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateTool(context, options, request); +} + +Status AgentServiceAuth::DeleteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteTool(context, options, request); +} + +StatusOr +AgentServiceAuth::ListGuardrails( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListGuardrailsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListGuardrails(context, options, request); +} + +StatusOr AgentServiceAuth::GetGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetGuardrailRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetGuardrail(context, options, request); +} + +StatusOr AgentServiceAuth::CreateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateGuardrailRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateGuardrail(context, options, request); +} + +StatusOr AgentServiceAuth::UpdateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateGuardrailRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateGuardrail(context, options, request); +} + +Status AgentServiceAuth::DeleteGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteGuardrailRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteGuardrail(context, options, request); +} + +StatusOr +AgentServiceAuth::ListDeployments( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListDeploymentsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListDeployments(context, options, request); +} + +StatusOr AgentServiceAuth::GetDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetDeploymentRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetDeployment(context, options, request); +} + +StatusOr AgentServiceAuth::CreateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateDeploymentRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateDeployment(context, options, request); +} + +StatusOr AgentServiceAuth::UpdateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateDeploymentRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateDeployment(context, options, request); +} + +Status AgentServiceAuth::DeleteDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteDeploymentRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteDeployment(context, options, request); +} + +StatusOr +AgentServiceAuth::ListToolsets( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsetsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListToolsets(context, options, request); +} + +StatusOr AgentServiceAuth::GetToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolsetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetToolset(context, options, request); +} + +StatusOr AgentServiceAuth::CreateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolsetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateToolset(context, options, request); +} + +StatusOr AgentServiceAuth::UpdateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolsetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateToolset(context, options, request); +} + +Status AgentServiceAuth::DeleteToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolsetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteToolset(context, options, request); +} + +StatusOr +AgentServiceAuth::ListAppVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppVersionsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListAppVersions(context, options, request); +} + +StatusOr AgentServiceAuth::GetAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppVersionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetAppVersion(context, options, request); +} + +StatusOr AgentServiceAuth::CreateAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppVersionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateAppVersion(context, options, request); +} + +Status AgentServiceAuth::DeleteAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppVersionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteAppVersion(context, options, request); +} + +future> +AgentServiceAuth::AsyncRestoreAppVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::RestoreAppVersionRequest 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->AsyncRestoreAppVersion(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AgentServiceAuth::RestoreAppVersion( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->RestoreAppVersion(context, options, request); +} + +StatusOr +AgentServiceAuth::ListChangelogs( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListChangelogsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListChangelogs(context, options, request); +} + +StatusOr AgentServiceAuth::GetChangelog( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetChangelogRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetChangelog(context, options, request); +} + +StatusOr +AgentServiceAuth::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 AgentServiceAuth::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 +AgentServiceAuth::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 AgentServiceAuth::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 AgentServiceAuth::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 AgentServiceAuth::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> +AgentServiceAuth::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 AgentServiceAuth::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 ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/agent_auth_decorator.h b/google/cloud/ces/v1/internal/agent_auth_decorator.h new file mode 100644 index 0000000000000..b2b7ba3fc74a2 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_auth_decorator.h @@ -0,0 +1,325 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_AUTH_DECORATOR_H + +#include "google/cloud/ces/v1/internal/agent_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AgentServiceAuth : public AgentServiceStub { + public: + ~AgentServiceAuth() override = default; + AgentServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr ListApps( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppsRequest const& request) override; + + StatusOr GetApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppRequest const& request) override; + + future> AsyncCreateApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::CreateAppRequest const& request) override; + + StatusOr CreateApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::CreateAppRequest const& request) override; + + StatusOr UpdateApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAppRequest const& request) override; + + future> AsyncDeleteApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + StatusOr DeleteApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + future> AsyncExportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ExportAppRequest const& request) override; + + StatusOr ExportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ExportAppRequest const& request) override; + + future> AsyncImportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ImportAppRequest const& request) override; + + StatusOr ImportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ImportAppRequest const& request) override; + + StatusOr ListAgents( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAgentsRequest const& request) override; + + StatusOr GetAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAgentRequest const& request) override; + + StatusOr CreateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAgentRequest const& request) override; + + StatusOr UpdateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAgentRequest const& request) override; + + Status DeleteAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAgentRequest const& request) override; + + StatusOr ListExamples( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListExamplesRequest const& request) override; + + StatusOr GetExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetExampleRequest const& request) override; + + StatusOr CreateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateExampleRequest const& request) override; + + StatusOr UpdateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateExampleRequest const& request) override; + + Status DeleteExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteExampleRequest const& request) override; + + StatusOr ListTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsRequest const& request) override; + + StatusOr GetTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolRequest const& request) override; + + StatusOr ListConversations( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListConversationsRequest const& request) override; + + StatusOr GetConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetConversationRequest const& request) override; + + Status DeleteConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteConversationRequest const& request) + override; + + future> + AsyncBatchDeleteConversations( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + StatusOr BatchDeleteConversations( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + StatusOr CreateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolRequest const& request) override; + + StatusOr UpdateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolRequest const& request) override; + + Status DeleteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolRequest const& request) override; + + StatusOr ListGuardrails( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListGuardrailsRequest const& request) override; + + StatusOr GetGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetGuardrailRequest const& request) override; + + StatusOr CreateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateGuardrailRequest const& request) override; + + StatusOr UpdateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateGuardrailRequest const& request) override; + + Status DeleteGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteGuardrailRequest const& request) override; + + StatusOr ListDeployments( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListDeploymentsRequest const& request) override; + + StatusOr GetDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetDeploymentRequest const& request) override; + + StatusOr CreateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateDeploymentRequest const& request) override; + + StatusOr UpdateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateDeploymentRequest const& request) override; + + Status DeleteDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteDeploymentRequest const& request) override; + + StatusOr ListToolsets( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsetsRequest const& request) override; + + StatusOr GetToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolsetRequest const& request) override; + + StatusOr CreateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolsetRequest const& request) override; + + StatusOr UpdateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolsetRequest const& request) override; + + Status DeleteToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolsetRequest const& request) override; + + StatusOr ListAppVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppVersionsRequest const& request) override; + + StatusOr GetAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppVersionRequest const& request) override; + + StatusOr CreateAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppVersionRequest const& request) override; + + Status DeleteAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppVersionRequest const& request) override; + + future> AsyncRestoreAppVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + StatusOr RestoreAppVersion( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + StatusOr ListChangelogs( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListChangelogsRequest const& request) override; + + StatusOr GetChangelog( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetChangelogRequest 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 ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_AUTH_DECORATOR_H diff --git a/google/cloud/ces/v1/internal/agent_connection_impl.cc b/google/cloud/ces/v1/internal/agent_connection_impl.cc new file mode 100644 index 0000000000000..d7b6b6546a397 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_connection_impl.cc @@ -0,0 +1,1482 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#include "google/cloud/ces/v1/internal/agent_connection_impl.h" +#include "google/cloud/ces/v1/internal/agent_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 ces_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 + +AgentServiceConnectionImpl::AgentServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions(std::move(options), + AgentServiceConnection::options())) {} + +StreamRange AgentServiceConnectionImpl::ListApps( + google::cloud::ces::v1::ListAppsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListApps(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::ces::v1::ListAppsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppsRequest const& request) { + return stub->ListApps(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::ces::v1::ListAppsResponse r) { + std::vector result(r.apps().size()); + auto& messages = *r.mutable_apps(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr AgentServiceConnectionImpl::GetApp( + google::cloud::ces::v1::GetAppRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetApp(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppRequest const& request) { + return stub_->GetApp(context, options, request); + }, + *current, request, __func__); +} + +future> +AgentServiceConnectionImpl::CreateApp( + google::cloud::ces::v1::CreateAppRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = idempotency_policy(*current)->CreateApp(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::ces::v1::App>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::CreateAppRequest const& request) { + return stub->AsyncCreateApp(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::ces::v1::App>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AgentServiceConnectionImpl::CreateApp( + NoAwaitTag, google::cloud::ces::v1::CreateAppRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateApp(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppRequest const& request) { + return stub_->CreateApp(context, options, request); + }, + *current, request, __func__); +} + +future> +AgentServiceConnectionImpl::CreateApp( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateApp", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::ces::v1::App>( + 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::ces::v1::App>, + polling_policy(*current), __func__); +} + +StatusOr AgentServiceConnectionImpl::UpdateApp( + google::cloud::ces::v1::UpdateAppRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateApp(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAppRequest const& request) { + return stub_->UpdateApp(context, options, request); + }, + *current, request, __func__); +} + +future> +AgentServiceConnectionImpl::DeleteApp( + google::cloud::ces::v1::DeleteAppRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = idempotency_policy(*current)->DeleteApp(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::ces::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::ces::v1::DeleteAppRequest const& request) { + return stub->AsyncDeleteApp(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::ces::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AgentServiceConnectionImpl::DeleteApp( + NoAwaitTag, google::cloud::ces::v1::DeleteAppRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteApp(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppRequest const& request) { + return stub_->DeleteApp(context, options, request); + }, + *current, request, __func__); +} + +future> +AgentServiceConnectionImpl::DeleteApp( + 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 DeleteApp", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::ces::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::ces::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +future> +AgentServiceConnectionImpl::ExportApp( + google::cloud::ces::v1::ExportAppRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = idempotency_policy(*current)->ExportApp(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::ces::v1::ExportAppResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ExportAppRequest const& request) { + return stub->AsyncExportApp(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::ces::v1::ExportAppResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AgentServiceConnectionImpl::ExportApp( + NoAwaitTag, google::cloud::ces::v1::ExportAppRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ExportApp(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExportAppRequest const& request) { + return stub_->ExportApp(context, options, request); + }, + *current, request, __func__); +} + +future> +AgentServiceConnectionImpl::ExportApp( + 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 ExportApp", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::ces::v1::ExportAppResponse>( + 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::ces::v1::ExportAppResponse>, + polling_policy(*current), __func__); +} + +future> +AgentServiceConnectionImpl::ImportApp( + google::cloud::ces::v1::ImportAppRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = idempotency_policy(*current)->ImportApp(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::ces::v1::ImportAppResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ImportAppRequest const& request) { + return stub->AsyncImportApp(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::ces::v1::ImportAppResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AgentServiceConnectionImpl::ImportApp( + NoAwaitTag, google::cloud::ces::v1::ImportAppRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ImportApp(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ImportAppRequest const& request) { + return stub_->ImportApp(context, options, request); + }, + *current, request, __func__); +} + +future> +AgentServiceConnectionImpl::ImportApp( + 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 ImportApp", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::ces::v1::ImportAppResponse>( + 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::ces::v1::ImportAppResponse>, + polling_policy(*current), __func__); +} + +StreamRange +AgentServiceConnectionImpl::ListAgents( + google::cloud::ces::v1::ListAgentsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListAgents(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::ces::v1::ListAgentsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAgentsRequest const& request) { + return stub->ListAgents(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::ces::v1::ListAgentsResponse r) { + std::vector result(r.agents().size()); + auto& messages = *r.mutable_agents(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr AgentServiceConnectionImpl::GetAgent( + google::cloud::ces::v1::GetAgentRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetAgent(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAgentRequest const& request) { + return stub_->GetAgent(context, options, request); + }, + *current, request, __func__); +} + +StatusOr AgentServiceConnectionImpl::CreateAgent( + google::cloud::ces::v1::CreateAgentRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateAgent(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAgentRequest const& request) { + return stub_->CreateAgent(context, options, request); + }, + *current, request, __func__); +} + +StatusOr AgentServiceConnectionImpl::UpdateAgent( + google::cloud::ces::v1::UpdateAgentRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateAgent(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAgentRequest const& request) { + return stub_->UpdateAgent(context, options, request); + }, + *current, request, __func__); +} + +Status AgentServiceConnectionImpl::DeleteAgent( + google::cloud::ces::v1::DeleteAgentRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteAgent(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAgentRequest const& request) { + return stub_->DeleteAgent(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +AgentServiceConnectionImpl::ListExamples( + google::cloud::ces::v1::ListExamplesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListExamples(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::ces::v1::ListExamplesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListExamplesRequest const& request) { + return stub->ListExamples(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::ces::v1::ListExamplesResponse r) { + std::vector result( + r.examples().size()); + auto& messages = *r.mutable_examples(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AgentServiceConnectionImpl::GetExample( + google::cloud::ces::v1::GetExampleRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetExample(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetExampleRequest const& request) { + return stub_->GetExample(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +AgentServiceConnectionImpl::CreateExample( + google::cloud::ces::v1::CreateExampleRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateExample(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateExampleRequest const& request) { + return stub_->CreateExample(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +AgentServiceConnectionImpl::UpdateExample( + google::cloud::ces::v1::UpdateExampleRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateExample(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateExampleRequest const& request) { + return stub_->UpdateExample(context, options, request); + }, + *current, request, __func__); +} + +Status AgentServiceConnectionImpl::DeleteExample( + google::cloud::ces::v1::DeleteExampleRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteExample(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteExampleRequest const& request) { + return stub_->DeleteExample(context, options, request); + }, + *current, request, __func__); +} + +StreamRange AgentServiceConnectionImpl::ListTools( + google::cloud::ces::v1::ListToolsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListTools(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::ces::v1::ListToolsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsRequest const& request) { + return stub->ListTools(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::ces::v1::ListToolsResponse r) { + std::vector result(r.tools().size()); + auto& messages = *r.mutable_tools(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr AgentServiceConnectionImpl::GetTool( + google::cloud::ces::v1::GetToolRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetTool(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolRequest const& request) { + return stub_->GetTool(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +AgentServiceConnectionImpl::ListConversations( + google::cloud::ces::v1::ListConversationsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListConversations(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::ces::v1::ListConversationsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListConversationsRequest const& + request) { + return stub->ListConversations(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::ces::v1::ListConversationsResponse r) { + std::vector result( + r.conversations().size()); + auto& messages = *r.mutable_conversations(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AgentServiceConnectionImpl::GetConversation( + google::cloud::ces::v1::GetConversationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetConversation(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetConversationRequest const& request) { + return stub_->GetConversation(context, options, request); + }, + *current, request, __func__); +} + +Status AgentServiceConnectionImpl::DeleteConversation( + google::cloud::ces::v1::DeleteConversationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteConversation(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteConversationRequest const& request) { + return stub_->DeleteConversation(context, options, request); + }, + *current, request, __func__); +} + +future> +AgentServiceConnectionImpl::BatchDeleteConversations( + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->BatchDeleteConversations(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::ces::v1::BatchDeleteConversationsResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& + request) { + return stub->AsyncBatchDeleteConversations(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::ces::v1::BatchDeleteConversationsResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AgentServiceConnectionImpl::BatchDeleteConversations( + NoAwaitTag, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->BatchDeleteConversations(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& + request) { + return stub_->BatchDeleteConversations(context, options, request); + }, + *current, request, __func__); +} + +future> +AgentServiceConnectionImpl::BatchDeleteConversations( + 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 BatchDeleteConversations", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::ces::v1::BatchDeleteConversationsResponse>( + 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::ces::v1::BatchDeleteConversationsResponse>, + polling_policy(*current), __func__); +} + +StatusOr AgentServiceConnectionImpl::CreateTool( + google::cloud::ces::v1::CreateToolRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateTool(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolRequest const& request) { + return stub_->CreateTool(context, options, request); + }, + *current, request, __func__); +} + +StatusOr AgentServiceConnectionImpl::UpdateTool( + google::cloud::ces::v1::UpdateToolRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateTool(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolRequest const& request) { + return stub_->UpdateTool(context, options, request); + }, + *current, request, __func__); +} + +Status AgentServiceConnectionImpl::DeleteTool( + google::cloud::ces::v1::DeleteToolRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteTool(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolRequest const& request) { + return stub_->DeleteTool(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +AgentServiceConnectionImpl::ListGuardrails( + google::cloud::ces::v1::ListGuardrailsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListGuardrails(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::ces::v1::ListGuardrailsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListGuardrailsRequest const& request) { + return stub->ListGuardrails(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::ces::v1::ListGuardrailsResponse r) { + std::vector result( + r.guardrails().size()); + auto& messages = *r.mutable_guardrails(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AgentServiceConnectionImpl::GetGuardrail( + google::cloud::ces::v1::GetGuardrailRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetGuardrail(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetGuardrailRequest const& request) { + return stub_->GetGuardrail(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +AgentServiceConnectionImpl::CreateGuardrail( + google::cloud::ces::v1::CreateGuardrailRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateGuardrail(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateGuardrailRequest const& request) { + return stub_->CreateGuardrail(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +AgentServiceConnectionImpl::UpdateGuardrail( + google::cloud::ces::v1::UpdateGuardrailRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateGuardrail(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateGuardrailRequest const& request) { + return stub_->UpdateGuardrail(context, options, request); + }, + *current, request, __func__); +} + +Status AgentServiceConnectionImpl::DeleteGuardrail( + google::cloud::ces::v1::DeleteGuardrailRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteGuardrail(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteGuardrailRequest const& request) { + return stub_->DeleteGuardrail(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +AgentServiceConnectionImpl::ListDeployments( + google::cloud::ces::v1::ListDeploymentsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListDeployments(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::ces::v1::ListDeploymentsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListDeploymentsRequest const& request) { + return stub->ListDeployments(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::ces::v1::ListDeploymentsResponse r) { + std::vector result( + r.deployments().size()); + auto& messages = *r.mutable_deployments(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AgentServiceConnectionImpl::GetDeployment( + google::cloud::ces::v1::GetDeploymentRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetDeployment(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetDeploymentRequest const& request) { + return stub_->GetDeployment(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +AgentServiceConnectionImpl::CreateDeployment( + google::cloud::ces::v1::CreateDeploymentRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateDeployment(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateDeploymentRequest const& request) { + return stub_->CreateDeployment(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +AgentServiceConnectionImpl::UpdateDeployment( + google::cloud::ces::v1::UpdateDeploymentRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateDeployment(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateDeploymentRequest const& request) { + return stub_->UpdateDeployment(context, options, request); + }, + *current, request, __func__); +} + +Status AgentServiceConnectionImpl::DeleteDeployment( + google::cloud::ces::v1::DeleteDeploymentRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteDeployment(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteDeploymentRequest const& request) { + return stub_->DeleteDeployment(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +AgentServiceConnectionImpl::ListToolsets( + google::cloud::ces::v1::ListToolsetsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListToolsets(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::ces::v1::ListToolsetsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsetsRequest const& request) { + return stub->ListToolsets(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::ces::v1::ListToolsetsResponse r) { + std::vector result( + r.toolsets().size()); + auto& messages = *r.mutable_toolsets(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AgentServiceConnectionImpl::GetToolset( + google::cloud::ces::v1::GetToolsetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetToolset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolsetRequest const& request) { + return stub_->GetToolset(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +AgentServiceConnectionImpl::CreateToolset( + google::cloud::ces::v1::CreateToolsetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateToolset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolsetRequest const& request) { + return stub_->CreateToolset(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +AgentServiceConnectionImpl::UpdateToolset( + google::cloud::ces::v1::UpdateToolsetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateToolset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolsetRequest const& request) { + return stub_->UpdateToolset(context, options, request); + }, + *current, request, __func__); +} + +Status AgentServiceConnectionImpl::DeleteToolset( + google::cloud::ces::v1::DeleteToolsetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteToolset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolsetRequest const& request) { + return stub_->DeleteToolset(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +AgentServiceConnectionImpl::ListAppVersions( + google::cloud::ces::v1::ListAppVersionsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListAppVersions(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::ces::v1::ListAppVersionsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppVersionsRequest const& request) { + return stub->ListAppVersions(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::ces::v1::ListAppVersionsResponse r) { + std::vector result( + r.app_versions().size()); + auto& messages = *r.mutable_app_versions(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AgentServiceConnectionImpl::GetAppVersion( + google::cloud::ces::v1::GetAppVersionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetAppVersion(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppVersionRequest const& request) { + return stub_->GetAppVersion(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +AgentServiceConnectionImpl::CreateAppVersion( + google::cloud::ces::v1::CreateAppVersionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateAppVersion(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppVersionRequest const& request) { + return stub_->CreateAppVersion(context, options, request); + }, + *current, request, __func__); +} + +Status AgentServiceConnectionImpl::DeleteAppVersion( + google::cloud::ces::v1::DeleteAppVersionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteAppVersion(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppVersionRequest const& request) { + return stub_->DeleteAppVersion(context, options, request); + }, + *current, request, __func__); +} + +future> +AgentServiceConnectionImpl::RestoreAppVersion( + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->RestoreAppVersion(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::ces::v1::RestoreAppVersionResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + return stub->AsyncRestoreAppVersion(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::ces::v1::RestoreAppVersionResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AgentServiceConnectionImpl::RestoreAppVersion( + NoAwaitTag, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->RestoreAppVersion(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + return stub_->RestoreAppVersion(context, options, request); + }, + *current, request, __func__); +} + +future> +AgentServiceConnectionImpl::RestoreAppVersion( + 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 RestoreAppVersion", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::ces::v1::RestoreAppVersionResponse>( + 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::ces::v1::RestoreAppVersionResponse>, + polling_policy(*current), __func__); +} + +StreamRange +AgentServiceConnectionImpl::ListChangelogs( + google::cloud::ces::v1::ListChangelogsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListChangelogs(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::ces::v1::ListChangelogsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListChangelogsRequest const& request) { + return stub->ListChangelogs(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::ces::v1::ListChangelogsResponse r) { + std::vector result( + r.changelogs().size()); + auto& messages = *r.mutable_changelogs(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AgentServiceConnectionImpl::GetChangelog( + google::cloud::ces::v1::GetChangelogRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetChangelog(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetChangelogRequest const& request) { + return stub_->GetChangelog(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +AgentServiceConnectionImpl::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 +AgentServiceConnectionImpl::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 +AgentServiceConnectionImpl::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 +AgentServiceConnectionImpl::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 AgentServiceConnectionImpl::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 AgentServiceConnectionImpl::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 ces_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/internal/agent_connection_impl.h b/google/cloud/ces/v1/internal/agent_connection_impl.h new file mode 100644 index 0000000000000..08a73eabf8bc5 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_connection_impl.h @@ -0,0 +1,274 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_CONNECTION_IMPL_H + +#include "google/cloud/ces/v1/agent_connection.h" +#include "google/cloud/ces/v1/agent_connection_idempotency_policy.h" +#include "google/cloud/ces/v1/agent_options.h" +#include "google/cloud/ces/v1/internal/agent_retry_traits.h" +#include "google/cloud/ces/v1/internal/agent_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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AgentServiceConnectionImpl : public ces_v1::AgentServiceConnection { + public: + ~AgentServiceConnectionImpl() override = default; + + AgentServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, Options options); + + Options options() override { return options_; } + + StreamRange ListApps( + google::cloud::ces::v1::ListAppsRequest request) override; + + StatusOr GetApp( + google::cloud::ces::v1::GetAppRequest const& request) override; + + future> CreateApp( + google::cloud::ces::v1::CreateAppRequest const& request) override; + + StatusOr CreateApp( + NoAwaitTag, + google::cloud::ces::v1::CreateAppRequest const& request) override; + + future> CreateApp( + google::longrunning::Operation const& operation) override; + + StatusOr UpdateApp( + google::cloud::ces::v1::UpdateAppRequest const& request) override; + + future> DeleteApp( + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + StatusOr DeleteApp( + NoAwaitTag, + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + future> DeleteApp( + google::longrunning::Operation const& operation) override; + + future> ExportApp( + google::cloud::ces::v1::ExportAppRequest const& request) override; + + StatusOr ExportApp( + NoAwaitTag, + google::cloud::ces::v1::ExportAppRequest const& request) override; + + future> ExportApp( + google::longrunning::Operation const& operation) override; + + future> ImportApp( + google::cloud::ces::v1::ImportAppRequest const& request) override; + + StatusOr ImportApp( + NoAwaitTag, + google::cloud::ces::v1::ImportAppRequest const& request) override; + + future> ImportApp( + google::longrunning::Operation const& operation) override; + + StreamRange ListAgents( + google::cloud::ces::v1::ListAgentsRequest request) override; + + StatusOr GetAgent( + google::cloud::ces::v1::GetAgentRequest const& request) override; + + StatusOr CreateAgent( + google::cloud::ces::v1::CreateAgentRequest const& request) override; + + StatusOr UpdateAgent( + google::cloud::ces::v1::UpdateAgentRequest const& request) override; + + Status DeleteAgent( + google::cloud::ces::v1::DeleteAgentRequest const& request) override; + + StreamRange ListExamples( + google::cloud::ces::v1::ListExamplesRequest request) override; + + StatusOr GetExample( + google::cloud::ces::v1::GetExampleRequest const& request) override; + + StatusOr CreateExample( + google::cloud::ces::v1::CreateExampleRequest const& request) override; + + StatusOr UpdateExample( + google::cloud::ces::v1::UpdateExampleRequest const& request) override; + + Status DeleteExample( + google::cloud::ces::v1::DeleteExampleRequest const& request) override; + + StreamRange ListTools( + google::cloud::ces::v1::ListToolsRequest request) override; + + StatusOr GetTool( + google::cloud::ces::v1::GetToolRequest const& request) override; + + StreamRange ListConversations( + google::cloud::ces::v1::ListConversationsRequest request) override; + + StatusOr GetConversation( + google::cloud::ces::v1::GetConversationRequest const& request) override; + + Status DeleteConversation( + google::cloud::ces::v1::DeleteConversationRequest const& request) + override; + + future> + BatchDeleteConversations( + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + StatusOr BatchDeleteConversations( + NoAwaitTag, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + future> + BatchDeleteConversations( + google::longrunning::Operation const& operation) override; + + StatusOr CreateTool( + google::cloud::ces::v1::CreateToolRequest const& request) override; + + StatusOr UpdateTool( + google::cloud::ces::v1::UpdateToolRequest const& request) override; + + Status DeleteTool( + google::cloud::ces::v1::DeleteToolRequest const& request) override; + + StreamRange ListGuardrails( + google::cloud::ces::v1::ListGuardrailsRequest request) override; + + StatusOr GetGuardrail( + google::cloud::ces::v1::GetGuardrailRequest const& request) override; + + StatusOr CreateGuardrail( + google::cloud::ces::v1::CreateGuardrailRequest const& request) override; + + StatusOr UpdateGuardrail( + google::cloud::ces::v1::UpdateGuardrailRequest const& request) override; + + Status DeleteGuardrail( + google::cloud::ces::v1::DeleteGuardrailRequest const& request) override; + + StreamRange ListDeployments( + google::cloud::ces::v1::ListDeploymentsRequest request) override; + + StatusOr GetDeployment( + google::cloud::ces::v1::GetDeploymentRequest const& request) override; + + StatusOr CreateDeployment( + google::cloud::ces::v1::CreateDeploymentRequest const& request) override; + + StatusOr UpdateDeployment( + google::cloud::ces::v1::UpdateDeploymentRequest const& request) override; + + Status DeleteDeployment( + google::cloud::ces::v1::DeleteDeploymentRequest const& request) override; + + StreamRange ListToolsets( + google::cloud::ces::v1::ListToolsetsRequest request) override; + + StatusOr GetToolset( + google::cloud::ces::v1::GetToolsetRequest const& request) override; + + StatusOr CreateToolset( + google::cloud::ces::v1::CreateToolsetRequest const& request) override; + + StatusOr UpdateToolset( + google::cloud::ces::v1::UpdateToolsetRequest const& request) override; + + Status DeleteToolset( + google::cloud::ces::v1::DeleteToolsetRequest const& request) override; + + StreamRange ListAppVersions( + google::cloud::ces::v1::ListAppVersionsRequest request) override; + + StatusOr GetAppVersion( + google::cloud::ces::v1::GetAppVersionRequest const& request) override; + + StatusOr CreateAppVersion( + google::cloud::ces::v1::CreateAppVersionRequest const& request) override; + + Status DeleteAppVersion( + google::cloud::ces::v1::DeleteAppVersionRequest const& request) override; + + future> + RestoreAppVersion( + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + StatusOr RestoreAppVersion( + NoAwaitTag, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + future> + RestoreAppVersion(google::longrunning::Operation const& operation) override; + + StreamRange ListChangelogs( + google::cloud::ces::v1::ListChangelogsRequest request) override; + + StatusOr GetChangelog( + google::cloud::ces::v1::GetChangelogRequest const& request) 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 ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_CONNECTION_IMPL_H diff --git a/google/cloud/ces/v1/internal/agent_logging_decorator.cc b/google/cloud/ces/v1/internal/agent_logging_decorator.cc new file mode 100644 index 0000000000000..ca1afdf420ec2 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_logging_decorator.cc @@ -0,0 +1,804 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#include "google/cloud/ces/v1/internal/agent_logging_decorator.h" +#include "google/cloud/ces/v1/agent_service.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AgentServiceLogging::AgentServiceLogging( + std::shared_ptr child, TracingOptions tracing_options, + std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +AgentServiceLogging::ListApps( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppsRequest const& request) { + return child_->ListApps(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::GetApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppRequest const& request) { + return child_->GetApp(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AgentServiceLogging::AsyncCreateApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::CreateAppRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::CreateAppRequest const& request) { + return child_->AsyncCreateApp(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AgentServiceLogging::CreateApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::CreateAppRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppRequest const& request) { + return child_->CreateApp(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::UpdateApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAppRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAppRequest const& request) { + return child_->UpdateApp(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AgentServiceLogging::AsyncDeleteApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::DeleteAppRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::DeleteAppRequest const& request) { + return child_->AsyncDeleteApp(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AgentServiceLogging::DeleteApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::DeleteAppRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppRequest const& request) { + return child_->DeleteApp(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AgentServiceLogging::AsyncExportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ExportAppRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ExportAppRequest const& request) { + return child_->AsyncExportApp(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AgentServiceLogging::ExportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ExportAppRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExportAppRequest const& request) { + return child_->ExportApp(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AgentServiceLogging::AsyncImportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ImportAppRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ImportAppRequest const& request) { + return child_->AsyncImportApp(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AgentServiceLogging::ImportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ImportAppRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ImportAppRequest const& request) { + return child_->ImportApp(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::ListAgents( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAgentsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAgentsRequest const& request) { + return child_->ListAgents(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::GetAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAgentRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAgentRequest const& request) { + return child_->GetAgent(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::CreateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAgentRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAgentRequest const& request) { + return child_->CreateAgent(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::UpdateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAgentRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAgentRequest const& request) { + return child_->UpdateAgent(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status AgentServiceLogging::DeleteAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAgentRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAgentRequest const& request) { + return child_->DeleteAgent(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::ListExamples( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListExamplesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListExamplesRequest const& request) { + return child_->ListExamples(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::GetExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetExampleRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetExampleRequest const& request) { + return child_->GetExample(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::CreateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateExampleRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateExampleRequest const& request) { + return child_->CreateExample(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::UpdateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateExampleRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateExampleRequest const& request) { + return child_->UpdateExample(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status AgentServiceLogging::DeleteExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteExampleRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteExampleRequest const& request) { + return child_->DeleteExample(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::ListTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsRequest const& request) { + return child_->ListTools(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::GetTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolRequest const& request) { + return child_->GetTool(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::ListConversations( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListConversationsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListConversationsRequest const& request) { + return child_->ListConversations(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::GetConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetConversationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetConversationRequest const& request) { + return child_->GetConversation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status AgentServiceLogging::DeleteConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteConversationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteConversationRequest const& request) { + return child_->DeleteConversation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AgentServiceLogging::AsyncBatchDeleteConversations( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& + request) { + return child_->AsyncBatchDeleteConversations( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +AgentServiceLogging::BatchDeleteConversations( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& + request) { + return child_->BatchDeleteConversations(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::CreateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolRequest const& request) { + return child_->CreateTool(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::UpdateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolRequest const& request) { + return child_->UpdateTool(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status AgentServiceLogging::DeleteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolRequest const& request) { + return child_->DeleteTool(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::ListGuardrails( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListGuardrailsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListGuardrailsRequest const& request) { + return child_->ListGuardrails(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::GetGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetGuardrailRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetGuardrailRequest const& request) { + return child_->GetGuardrail(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::CreateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateGuardrailRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateGuardrailRequest const& request) { + return child_->CreateGuardrail(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::UpdateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateGuardrailRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateGuardrailRequest const& request) { + return child_->UpdateGuardrail(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status AgentServiceLogging::DeleteGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteGuardrailRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteGuardrailRequest const& request) { + return child_->DeleteGuardrail(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::ListDeployments( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListDeploymentsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListDeploymentsRequest const& request) { + return child_->ListDeployments(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::GetDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetDeploymentRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetDeploymentRequest const& request) { + return child_->GetDeployment(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::CreateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateDeploymentRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateDeploymentRequest const& request) { + return child_->CreateDeployment(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::UpdateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateDeploymentRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateDeploymentRequest const& request) { + return child_->UpdateDeployment(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status AgentServiceLogging::DeleteDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteDeploymentRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteDeploymentRequest const& request) { + return child_->DeleteDeployment(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::ListToolsets( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsetsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsetsRequest const& request) { + return child_->ListToolsets(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::GetToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolsetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolsetRequest const& request) { + return child_->GetToolset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::CreateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolsetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolsetRequest const& request) { + return child_->CreateToolset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::UpdateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolsetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolsetRequest const& request) { + return child_->UpdateToolset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status AgentServiceLogging::DeleteToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolsetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolsetRequest const& request) { + return child_->DeleteToolset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::ListAppVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppVersionsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppVersionsRequest const& request) { + return child_->ListAppVersions(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::GetAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppVersionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppVersionRequest const& request) { + return child_->GetAppVersion(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::CreateAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppVersionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppVersionRequest const& request) { + return child_->CreateAppVersion(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status AgentServiceLogging::DeleteAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppVersionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppVersionRequest const& request) { + return child_->DeleteAppVersion(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AgentServiceLogging::AsyncRestoreAppVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + return child_->AsyncRestoreAppVersion(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AgentServiceLogging::RestoreAppVersion( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + return child_->RestoreAppVersion(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::ListChangelogs( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListChangelogsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListChangelogsRequest const& request) { + return child_->ListChangelogs(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AgentServiceLogging::GetChangelog( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetChangelogRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetChangelogRequest const& request) { + return child_->GetChangelog(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AgentServiceLogging::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 AgentServiceLogging::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 +AgentServiceLogging::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 AgentServiceLogging::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 AgentServiceLogging::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 AgentServiceLogging::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> +AgentServiceLogging::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 AgentServiceLogging::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 ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/agent_logging_decorator.h b/google/cloud/ces/v1/internal/agent_logging_decorator.h new file mode 100644 index 0000000000000..2e9863287534d --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_logging_decorator.h @@ -0,0 +1,325 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_LOGGING_DECORATOR_H + +#include "google/cloud/ces/v1/internal/agent_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AgentServiceLogging : public AgentServiceStub { + public: + ~AgentServiceLogging() override = default; + AgentServiceLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr ListApps( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppsRequest const& request) override; + + StatusOr GetApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppRequest const& request) override; + + future> AsyncCreateApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::CreateAppRequest const& request) override; + + StatusOr CreateApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::CreateAppRequest const& request) override; + + StatusOr UpdateApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAppRequest const& request) override; + + future> AsyncDeleteApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + StatusOr DeleteApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + future> AsyncExportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ExportAppRequest const& request) override; + + StatusOr ExportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ExportAppRequest const& request) override; + + future> AsyncImportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ImportAppRequest const& request) override; + + StatusOr ImportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ImportAppRequest const& request) override; + + StatusOr ListAgents( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAgentsRequest const& request) override; + + StatusOr GetAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAgentRequest const& request) override; + + StatusOr CreateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAgentRequest const& request) override; + + StatusOr UpdateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAgentRequest const& request) override; + + Status DeleteAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAgentRequest const& request) override; + + StatusOr ListExamples( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListExamplesRequest const& request) override; + + StatusOr GetExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetExampleRequest const& request) override; + + StatusOr CreateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateExampleRequest const& request) override; + + StatusOr UpdateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateExampleRequest const& request) override; + + Status DeleteExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteExampleRequest const& request) override; + + StatusOr ListTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsRequest const& request) override; + + StatusOr GetTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolRequest const& request) override; + + StatusOr ListConversations( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListConversationsRequest const& request) override; + + StatusOr GetConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetConversationRequest const& request) override; + + Status DeleteConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteConversationRequest const& request) + override; + + future> + AsyncBatchDeleteConversations( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + StatusOr BatchDeleteConversations( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + StatusOr CreateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolRequest const& request) override; + + StatusOr UpdateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolRequest const& request) override; + + Status DeleteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolRequest const& request) override; + + StatusOr ListGuardrails( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListGuardrailsRequest const& request) override; + + StatusOr GetGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetGuardrailRequest const& request) override; + + StatusOr CreateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateGuardrailRequest const& request) override; + + StatusOr UpdateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateGuardrailRequest const& request) override; + + Status DeleteGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteGuardrailRequest const& request) override; + + StatusOr ListDeployments( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListDeploymentsRequest const& request) override; + + StatusOr GetDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetDeploymentRequest const& request) override; + + StatusOr CreateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateDeploymentRequest const& request) override; + + StatusOr UpdateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateDeploymentRequest const& request) override; + + Status DeleteDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteDeploymentRequest const& request) override; + + StatusOr ListToolsets( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsetsRequest const& request) override; + + StatusOr GetToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolsetRequest const& request) override; + + StatusOr CreateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolsetRequest const& request) override; + + StatusOr UpdateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolsetRequest const& request) override; + + Status DeleteToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolsetRequest const& request) override; + + StatusOr ListAppVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppVersionsRequest const& request) override; + + StatusOr GetAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppVersionRequest const& request) override; + + StatusOr CreateAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppVersionRequest const& request) override; + + Status DeleteAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppVersionRequest const& request) override; + + future> AsyncRestoreAppVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + StatusOr RestoreAppVersion( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + StatusOr ListChangelogs( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListChangelogsRequest const& request) override; + + StatusOr GetChangelog( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetChangelogRequest 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_; +}; // AgentServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_LOGGING_DECORATOR_H diff --git a/google/cloud/ces/v1/internal/agent_metadata_decorator.cc b/google/cloud/ces/v1/internal/agent_metadata_decorator.cc new file mode 100644 index 0000000000000..f84bc7f3eddc7 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_metadata_decorator.cc @@ -0,0 +1,625 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#include "google/cloud/ces/v1/internal/agent_metadata_decorator.h" +#include "google/cloud/ces/v1/agent_service.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AgentServiceMetadata::AgentServiceMetadata( + 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 +AgentServiceMetadata::ListApps( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListApps(context, options, request); +} + +StatusOr AgentServiceMetadata::GetApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetApp(context, options, request); +} + +future> +AgentServiceMetadata::AsyncCreateApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::CreateAppRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateApp(cq, std::move(context), std::move(options), + request); +} + +StatusOr AgentServiceMetadata::CreateApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::CreateAppRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateApp(context, options, request); +} + +StatusOr AgentServiceMetadata::UpdateApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAppRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("app.name=", internal::UrlEncode(request.app().name()))); + return child_->UpdateApp(context, options, request); +} + +future> +AgentServiceMetadata::AsyncDeleteApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::DeleteAppRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteApp(cq, std::move(context), std::move(options), + request); +} + +StatusOr AgentServiceMetadata::DeleteApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::DeleteAppRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteApp(context, options, request); +} + +future> +AgentServiceMetadata::AsyncExportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ExportAppRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncExportApp(cq, std::move(context), std::move(options), + request); +} + +StatusOr AgentServiceMetadata::ExportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ExportAppRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->ExportApp(context, options, request); +} + +future> +AgentServiceMetadata::AsyncImportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ImportAppRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncImportApp(cq, std::move(context), std::move(options), + request); +} + +StatusOr AgentServiceMetadata::ImportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ImportAppRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ImportApp(context, options, request); +} + +StatusOr +AgentServiceMetadata::ListAgents( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAgentsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListAgents(context, options, request); +} + +StatusOr AgentServiceMetadata::GetAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAgentRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetAgent(context, options, request); +} + +StatusOr AgentServiceMetadata::CreateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAgentRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateAgent(context, options, request); +} + +StatusOr AgentServiceMetadata::UpdateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAgentRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("agent.name=", internal::UrlEncode(request.agent().name()))); + return child_->UpdateAgent(context, options, request); +} + +Status AgentServiceMetadata::DeleteAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAgentRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteAgent(context, options, request); +} + +StatusOr +AgentServiceMetadata::ListExamples( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListExamplesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListExamples(context, options, request); +} + +StatusOr AgentServiceMetadata::GetExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetExampleRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetExample(context, options, request); +} + +StatusOr AgentServiceMetadata::CreateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateExampleRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateExample(context, options, request); +} + +StatusOr AgentServiceMetadata::UpdateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateExampleRequest const& request) { + SetMetadata(context, options, + absl::StrCat("example.name=", + internal::UrlEncode(request.example().name()))); + return child_->UpdateExample(context, options, request); +} + +Status AgentServiceMetadata::DeleteExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteExampleRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteExample(context, options, request); +} + +StatusOr +AgentServiceMetadata::ListTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListTools(context, options, request); +} + +StatusOr AgentServiceMetadata::GetTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetTool(context, options, request); +} + +StatusOr +AgentServiceMetadata::ListConversations( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListConversationsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListConversations(context, options, request); +} + +StatusOr +AgentServiceMetadata::GetConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetConversationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetConversation(context, options, request); +} + +Status AgentServiceMetadata::DeleteConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteConversationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteConversation(context, options, request); +} + +future> +AgentServiceMetadata::AsyncBatchDeleteConversations( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncBatchDeleteConversations(cq, std::move(context), + std::move(options), request); +} + +StatusOr +AgentServiceMetadata::BatchDeleteConversations( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->BatchDeleteConversations(context, options, request); +} + +StatusOr AgentServiceMetadata::CreateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateTool(context, options, request); +} + +StatusOr AgentServiceMetadata::UpdateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("tool.name=", internal::UrlEncode(request.tool().name()))); + return child_->UpdateTool(context, options, request); +} + +Status AgentServiceMetadata::DeleteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteTool(context, options, request); +} + +StatusOr +AgentServiceMetadata::ListGuardrails( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListGuardrailsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListGuardrails(context, options, request); +} + +StatusOr AgentServiceMetadata::GetGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetGuardrailRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetGuardrail(context, options, request); +} + +StatusOr +AgentServiceMetadata::CreateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateGuardrailRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateGuardrail(context, options, request); +} + +StatusOr +AgentServiceMetadata::UpdateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateGuardrailRequest const& request) { + SetMetadata(context, options, + absl::StrCat("guardrail.name=", + internal::UrlEncode(request.guardrail().name()))); + return child_->UpdateGuardrail(context, options, request); +} + +Status AgentServiceMetadata::DeleteGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteGuardrailRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteGuardrail(context, options, request); +} + +StatusOr +AgentServiceMetadata::ListDeployments( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListDeploymentsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListDeployments(context, options, request); +} + +StatusOr +AgentServiceMetadata::GetDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetDeploymentRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetDeployment(context, options, request); +} + +StatusOr +AgentServiceMetadata::CreateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateDeploymentRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateDeployment(context, options, request); +} + +StatusOr +AgentServiceMetadata::UpdateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateDeploymentRequest const& request) { + SetMetadata(context, options, + absl::StrCat("deployment.name=", + internal::UrlEncode(request.deployment().name()))); + return child_->UpdateDeployment(context, options, request); +} + +Status AgentServiceMetadata::DeleteDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteDeploymentRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteDeployment(context, options, request); +} + +StatusOr +AgentServiceMetadata::ListToolsets( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsetsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListToolsets(context, options, request); +} + +StatusOr AgentServiceMetadata::GetToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolsetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetToolset(context, options, request); +} + +StatusOr AgentServiceMetadata::CreateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolsetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateToolset(context, options, request); +} + +StatusOr AgentServiceMetadata::UpdateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolsetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("toolset.name=", + internal::UrlEncode(request.toolset().name()))); + return child_->UpdateToolset(context, options, request); +} + +Status AgentServiceMetadata::DeleteToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolsetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteToolset(context, options, request); +} + +StatusOr +AgentServiceMetadata::ListAppVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppVersionsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListAppVersions(context, options, request); +} + +StatusOr +AgentServiceMetadata::GetAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppVersionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetAppVersion(context, options, request); +} + +StatusOr +AgentServiceMetadata::CreateAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppVersionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateAppVersion(context, options, request); +} + +Status AgentServiceMetadata::DeleteAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppVersionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteAppVersion(context, options, request); +} + +future> +AgentServiceMetadata::AsyncRestoreAppVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncRestoreAppVersion(cq, std::move(context), + std::move(options), request); +} + +StatusOr +AgentServiceMetadata::RestoreAppVersion( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->RestoreAppVersion(context, options, request); +} + +StatusOr +AgentServiceMetadata::ListChangelogs( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListChangelogsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListChangelogs(context, options, request); +} + +StatusOr AgentServiceMetadata::GetChangelog( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetChangelogRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetChangelog(context, options, request); +} + +StatusOr +AgentServiceMetadata::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 AgentServiceMetadata::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 +AgentServiceMetadata::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 AgentServiceMetadata::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 AgentServiceMetadata::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 AgentServiceMetadata::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> +AgentServiceMetadata::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 AgentServiceMetadata::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 AgentServiceMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void AgentServiceMetadata::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 ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/agent_metadata_decorator.h b/google/cloud/ces/v1/internal/agent_metadata_decorator.h new file mode 100644 index 0000000000000..4a81aa926429b --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_metadata_decorator.h @@ -0,0 +1,330 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_METADATA_DECORATOR_H + +#include "google/cloud/ces/v1/internal/agent_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AgentServiceMetadata : public AgentServiceStub { + public: + ~AgentServiceMetadata() override = default; + AgentServiceMetadata(std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr ListApps( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppsRequest const& request) override; + + StatusOr GetApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppRequest const& request) override; + + future> AsyncCreateApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::CreateAppRequest const& request) override; + + StatusOr CreateApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::CreateAppRequest const& request) override; + + StatusOr UpdateApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAppRequest const& request) override; + + future> AsyncDeleteApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + StatusOr DeleteApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + future> AsyncExportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ExportAppRequest const& request) override; + + StatusOr ExportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ExportAppRequest const& request) override; + + future> AsyncImportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ImportAppRequest const& request) override; + + StatusOr ImportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ImportAppRequest const& request) override; + + StatusOr ListAgents( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAgentsRequest const& request) override; + + StatusOr GetAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAgentRequest const& request) override; + + StatusOr CreateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAgentRequest const& request) override; + + StatusOr UpdateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAgentRequest const& request) override; + + Status DeleteAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAgentRequest const& request) override; + + StatusOr ListExamples( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListExamplesRequest const& request) override; + + StatusOr GetExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetExampleRequest const& request) override; + + StatusOr CreateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateExampleRequest const& request) override; + + StatusOr UpdateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateExampleRequest const& request) override; + + Status DeleteExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteExampleRequest const& request) override; + + StatusOr ListTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsRequest const& request) override; + + StatusOr GetTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolRequest const& request) override; + + StatusOr ListConversations( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListConversationsRequest const& request) override; + + StatusOr GetConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetConversationRequest const& request) override; + + Status DeleteConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteConversationRequest const& request) + override; + + future> + AsyncBatchDeleteConversations( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + StatusOr BatchDeleteConversations( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + StatusOr CreateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolRequest const& request) override; + + StatusOr UpdateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolRequest const& request) override; + + Status DeleteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolRequest const& request) override; + + StatusOr ListGuardrails( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListGuardrailsRequest const& request) override; + + StatusOr GetGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetGuardrailRequest const& request) override; + + StatusOr CreateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateGuardrailRequest const& request) override; + + StatusOr UpdateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateGuardrailRequest const& request) override; + + Status DeleteGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteGuardrailRequest const& request) override; + + StatusOr ListDeployments( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListDeploymentsRequest const& request) override; + + StatusOr GetDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetDeploymentRequest const& request) override; + + StatusOr CreateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateDeploymentRequest const& request) override; + + StatusOr UpdateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateDeploymentRequest const& request) override; + + Status DeleteDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteDeploymentRequest const& request) override; + + StatusOr ListToolsets( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsetsRequest const& request) override; + + StatusOr GetToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolsetRequest const& request) override; + + StatusOr CreateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolsetRequest const& request) override; + + StatusOr UpdateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolsetRequest const& request) override; + + Status DeleteToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolsetRequest const& request) override; + + StatusOr ListAppVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppVersionsRequest const& request) override; + + StatusOr GetAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppVersionRequest const& request) override; + + StatusOr CreateAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppVersionRequest const& request) override; + + Status DeleteAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppVersionRequest const& request) override; + + future> AsyncRestoreAppVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + StatusOr RestoreAppVersion( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + StatusOr ListChangelogs( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListChangelogsRequest const& request) override; + + StatusOr GetChangelog( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetChangelogRequest 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 ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_METADATA_DECORATOR_H diff --git a/google/cloud/ces/v1/internal/agent_option_defaults.cc b/google/cloud/ces/v1/internal/agent_option_defaults.cc new file mode 100644 index 0000000000000..aac8b15f28571 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_option_defaults.cc @@ -0,0 +1,74 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#include "google/cloud/ces/v1/internal/agent_option_defaults.h" +#include "google/cloud/ces/v1/agent_connection.h" +#include "google/cloud/ces/v1/agent_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 ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options AgentServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_AGENT_SERVICE_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_AGENT_SERVICE_AUTHORITY", "ces.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + ces_v1::AgentServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) + .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( + options.get()->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } + if (!options.has()) { + options.set( + ces_v1::MakeDefaultAgentServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/internal/agent_option_defaults.h b/google/cloud/ces/v1/internal/agent_option_defaults.h new file mode 100644 index 0000000000000..cd2949cb2a312 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options AgentServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_OPTION_DEFAULTS_H diff --git a/google/cloud/ces/v1/internal/agent_retry_traits.h b/google/cloud/ces/v1/internal/agent_retry_traits.h new file mode 100644 index 0000000000000..27023a2c840f9 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct AgentServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_RETRY_TRAITS_H diff --git a/google/cloud/ces/v1/internal/agent_sources.cc b/google/cloud/ces/v1/internal/agent_sources.cc new file mode 100644 index 0000000000000..d1630bf1dbb49 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/ces/v1/agent_client.cc" +#include "google/cloud/ces/v1/agent_connection.cc" +#include "google/cloud/ces/v1/agent_connection_idempotency_policy.cc" +#include "google/cloud/ces/v1/internal/agent_auth_decorator.cc" +#include "google/cloud/ces/v1/internal/agent_connection_impl.cc" +#include "google/cloud/ces/v1/internal/agent_logging_decorator.cc" +#include "google/cloud/ces/v1/internal/agent_metadata_decorator.cc" +#include "google/cloud/ces/v1/internal/agent_option_defaults.cc" +#include "google/cloud/ces/v1/internal/agent_stub.cc" +#include "google/cloud/ces/v1/internal/agent_stub_factory.cc" +#include "google/cloud/ces/v1/internal/agent_tracing_connection.cc" +#include "google/cloud/ces/v1/internal/agent_tracing_stub.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/ces/v1/internal/agent_stub.cc b/google/cloud/ces/v1/internal/agent_stub.cc new file mode 100644 index 0000000000000..99cdce61f8adf --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_stub.cc @@ -0,0 +1,810 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#include "google/cloud/ces/v1/internal/agent_stub.h" +#include "google/cloud/ces/v1/agent_service.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AgentServiceStub::~AgentServiceStub() = default; + +StatusOr +DefaultAgentServiceStub::ListApps( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::ListAppsRequest const& request) { + google::cloud::ces::v1::ListAppsResponse response; + auto status = grpc_stub_->ListApps(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultAgentServiceStub::GetApp( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::GetAppRequest const& request) { + google::cloud::ces::v1::App response; + auto status = grpc_stub_->GetApp(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAgentServiceStub::AsyncCreateApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::ces::v1::CreateAppRequest const& request) { + return internal::MakeUnaryRpcImpl( + cq, + [this](grpc::ClientContext* context, + google::cloud::ces::v1::CreateAppRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateApp(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAgentServiceStub::CreateApp( + grpc::ClientContext& context, Options, + google::cloud::ces::v1::CreateAppRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateApp(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultAgentServiceStub::UpdateApp( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::UpdateAppRequest const& request) { + google::cloud::ces::v1::App response; + auto status = grpc_stub_->UpdateApp(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAgentServiceStub::AsyncDeleteApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::ces::v1::DeleteAppRequest const& request) { + return internal::MakeUnaryRpcImpl( + cq, + [this](grpc::ClientContext* context, + google::cloud::ces::v1::DeleteAppRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteApp(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAgentServiceStub::DeleteApp( + grpc::ClientContext& context, Options, + google::cloud::ces::v1::DeleteAppRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteApp(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAgentServiceStub::AsyncExportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::ces::v1::ExportAppRequest const& request) { + return internal::MakeUnaryRpcImpl( + cq, + [this](grpc::ClientContext* context, + google::cloud::ces::v1::ExportAppRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncExportApp(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAgentServiceStub::ExportApp( + grpc::ClientContext& context, Options, + google::cloud::ces::v1::ExportAppRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->ExportApp(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAgentServiceStub::AsyncImportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::ces::v1::ImportAppRequest const& request) { + return internal::MakeUnaryRpcImpl( + cq, + [this](grpc::ClientContext* context, + google::cloud::ces::v1::ImportAppRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncImportApp(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAgentServiceStub::ImportApp( + grpc::ClientContext& context, Options, + google::cloud::ces::v1::ImportAppRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->ImportApp(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::ListAgents( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::ListAgentsRequest const& request) { + google::cloud::ces::v1::ListAgentsResponse response; + auto status = grpc_stub_->ListAgents(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultAgentServiceStub::GetAgent( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::GetAgentRequest const& request) { + google::cloud::ces::v1::Agent response; + auto status = grpc_stub_->GetAgent(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultAgentServiceStub::CreateAgent( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::CreateAgentRequest const& request) { + google::cloud::ces::v1::Agent response; + auto status = grpc_stub_->CreateAgent(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultAgentServiceStub::UpdateAgent( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::UpdateAgentRequest const& request) { + google::cloud::ces::v1::Agent response; + auto status = grpc_stub_->UpdateAgent(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultAgentServiceStub::DeleteAgent( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::DeleteAgentRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteAgent(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +StatusOr +DefaultAgentServiceStub::ListExamples( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::ListExamplesRequest const& request) { + google::cloud::ces::v1::ListExamplesResponse response; + auto status = grpc_stub_->ListExamples(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultAgentServiceStub::GetExample( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::GetExampleRequest const& request) { + google::cloud::ces::v1::Example response; + auto status = grpc_stub_->GetExample(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::CreateExample( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::CreateExampleRequest const& request) { + google::cloud::ces::v1::Example response; + auto status = grpc_stub_->CreateExample(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::UpdateExample( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::UpdateExampleRequest const& request) { + google::cloud::ces::v1::Example response; + auto status = grpc_stub_->UpdateExample(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultAgentServiceStub::DeleteExample( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::DeleteExampleRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteExample(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +StatusOr +DefaultAgentServiceStub::ListTools( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::ListToolsRequest const& request) { + google::cloud::ces::v1::ListToolsResponse response; + auto status = grpc_stub_->ListTools(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultAgentServiceStub::GetTool( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::GetToolRequest const& request) { + google::cloud::ces::v1::Tool response; + auto status = grpc_stub_->GetTool(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::ListConversations( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::ListConversationsRequest const& request) { + google::cloud::ces::v1::ListConversationsResponse response; + auto status = grpc_stub_->ListConversations(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::GetConversation( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::GetConversationRequest const& request) { + google::cloud::ces::v1::Conversation response; + auto status = grpc_stub_->GetConversation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultAgentServiceStub::DeleteConversation( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::DeleteConversationRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteConversation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +future> +DefaultAgentServiceStub::AsyncBatchDeleteConversations( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::ces::v1::BatchDeleteConversationsRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncBatchDeleteConversations(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAgentServiceStub::BatchDeleteConversations( + grpc::ClientContext& context, Options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->BatchDeleteConversations(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultAgentServiceStub::CreateTool( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::CreateToolRequest const& request) { + google::cloud::ces::v1::Tool response; + auto status = grpc_stub_->CreateTool(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultAgentServiceStub::UpdateTool( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::UpdateToolRequest const& request) { + google::cloud::ces::v1::Tool response; + auto status = grpc_stub_->UpdateTool(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultAgentServiceStub::DeleteTool( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::DeleteToolRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteTool(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +StatusOr +DefaultAgentServiceStub::ListGuardrails( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::ListGuardrailsRequest const& request) { + google::cloud::ces::v1::ListGuardrailsResponse response; + auto status = grpc_stub_->ListGuardrails(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::GetGuardrail( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::GetGuardrailRequest const& request) { + google::cloud::ces::v1::Guardrail response; + auto status = grpc_stub_->GetGuardrail(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::CreateGuardrail( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::CreateGuardrailRequest const& request) { + google::cloud::ces::v1::Guardrail response; + auto status = grpc_stub_->CreateGuardrail(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::UpdateGuardrail( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::UpdateGuardrailRequest const& request) { + google::cloud::ces::v1::Guardrail response; + auto status = grpc_stub_->UpdateGuardrail(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultAgentServiceStub::DeleteGuardrail( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::DeleteGuardrailRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteGuardrail(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +StatusOr +DefaultAgentServiceStub::ListDeployments( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::ListDeploymentsRequest const& request) { + google::cloud::ces::v1::ListDeploymentsResponse response; + auto status = grpc_stub_->ListDeployments(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::GetDeployment( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::GetDeploymentRequest const& request) { + google::cloud::ces::v1::Deployment response; + auto status = grpc_stub_->GetDeployment(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::CreateDeployment( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::CreateDeploymentRequest const& request) { + google::cloud::ces::v1::Deployment response; + auto status = grpc_stub_->CreateDeployment(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::UpdateDeployment( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::UpdateDeploymentRequest const& request) { + google::cloud::ces::v1::Deployment response; + auto status = grpc_stub_->UpdateDeployment(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultAgentServiceStub::DeleteDeployment( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::DeleteDeploymentRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteDeployment(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +StatusOr +DefaultAgentServiceStub::ListToolsets( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::ListToolsetsRequest const& request) { + google::cloud::ces::v1::ListToolsetsResponse response; + auto status = grpc_stub_->ListToolsets(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultAgentServiceStub::GetToolset( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::GetToolsetRequest const& request) { + google::cloud::ces::v1::Toolset response; + auto status = grpc_stub_->GetToolset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::CreateToolset( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::CreateToolsetRequest const& request) { + google::cloud::ces::v1::Toolset response; + auto status = grpc_stub_->CreateToolset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::UpdateToolset( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::UpdateToolsetRequest const& request) { + google::cloud::ces::v1::Toolset response; + auto status = grpc_stub_->UpdateToolset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultAgentServiceStub::DeleteToolset( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::DeleteToolsetRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteToolset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +StatusOr +DefaultAgentServiceStub::ListAppVersions( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::ListAppVersionsRequest const& request) { + google::cloud::ces::v1::ListAppVersionsResponse response; + auto status = grpc_stub_->ListAppVersions(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::GetAppVersion( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::GetAppVersionRequest const& request) { + google::cloud::ces::v1::AppVersion response; + auto status = grpc_stub_->GetAppVersion(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::CreateAppVersion( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::CreateAppVersionRequest const& request) { + google::cloud::ces::v1::AppVersion response; + auto status = grpc_stub_->CreateAppVersion(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultAgentServiceStub::DeleteAppVersion( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::DeleteAppVersionRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteAppVersion(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +future> +DefaultAgentServiceStub::AsyncRestoreAppVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::ces::v1::RestoreAppVersionRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::ces::v1::RestoreAppVersionRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncRestoreAppVersion(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAgentServiceStub::RestoreAppVersion( + grpc::ClientContext& context, Options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->RestoreAppVersion(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::ListChangelogs( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::ListChangelogsRequest const& request) { + google::cloud::ces::v1::ListChangelogsResponse response; + auto status = grpc_stub_->ListChangelogs(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::GetChangelog( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::GetChangelogRequest const& request) { + google::cloud::ces::v1::Changelog response; + auto status = grpc_stub_->GetChangelog(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAgentServiceStub::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 +DefaultAgentServiceStub::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 +DefaultAgentServiceStub::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 DefaultAgentServiceStub::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 DefaultAgentServiceStub::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 DefaultAgentServiceStub::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> +DefaultAgentServiceStub::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 DefaultAgentServiceStub::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 ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/agent_stub.h b/google/cloud/ces/v1/internal/agent_stub.h new file mode 100644 index 0000000000000..8c5207a40f662 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_stub.h @@ -0,0 +1,617 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_STUB_H + +#include "google/cloud/ces/v1/agent_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AgentServiceStub { + public: + virtual ~AgentServiceStub() = 0; + + virtual StatusOr ListApps( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppsRequest const& request) = 0; + + virtual StatusOr GetApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppRequest const& request) = 0; + + virtual future> AsyncCreateApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::CreateAppRequest const& request) = 0; + + virtual StatusOr CreateApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::CreateAppRequest const& request) = 0; + + virtual StatusOr UpdateApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAppRequest const& request) = 0; + + virtual future> AsyncDeleteApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::DeleteAppRequest const& request) = 0; + + virtual StatusOr DeleteApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::DeleteAppRequest const& request) = 0; + + virtual future> AsyncExportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ExportAppRequest const& request) = 0; + + virtual StatusOr ExportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ExportAppRequest const& request) = 0; + + virtual future> AsyncImportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ImportAppRequest const& request) = 0; + + virtual StatusOr ImportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ImportAppRequest const& request) = 0; + + virtual StatusOr ListAgents( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAgentsRequest const& request) = 0; + + virtual StatusOr GetAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAgentRequest const& request) = 0; + + virtual StatusOr CreateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAgentRequest const& request) = 0; + + virtual StatusOr UpdateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAgentRequest const& request) = 0; + + virtual Status DeleteAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAgentRequest const& request) = 0; + + virtual StatusOr ListExamples( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListExamplesRequest const& request) = 0; + + virtual StatusOr GetExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetExampleRequest const& request) = 0; + + virtual StatusOr CreateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateExampleRequest const& request) = 0; + + virtual StatusOr UpdateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateExampleRequest const& request) = 0; + + virtual Status DeleteExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteExampleRequest const& request) = 0; + + virtual StatusOr ListTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsRequest const& request) = 0; + + virtual StatusOr GetTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolRequest const& request) = 0; + + virtual StatusOr + ListConversations( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListConversationsRequest const& request) = 0; + + virtual StatusOr GetConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetConversationRequest const& request) = 0; + + virtual Status DeleteConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteConversationRequest const& request) = 0; + + virtual future> + AsyncBatchDeleteConversations( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& + request) = 0; + + virtual StatusOr BatchDeleteConversations( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& + request) = 0; + + virtual StatusOr CreateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolRequest const& request) = 0; + + virtual StatusOr UpdateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolRequest const& request) = 0; + + virtual Status DeleteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolRequest const& request) = 0; + + virtual StatusOr + ListGuardrails( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListGuardrailsRequest const& request) = 0; + + virtual StatusOr GetGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetGuardrailRequest const& request) = 0; + + virtual StatusOr CreateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateGuardrailRequest const& request) = 0; + + virtual StatusOr UpdateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateGuardrailRequest const& request) = 0; + + virtual Status DeleteGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteGuardrailRequest const& request) = 0; + + virtual StatusOr + ListDeployments( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListDeploymentsRequest const& request) = 0; + + virtual StatusOr GetDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetDeploymentRequest const& request) = 0; + + virtual StatusOr CreateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateDeploymentRequest const& request) = 0; + + virtual StatusOr UpdateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateDeploymentRequest const& request) = 0; + + virtual Status DeleteDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteDeploymentRequest const& request) = 0; + + virtual StatusOr ListToolsets( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsetsRequest const& request) = 0; + + virtual StatusOr GetToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolsetRequest const& request) = 0; + + virtual StatusOr CreateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolsetRequest const& request) = 0; + + virtual StatusOr UpdateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolsetRequest const& request) = 0; + + virtual Status DeleteToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolsetRequest const& request) = 0; + + virtual StatusOr + ListAppVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppVersionsRequest const& request) = 0; + + virtual StatusOr GetAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppVersionRequest const& request) = 0; + + virtual StatusOr CreateAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppVersionRequest const& request) = 0; + + virtual Status DeleteAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppVersionRequest const& request) = 0; + + virtual future> + AsyncRestoreAppVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) = 0; + + virtual StatusOr RestoreAppVersion( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) = 0; + + virtual StatusOr + ListChangelogs( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListChangelogsRequest const& request) = 0; + + virtual StatusOr GetChangelog( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetChangelogRequest 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 DefaultAgentServiceStub : public AgentServiceStub { + public: + DefaultAgentServiceStub( + std::unique_ptr + 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 ListApps( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppsRequest const& request) override; + + StatusOr GetApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppRequest const& request) override; + + future> AsyncCreateApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::CreateAppRequest const& request) override; + + StatusOr CreateApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::CreateAppRequest const& request) override; + + StatusOr UpdateApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAppRequest const& request) override; + + future> AsyncDeleteApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + StatusOr DeleteApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + future> AsyncExportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ExportAppRequest const& request) override; + + StatusOr ExportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ExportAppRequest const& request) override; + + future> AsyncImportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ImportAppRequest const& request) override; + + StatusOr ImportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ImportAppRequest const& request) override; + + StatusOr ListAgents( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAgentsRequest const& request) override; + + StatusOr GetAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAgentRequest const& request) override; + + StatusOr CreateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAgentRequest const& request) override; + + StatusOr UpdateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAgentRequest const& request) override; + + Status DeleteAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAgentRequest const& request) override; + + StatusOr ListExamples( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListExamplesRequest const& request) override; + + StatusOr GetExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetExampleRequest const& request) override; + + StatusOr CreateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateExampleRequest const& request) override; + + StatusOr UpdateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateExampleRequest const& request) override; + + Status DeleteExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteExampleRequest const& request) override; + + StatusOr ListTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsRequest const& request) override; + + StatusOr GetTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolRequest const& request) override; + + StatusOr ListConversations( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListConversationsRequest const& request) override; + + StatusOr GetConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetConversationRequest const& request) override; + + Status DeleteConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteConversationRequest const& request) + override; + + future> + AsyncBatchDeleteConversations( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + StatusOr BatchDeleteConversations( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + StatusOr CreateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolRequest const& request) override; + + StatusOr UpdateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolRequest const& request) override; + + Status DeleteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolRequest const& request) override; + + StatusOr ListGuardrails( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListGuardrailsRequest const& request) override; + + StatusOr GetGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetGuardrailRequest const& request) override; + + StatusOr CreateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateGuardrailRequest const& request) override; + + StatusOr UpdateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateGuardrailRequest const& request) override; + + Status DeleteGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteGuardrailRequest const& request) override; + + StatusOr ListDeployments( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListDeploymentsRequest const& request) override; + + StatusOr GetDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetDeploymentRequest const& request) override; + + StatusOr CreateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateDeploymentRequest const& request) override; + + StatusOr UpdateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateDeploymentRequest const& request) override; + + Status DeleteDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteDeploymentRequest const& request) override; + + StatusOr ListToolsets( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsetsRequest const& request) override; + + StatusOr GetToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolsetRequest const& request) override; + + StatusOr CreateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolsetRequest const& request) override; + + StatusOr UpdateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolsetRequest const& request) override; + + Status DeleteToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolsetRequest const& request) override; + + StatusOr ListAppVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppVersionsRequest const& request) override; + + StatusOr GetAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppVersionRequest const& request) override; + + StatusOr CreateAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppVersionRequest const& request) override; + + Status DeleteAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppVersionRequest const& request) override; + + future> AsyncRestoreAppVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + StatusOr RestoreAppVersion( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + StatusOr ListChangelogs( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListChangelogsRequest const& request) override; + + StatusOr GetChangelog( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetChangelogRequest 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 + grpc_stub_; + std::unique_ptr + locations_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_STUB_H diff --git a/google/cloud/ces/v1/internal/agent_stub_factory.cc b/google/cloud/ces/v1/internal/agent_stub_factory.cc new file mode 100644 index 0000000000000..220a701bb2631 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_stub_factory.cc @@ -0,0 +1,81 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#include "google/cloud/ces/v1/internal/agent_stub_factory.h" +#include "google/cloud/ces/v1/agent_service.grpc.pb.h" +#include "google/cloud/ces/v1/internal/agent_auth_decorator.h" +#include "google/cloud/ces/v1/internal/agent_logging_decorator.h" +#include "google/cloud/ces/v1/internal/agent_metadata_decorator.h" +#include "google/cloud/ces/v1/internal/agent_stub.h" +#include "google/cloud/ces/v1/internal/agent_tracing_stub.h" +#include "google/cloud/location/locations.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultAgentServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::ces::v1::AgentService::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 = MakeAgentServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/agent_stub_factory.h b/google/cloud/ces/v1/internal/agent_stub_factory.h new file mode 100644 index 0000000000000..49a58078a406f --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_STUB_FACTORY_H + +#include "google/cloud/ces/v1/internal/agent_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultAgentServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_STUB_FACTORY_H diff --git a/google/cloud/ces/v1/internal/agent_tracing_connection.cc b/google/cloud/ces/v1/internal/agent_tracing_connection.cc new file mode 100644 index 0000000000000..89a78efa5e366 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_tracing_connection.cc @@ -0,0 +1,629 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#include "google/cloud/ces/v1/internal/agent_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AgentServiceTracingConnection::AgentServiceTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StreamRange +AgentServiceTracingConnection::ListApps( + google::cloud::ces::v1::ListAppsRequest request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::ListApps"); + internal::OTelScope scope(span); + auto sr = child_->ListApps(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr AgentServiceTracingConnection::GetApp( + google::cloud::ces::v1::GetAppRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::GetApp"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetApp(request)); +} + +future> +AgentServiceTracingConnection::CreateApp( + google::cloud::ces::v1::CreateAppRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::CreateApp"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateApp(request)); +} + +StatusOr +AgentServiceTracingConnection::CreateApp( + NoAwaitTag, google::cloud::ces::v1::CreateAppRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::CreateApp"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateApp(NoAwaitTag{}, request)); +} + +future> +AgentServiceTracingConnection::CreateApp( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::CreateApp"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateApp(operation)); +} + +StatusOr AgentServiceTracingConnection::UpdateApp( + google::cloud::ces::v1::UpdateAppRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::UpdateApp"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateApp(request)); +} + +future> +AgentServiceTracingConnection::DeleteApp( + google::cloud::ces::v1::DeleteAppRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::DeleteApp"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteApp(request)); +} + +StatusOr +AgentServiceTracingConnection::DeleteApp( + NoAwaitTag, google::cloud::ces::v1::DeleteAppRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::DeleteApp"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteApp(NoAwaitTag{}, request)); +} + +future> +AgentServiceTracingConnection::DeleteApp( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::DeleteApp"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteApp(operation)); +} + +future> +AgentServiceTracingConnection::ExportApp( + google::cloud::ces::v1::ExportAppRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::ExportApp"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->ExportApp(request)); +} + +StatusOr +AgentServiceTracingConnection::ExportApp( + NoAwaitTag, google::cloud::ces::v1::ExportAppRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::ExportApp"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->ExportApp(NoAwaitTag{}, request)); +} + +future> +AgentServiceTracingConnection::ExportApp( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::ExportApp"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->ExportApp(operation)); +} + +future> +AgentServiceTracingConnection::ImportApp( + google::cloud::ces::v1::ImportAppRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::ImportApp"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->ImportApp(request)); +} + +StatusOr +AgentServiceTracingConnection::ImportApp( + NoAwaitTag, google::cloud::ces::v1::ImportAppRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::ImportApp"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->ImportApp(NoAwaitTag{}, request)); +} + +future> +AgentServiceTracingConnection::ImportApp( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::ImportApp"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->ImportApp(operation)); +} + +StreamRange +AgentServiceTracingConnection::ListAgents( + google::cloud::ces::v1::ListAgentsRequest request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::ListAgents"); + internal::OTelScope scope(span); + auto sr = child_->ListAgents(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr AgentServiceTracingConnection::GetAgent( + google::cloud::ces::v1::GetAgentRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::GetAgent"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetAgent(request)); +} + +StatusOr +AgentServiceTracingConnection::CreateAgent( + google::cloud::ces::v1::CreateAgentRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::CreateAgent"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateAgent(request)); +} + +StatusOr +AgentServiceTracingConnection::UpdateAgent( + google::cloud::ces::v1::UpdateAgentRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::UpdateAgent"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateAgent(request)); +} + +Status AgentServiceTracingConnection::DeleteAgent( + google::cloud::ces::v1::DeleteAgentRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::DeleteAgent"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteAgent(request)); +} + +StreamRange +AgentServiceTracingConnection::ListExamples( + google::cloud::ces::v1::ListExamplesRequest request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::ListExamples"); + internal::OTelScope scope(span); + auto sr = child_->ListExamples(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +AgentServiceTracingConnection::GetExample( + google::cloud::ces::v1::GetExampleRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::GetExample"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetExample(request)); +} + +StatusOr +AgentServiceTracingConnection::CreateExample( + google::cloud::ces::v1::CreateExampleRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::CreateExample"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateExample(request)); +} + +StatusOr +AgentServiceTracingConnection::UpdateExample( + google::cloud::ces::v1::UpdateExampleRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::UpdateExample"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateExample(request)); +} + +Status AgentServiceTracingConnection::DeleteExample( + google::cloud::ces::v1::DeleteExampleRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::DeleteExample"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteExample(request)); +} + +StreamRange +AgentServiceTracingConnection::ListTools( + google::cloud::ces::v1::ListToolsRequest request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::ListTools"); + internal::OTelScope scope(span); + auto sr = child_->ListTools(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr AgentServiceTracingConnection::GetTool( + google::cloud::ces::v1::GetToolRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::GetTool"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetTool(request)); +} + +StreamRange +AgentServiceTracingConnection::ListConversations( + google::cloud::ces::v1::ListConversationsRequest request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::ListConversations"); + internal::OTelScope scope(span); + auto sr = child_->ListConversations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +AgentServiceTracingConnection::GetConversation( + google::cloud::ces::v1::GetConversationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::GetConversation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetConversation(request)); +} + +Status AgentServiceTracingConnection::DeleteConversation( + google::cloud::ces::v1::DeleteConversationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::DeleteConversation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteConversation(request)); +} + +future> +AgentServiceTracingConnection::BatchDeleteConversations( + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) { + auto span = internal::MakeSpan( + "ces_v1::AgentServiceConnection::BatchDeleteConversations"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->BatchDeleteConversations(request)); +} + +StatusOr +AgentServiceTracingConnection::BatchDeleteConversations( + NoAwaitTag, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) { + auto span = internal::MakeSpan( + "ces_v1::AgentServiceConnection::BatchDeleteConversations"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->BatchDeleteConversations(NoAwaitTag{}, request)); +} + +future> +AgentServiceTracingConnection::BatchDeleteConversations( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "ces_v1::AgentServiceConnection::BatchDeleteConversations"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->BatchDeleteConversations(operation)); +} + +StatusOr +AgentServiceTracingConnection::CreateTool( + google::cloud::ces::v1::CreateToolRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::CreateTool"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateTool(request)); +} + +StatusOr +AgentServiceTracingConnection::UpdateTool( + google::cloud::ces::v1::UpdateToolRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::UpdateTool"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateTool(request)); +} + +Status AgentServiceTracingConnection::DeleteTool( + google::cloud::ces::v1::DeleteToolRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::DeleteTool"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteTool(request)); +} + +StreamRange +AgentServiceTracingConnection::ListGuardrails( + google::cloud::ces::v1::ListGuardrailsRequest request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::ListGuardrails"); + internal::OTelScope scope(span); + auto sr = child_->ListGuardrails(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +AgentServiceTracingConnection::GetGuardrail( + google::cloud::ces::v1::GetGuardrailRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::GetGuardrail"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetGuardrail(request)); +} + +StatusOr +AgentServiceTracingConnection::CreateGuardrail( + google::cloud::ces::v1::CreateGuardrailRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::CreateGuardrail"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateGuardrail(request)); +} + +StatusOr +AgentServiceTracingConnection::UpdateGuardrail( + google::cloud::ces::v1::UpdateGuardrailRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::UpdateGuardrail"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateGuardrail(request)); +} + +Status AgentServiceTracingConnection::DeleteGuardrail( + google::cloud::ces::v1::DeleteGuardrailRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::DeleteGuardrail"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteGuardrail(request)); +} + +StreamRange +AgentServiceTracingConnection::ListDeployments( + google::cloud::ces::v1::ListDeploymentsRequest request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::ListDeployments"); + internal::OTelScope scope(span); + auto sr = child_->ListDeployments(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +AgentServiceTracingConnection::GetDeployment( + google::cloud::ces::v1::GetDeploymentRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::GetDeployment"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetDeployment(request)); +} + +StatusOr +AgentServiceTracingConnection::CreateDeployment( + google::cloud::ces::v1::CreateDeploymentRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::CreateDeployment"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateDeployment(request)); +} + +StatusOr +AgentServiceTracingConnection::UpdateDeployment( + google::cloud::ces::v1::UpdateDeploymentRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::UpdateDeployment"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateDeployment(request)); +} + +Status AgentServiceTracingConnection::DeleteDeployment( + google::cloud::ces::v1::DeleteDeploymentRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::DeleteDeployment"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteDeployment(request)); +} + +StreamRange +AgentServiceTracingConnection::ListToolsets( + google::cloud::ces::v1::ListToolsetsRequest request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::ListToolsets"); + internal::OTelScope scope(span); + auto sr = child_->ListToolsets(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +AgentServiceTracingConnection::GetToolset( + google::cloud::ces::v1::GetToolsetRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::GetToolset"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetToolset(request)); +} + +StatusOr +AgentServiceTracingConnection::CreateToolset( + google::cloud::ces::v1::CreateToolsetRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::CreateToolset"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateToolset(request)); +} + +StatusOr +AgentServiceTracingConnection::UpdateToolset( + google::cloud::ces::v1::UpdateToolsetRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::UpdateToolset"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateToolset(request)); +} + +Status AgentServiceTracingConnection::DeleteToolset( + google::cloud::ces::v1::DeleteToolsetRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::DeleteToolset"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteToolset(request)); +} + +StreamRange +AgentServiceTracingConnection::ListAppVersions( + google::cloud::ces::v1::ListAppVersionsRequest request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::ListAppVersions"); + internal::OTelScope scope(span); + auto sr = child_->ListAppVersions(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +AgentServiceTracingConnection::GetAppVersion( + google::cloud::ces::v1::GetAppVersionRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::GetAppVersion"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetAppVersion(request)); +} + +StatusOr +AgentServiceTracingConnection::CreateAppVersion( + google::cloud::ces::v1::CreateAppVersionRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::CreateAppVersion"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateAppVersion(request)); +} + +Status AgentServiceTracingConnection::DeleteAppVersion( + google::cloud::ces::v1::DeleteAppVersionRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::DeleteAppVersion"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteAppVersion(request)); +} + +future> +AgentServiceTracingConnection::RestoreAppVersion( + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::RestoreAppVersion"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->RestoreAppVersion(request)); +} + +StatusOr +AgentServiceTracingConnection::RestoreAppVersion( + NoAwaitTag, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::RestoreAppVersion"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->RestoreAppVersion(NoAwaitTag{}, request)); +} + +future> +AgentServiceTracingConnection::RestoreAppVersion( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::RestoreAppVersion"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->RestoreAppVersion(operation)); +} + +StreamRange +AgentServiceTracingConnection::ListChangelogs( + google::cloud::ces::v1::ListChangelogsRequest request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::ListChangelogs"); + internal::OTelScope scope(span); + auto sr = child_->ListChangelogs(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +AgentServiceTracingConnection::GetChangelog( + google::cloud::ces::v1::GetChangelogRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::GetChangelog"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetChangelog(request)); +} + +StreamRange +AgentServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +AgentServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpan("ces_v1::AgentServiceConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +AgentServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +AgentServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status AgentServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status AgentServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::AgentServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeAgentServiceTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/internal/agent_tracing_connection.h b/google/cloud/ces/v1/internal/agent_tracing_connection.h new file mode 100644 index 0000000000000..fc5718d537281 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_tracing_connection.h @@ -0,0 +1,269 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_TRACING_CONNECTION_H + +#include "google/cloud/ces/v1/agent_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AgentServiceTracingConnection : public ces_v1::AgentServiceConnection { + public: + ~AgentServiceTracingConnection() override = default; + + explicit AgentServiceTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StreamRange ListApps( + google::cloud::ces::v1::ListAppsRequest request) override; + + StatusOr GetApp( + google::cloud::ces::v1::GetAppRequest const& request) override; + + future> CreateApp( + google::cloud::ces::v1::CreateAppRequest const& request) override; + + StatusOr CreateApp( + NoAwaitTag, + google::cloud::ces::v1::CreateAppRequest const& request) override; + + future> CreateApp( + google::longrunning::Operation const& operation) override; + + StatusOr UpdateApp( + google::cloud::ces::v1::UpdateAppRequest const& request) override; + + future> DeleteApp( + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + StatusOr DeleteApp( + NoAwaitTag, + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + future> DeleteApp( + google::longrunning::Operation const& operation) override; + + future> ExportApp( + google::cloud::ces::v1::ExportAppRequest const& request) override; + + StatusOr ExportApp( + NoAwaitTag, + google::cloud::ces::v1::ExportAppRequest const& request) override; + + future> ExportApp( + google::longrunning::Operation const& operation) override; + + future> ImportApp( + google::cloud::ces::v1::ImportAppRequest const& request) override; + + StatusOr ImportApp( + NoAwaitTag, + google::cloud::ces::v1::ImportAppRequest const& request) override; + + future> ImportApp( + google::longrunning::Operation const& operation) override; + + StreamRange ListAgents( + google::cloud::ces::v1::ListAgentsRequest request) override; + + StatusOr GetAgent( + google::cloud::ces::v1::GetAgentRequest const& request) override; + + StatusOr CreateAgent( + google::cloud::ces::v1::CreateAgentRequest const& request) override; + + StatusOr UpdateAgent( + google::cloud::ces::v1::UpdateAgentRequest const& request) override; + + Status DeleteAgent( + google::cloud::ces::v1::DeleteAgentRequest const& request) override; + + StreamRange ListExamples( + google::cloud::ces::v1::ListExamplesRequest request) override; + + StatusOr GetExample( + google::cloud::ces::v1::GetExampleRequest const& request) override; + + StatusOr CreateExample( + google::cloud::ces::v1::CreateExampleRequest const& request) override; + + StatusOr UpdateExample( + google::cloud::ces::v1::UpdateExampleRequest const& request) override; + + Status DeleteExample( + google::cloud::ces::v1::DeleteExampleRequest const& request) override; + + StreamRange ListTools( + google::cloud::ces::v1::ListToolsRequest request) override; + + StatusOr GetTool( + google::cloud::ces::v1::GetToolRequest const& request) override; + + StreamRange ListConversations( + google::cloud::ces::v1::ListConversationsRequest request) override; + + StatusOr GetConversation( + google::cloud::ces::v1::GetConversationRequest const& request) override; + + Status DeleteConversation( + google::cloud::ces::v1::DeleteConversationRequest const& request) + override; + + future> + BatchDeleteConversations( + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + StatusOr BatchDeleteConversations( + NoAwaitTag, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + future> + BatchDeleteConversations( + google::longrunning::Operation const& operation) override; + + StatusOr CreateTool( + google::cloud::ces::v1::CreateToolRequest const& request) override; + + StatusOr UpdateTool( + google::cloud::ces::v1::UpdateToolRequest const& request) override; + + Status DeleteTool( + google::cloud::ces::v1::DeleteToolRequest const& request) override; + + StreamRange ListGuardrails( + google::cloud::ces::v1::ListGuardrailsRequest request) override; + + StatusOr GetGuardrail( + google::cloud::ces::v1::GetGuardrailRequest const& request) override; + + StatusOr CreateGuardrail( + google::cloud::ces::v1::CreateGuardrailRequest const& request) override; + + StatusOr UpdateGuardrail( + google::cloud::ces::v1::UpdateGuardrailRequest const& request) override; + + Status DeleteGuardrail( + google::cloud::ces::v1::DeleteGuardrailRequest const& request) override; + + StreamRange ListDeployments( + google::cloud::ces::v1::ListDeploymentsRequest request) override; + + StatusOr GetDeployment( + google::cloud::ces::v1::GetDeploymentRequest const& request) override; + + StatusOr CreateDeployment( + google::cloud::ces::v1::CreateDeploymentRequest const& request) override; + + StatusOr UpdateDeployment( + google::cloud::ces::v1::UpdateDeploymentRequest const& request) override; + + Status DeleteDeployment( + google::cloud::ces::v1::DeleteDeploymentRequest const& request) override; + + StreamRange ListToolsets( + google::cloud::ces::v1::ListToolsetsRequest request) override; + + StatusOr GetToolset( + google::cloud::ces::v1::GetToolsetRequest const& request) override; + + StatusOr CreateToolset( + google::cloud::ces::v1::CreateToolsetRequest const& request) override; + + StatusOr UpdateToolset( + google::cloud::ces::v1::UpdateToolsetRequest const& request) override; + + Status DeleteToolset( + google::cloud::ces::v1::DeleteToolsetRequest const& request) override; + + StreamRange ListAppVersions( + google::cloud::ces::v1::ListAppVersionsRequest request) override; + + StatusOr GetAppVersion( + google::cloud::ces::v1::GetAppVersionRequest const& request) override; + + StatusOr CreateAppVersion( + google::cloud::ces::v1::CreateAppVersionRequest const& request) override; + + Status DeleteAppVersion( + google::cloud::ces::v1::DeleteAppVersionRequest const& request) override; + + future> + RestoreAppVersion( + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + StatusOr RestoreAppVersion( + NoAwaitTag, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + future> + RestoreAppVersion(google::longrunning::Operation const& operation) override; + + StreamRange ListChangelogs( + google::cloud::ces::v1::ListChangelogsRequest request) override; + + StatusOr GetChangelog( + google::cloud::ces::v1::GetChangelogRequest const& request) 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_; +}; + +/** + * 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 +MakeAgentServiceTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_TRACING_CONNECTION_H diff --git a/google/cloud/ces/v1/internal/agent_tracing_stub.cc b/google/cloud/ces/v1/internal/agent_tracing_stub.cc new file mode 100644 index 0000000000000..81d390fc75329 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_tracing_stub.cc @@ -0,0 +1,784 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#include "google/cloud/ces/v1/internal/agent_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AgentServiceTracingStub::AgentServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +AgentServiceTracingStub::ListApps( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppsRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "ListApps"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListApps(context, options, request)); +} + +StatusOr AgentServiceTracingStub::GetApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "GetApp"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetApp(context, options, request)); +} + +future> +AgentServiceTracingStub::AsyncCreateApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::CreateAppRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "CreateApp"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateApp(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AgentServiceTracingStub::CreateApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::CreateAppRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "CreateApp"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateApp(context, options, request)); +} + +StatusOr AgentServiceTracingStub::UpdateApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAppRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "UpdateApp"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateApp(context, options, request)); +} + +future> +AgentServiceTracingStub::AsyncDeleteApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::DeleteAppRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "DeleteApp"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteApp(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AgentServiceTracingStub::DeleteApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::DeleteAppRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "DeleteApp"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteApp(context, options, request)); +} + +future> +AgentServiceTracingStub::AsyncExportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ExportAppRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "ExportApp"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncExportApp(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AgentServiceTracingStub::ExportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ExportAppRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "ExportApp"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ExportApp(context, options, request)); +} + +future> +AgentServiceTracingStub::AsyncImportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ImportAppRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "ImportApp"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncImportApp(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AgentServiceTracingStub::ImportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ImportAppRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "ImportApp"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ImportApp(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::ListAgents( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAgentsRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "ListAgents"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListAgents(context, options, request)); +} + +StatusOr AgentServiceTracingStub::GetAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAgentRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "GetAgent"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetAgent(context, options, request)); +} + +StatusOr AgentServiceTracingStub::CreateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAgentRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "CreateAgent"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateAgent(context, options, request)); +} + +StatusOr AgentServiceTracingStub::UpdateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAgentRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "UpdateAgent"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateAgent(context, options, request)); +} + +Status AgentServiceTracingStub::DeleteAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAgentRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "DeleteAgent"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteAgent(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::ListExamples( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListExamplesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "ListExamples"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListExamples(context, options, request)); +} + +StatusOr AgentServiceTracingStub::GetExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetExampleRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "GetExample"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetExample(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::CreateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateExampleRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "CreateExample"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateExample(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::UpdateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateExampleRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "UpdateExample"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateExample(context, options, request)); +} + +Status AgentServiceTracingStub::DeleteExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteExampleRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "DeleteExample"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteExample(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::ListTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "ListTools"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListTools(context, options, request)); +} + +StatusOr AgentServiceTracingStub::GetTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "GetTool"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetTool(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::ListConversations( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListConversationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "ListConversations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListConversations(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::GetConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetConversationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "GetConversation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetConversation(context, options, request)); +} + +Status AgentServiceTracingStub::DeleteConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteConversationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "DeleteConversation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteConversation(context, options, request)); +} + +future> +AgentServiceTracingStub::AsyncBatchDeleteConversations( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "BatchDeleteConversations"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncBatchDeleteConversations(cq, context, + std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AgentServiceTracingStub::BatchDeleteConversations( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "BatchDeleteConversations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->BatchDeleteConversations(context, options, request)); +} + +StatusOr AgentServiceTracingStub::CreateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "CreateTool"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateTool(context, options, request)); +} + +StatusOr AgentServiceTracingStub::UpdateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "UpdateTool"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateTool(context, options, request)); +} + +Status AgentServiceTracingStub::DeleteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "DeleteTool"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteTool(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::ListGuardrails( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListGuardrailsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "ListGuardrails"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListGuardrails(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::GetGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetGuardrailRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "GetGuardrail"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetGuardrail(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::CreateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateGuardrailRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "CreateGuardrail"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateGuardrail(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::UpdateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateGuardrailRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "UpdateGuardrail"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateGuardrail(context, options, request)); +} + +Status AgentServiceTracingStub::DeleteGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteGuardrailRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "DeleteGuardrail"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteGuardrail(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::ListDeployments( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListDeploymentsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "ListDeployments"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListDeployments(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::GetDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetDeploymentRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "GetDeployment"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetDeployment(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::CreateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateDeploymentRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "CreateDeployment"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateDeployment(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::UpdateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateDeploymentRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "UpdateDeployment"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateDeployment(context, options, request)); +} + +Status AgentServiceTracingStub::DeleteDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteDeploymentRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "DeleteDeployment"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteDeployment(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::ListToolsets( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsetsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "ListToolsets"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListToolsets(context, options, request)); +} + +StatusOr AgentServiceTracingStub::GetToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolsetRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "GetToolset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetToolset(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::CreateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolsetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "CreateToolset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateToolset(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::UpdateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolsetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "UpdateToolset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateToolset(context, options, request)); +} + +Status AgentServiceTracingStub::DeleteToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolsetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "DeleteToolset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteToolset(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::ListAppVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppVersionsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "ListAppVersions"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListAppVersions(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::GetAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppVersionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "GetAppVersion"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetAppVersion(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::CreateAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppVersionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "CreateAppVersion"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateAppVersion(context, options, request)); +} + +Status AgentServiceTracingStub::DeleteAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppVersionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "DeleteAppVersion"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteAppVersion(context, options, request)); +} + +future> +AgentServiceTracingStub::AsyncRestoreAppVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "RestoreAppVersion"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncRestoreAppVersion(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AgentServiceTracingStub::RestoreAppVersion( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "RestoreAppVersion"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->RestoreAppVersion(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::ListChangelogs( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListChangelogsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "ListChangelogs"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListChangelogs(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::GetChangelog( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetChangelogRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "GetChangelog"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetChangelog(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +AgentServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr AgentServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status AgentServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status AgentServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.AgentService", + "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +AgentServiceTracingStub::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 AgentServiceTracingStub::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)); +} + +std::shared_ptr MakeAgentServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/agent_tracing_stub.h b/google/cloud/ces/v1/internal/agent_tracing_stub.h new file mode 100644 index 0000000000000..a3d5e8f6726b4 --- /dev/null +++ b/google/cloud/ces/v1/internal/agent_tracing_stub.h @@ -0,0 +1,332 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_TRACING_STUB_H + +#include "google/cloud/ces/v1/internal/agent_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AgentServiceTracingStub : public AgentServiceStub { + public: + ~AgentServiceTracingStub() override = default; + + explicit AgentServiceTracingStub(std::shared_ptr child); + + StatusOr ListApps( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppsRequest const& request) override; + + StatusOr GetApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppRequest const& request) override; + + future> AsyncCreateApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::CreateAppRequest const& request) override; + + StatusOr CreateApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::CreateAppRequest const& request) override; + + StatusOr UpdateApp( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAppRequest const& request) override; + + future> AsyncDeleteApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + StatusOr DeleteApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::DeleteAppRequest const& request) override; + + future> AsyncExportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ExportAppRequest const& request) override; + + StatusOr ExportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ExportAppRequest const& request) override; + + future> AsyncImportApp( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::ImportAppRequest const& request) override; + + StatusOr ImportApp( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::ImportAppRequest const& request) override; + + StatusOr ListAgents( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAgentsRequest const& request) override; + + StatusOr GetAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAgentRequest const& request) override; + + StatusOr CreateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAgentRequest const& request) override; + + StatusOr UpdateAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateAgentRequest const& request) override; + + Status DeleteAgent( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAgentRequest const& request) override; + + StatusOr ListExamples( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListExamplesRequest const& request) override; + + StatusOr GetExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetExampleRequest const& request) override; + + StatusOr CreateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateExampleRequest const& request) override; + + StatusOr UpdateExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateExampleRequest const& request) override; + + Status DeleteExample( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteExampleRequest const& request) override; + + StatusOr ListTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsRequest const& request) override; + + StatusOr GetTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolRequest const& request) override; + + StatusOr ListConversations( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListConversationsRequest const& request) override; + + StatusOr GetConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetConversationRequest const& request) override; + + Status DeleteConversation( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteConversationRequest const& request) + override; + + future> + AsyncBatchDeleteConversations( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + StatusOr BatchDeleteConversations( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request) + override; + + StatusOr CreateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolRequest const& request) override; + + StatusOr UpdateTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolRequest const& request) override; + + Status DeleteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolRequest const& request) override; + + StatusOr ListGuardrails( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListGuardrailsRequest const& request) override; + + StatusOr GetGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetGuardrailRequest const& request) override; + + StatusOr CreateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateGuardrailRequest const& request) override; + + StatusOr UpdateGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateGuardrailRequest const& request) override; + + Status DeleteGuardrail( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteGuardrailRequest const& request) override; + + StatusOr ListDeployments( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListDeploymentsRequest const& request) override; + + StatusOr GetDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetDeploymentRequest const& request) override; + + StatusOr CreateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateDeploymentRequest const& request) override; + + StatusOr UpdateDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateDeploymentRequest const& request) override; + + Status DeleteDeployment( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteDeploymentRequest const& request) override; + + StatusOr ListToolsets( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListToolsetsRequest const& request) override; + + StatusOr GetToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetToolsetRequest const& request) override; + + StatusOr CreateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateToolsetRequest const& request) override; + + StatusOr UpdateToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::UpdateToolsetRequest const& request) override; + + Status DeleteToolset( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteToolsetRequest const& request) override; + + StatusOr ListAppVersions( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListAppVersionsRequest const& request) override; + + StatusOr GetAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetAppVersionRequest const& request) override; + + StatusOr CreateAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::CreateAppVersionRequest const& request) override; + + Status DeleteAppVersion( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::DeleteAppVersionRequest const& request) override; + + future> AsyncRestoreAppVersion( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + StatusOr RestoreAppVersion( + grpc::ClientContext& context, Options options, + google::cloud::ces::v1::RestoreAppVersionRequest const& request) override; + + StatusOr ListChangelogs( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ListChangelogsRequest const& request) override; + + StatusOr GetChangelog( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GetChangelogRequest 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_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeAgentServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_AGENT_TRACING_STUB_H diff --git a/google/cloud/ces/v1/internal/session_auth_decorator.cc b/google/cloud/ces/v1/internal/session_auth_decorator.cc new file mode 100644 index 0000000000000..0cfeaa14f722f --- /dev/null +++ b/google/cloud/ces/v1/internal/session_auth_decorator.cc @@ -0,0 +1,133 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#include "google/cloud/ces/v1/internal/session_auth_decorator.h" +#include "google/cloud/ces/v1/session_service.grpc.pb.h" +#include "google/cloud/internal/async_read_write_stream_auth.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +SessionServiceAuth::SessionServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +SessionServiceAuth::RunSession( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->RunSession(context, options, request); +} + +std::unique_ptr> +SessionServiceAuth::StreamRunSession( + std::shared_ptr context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) { + using ErrorStream = ::google::cloud::internal::StreamingReadRpcError< + google::cloud::ces::v1::RunSessionResponse>; + auto status = auth_->ConfigureContext(*context); + if (!status.ok()) return std::make_unique(std::move(status)); + return child_->StreamRunSession(std::move(context), options, request); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> +SessionServiceAuth::AsyncBidiRunSession( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + using StreamAuth = google::cloud::internal::AsyncStreamingReadWriteRpcAuth< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>; + + auto call = [child = child_, cq, options = std::move(options)]( + std::shared_ptr ctx) { + return child->AsyncBidiRunSession(cq, std::move(ctx), options); + }; + return std::make_unique( + std::move(context), auth_, StreamAuth::StreamFactory(std::move(call))); +} + +StatusOr +SessionServiceAuth::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 SessionServiceAuth::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 +SessionServiceAuth::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 SessionServiceAuth::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 SessionServiceAuth::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 SessionServiceAuth::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); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/session_auth_decorator.h b/google/cloud/ces/v1/internal/session_auth_decorator.h new file mode 100644 index 0000000000000..f32a2ab371ff3 --- /dev/null +++ b/google/cloud/ces/v1/internal/session_auth_decorator.h @@ -0,0 +1,98 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_AUTH_DECORATOR_H + +#include "google/cloud/ces/v1/internal/session_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class SessionServiceAuth : public SessionServiceStub { + public: + ~SessionServiceAuth() override = default; + SessionServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr RunSession( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) override; + + std::unique_ptr> + StreamRunSession( + std::shared_ptr context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> + AsyncBidiRunSession( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) 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; + + private: + std::shared_ptr auth_; + std::shared_ptr child_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_AUTH_DECORATOR_H diff --git a/google/cloud/ces/v1/internal/session_connection_impl.cc b/google/cloud/ces/v1/internal/session_connection_impl.cc new file mode 100644 index 0000000000000..1ed136a00cea9 --- /dev/null +++ b/google/cloud/ces/v1/internal/session_connection_impl.cc @@ -0,0 +1,237 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#include "google/cloud/ces/v1/internal/session_connection_impl.h" +#include "google/cloud/ces/v1/internal/session_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/pagination_range.h" +#include "google/cloud/internal/resumable_streaming_read_rpc.h" +#include "google/cloud/internal/retry_loop.h" +#include "google/cloud/internal/streaming_read_rpc_logging.h" +#include +#include + +namespace google { +namespace cloud { +namespace ces_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(); +} + +} // namespace + +void SessionServiceStreamRunSessionStreamingUpdater( + google::cloud::ces::v1::RunSessionResponse const&, + google::cloud::ces::v1::RunSessionRequest&) {} + +SessionServiceConnectionImpl::SessionServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions(std::move(options), + SessionServiceConnection::options())) {} + +StatusOr +SessionServiceConnectionImpl::RunSession( + google::cloud::ces::v1::RunSessionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->RunSession(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) { + return stub_->RunSession(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +SessionServiceConnectionImpl::StreamRunSession( + google::cloud::ces::v1::RunSessionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto factory = [stub = stub_, current]( + google::cloud::ces::v1::RunSessionRequest const& request) { + return stub->StreamRunSession(std::make_shared(), + *current, request); + }; + auto resumable = internal::MakeResumableStreamingReadRpc< + google::cloud::ces::v1::RunSessionResponse, + google::cloud::ces::v1::RunSessionRequest>( + retry_policy(*current), backoff_policy(*current), factory, + SessionServiceStreamRunSessionStreamingUpdater, request); + return internal::MakeStreamRange( + [resumable = std::move(resumable)]() + -> absl::variant { + google::cloud::ces::v1::RunSessionResponse response; + auto status = resumable->Read(&response); + if (status.has_value()) return *status; + return response; + }); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> +SessionServiceConnectionImpl::AsyncBidiRunSession() { + return stub_->AsyncBidiRunSession(background_->cq(), + std::make_shared(), + internal::SaveCurrentOptions()); +} + +StreamRange +SessionServiceConnectionImpl::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 +SessionServiceConnectionImpl::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 +SessionServiceConnectionImpl::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 +SessionServiceConnectionImpl::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 SessionServiceConnectionImpl::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 SessionServiceConnectionImpl::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 ces_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/internal/session_connection_impl.h b/google/cloud/ces/v1/internal/session_connection_impl.h new file mode 100644 index 0000000000000..cdf7cf1a3c8ff --- /dev/null +++ b/google/cloud/ces/v1/internal/session_connection_impl.h @@ -0,0 +1,96 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_CONNECTION_IMPL_H + +#include "google/cloud/ces/v1/internal/session_retry_traits.h" +#include "google/cloud/ces/v1/internal/session_stub.h" +#include "google/cloud/ces/v1/session_connection.h" +#include "google/cloud/ces/v1/session_connection_idempotency_policy.h" +#include "google/cloud/ces/v1/session_options.h" +#include "google/cloud/async_streaming_read_write_rpc.h" +#include "google/cloud/background_threads.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +void SessionServiceStreamRunSessionStreamingUpdater( + google::cloud::ces::v1::RunSessionResponse const& response, + google::cloud::ces::v1::RunSessionRequest& request); + +class SessionServiceConnectionImpl : public ces_v1::SessionServiceConnection { + public: + ~SessionServiceConnectionImpl() override = default; + + SessionServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + StatusOr RunSession( + google::cloud::ces::v1::RunSessionRequest const& request) override; + + StreamRange StreamRunSession( + google::cloud::ces::v1::RunSessionRequest const& request) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> + AsyncBidiRunSession() 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 ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_CONNECTION_IMPL_H diff --git a/google/cloud/ces/v1/internal/session_logging_decorator.cc b/google/cloud/ces/v1/internal/session_logging_decorator.cc new file mode 100644 index 0000000000000..ceb382862b093 --- /dev/null +++ b/google/cloud/ces/v1/internal/session_logging_decorator.cc @@ -0,0 +1,178 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#include "google/cloud/ces/v1/internal/session_logging_decorator.h" +#include "google/cloud/ces/v1/session_service.grpc.pb.h" +#include "google/cloud/internal/async_read_write_stream_logging.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/internal/streaming_read_rpc_logging.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +SessionServiceLogging::SessionServiceLogging( + std::shared_ptr child, TracingOptions tracing_options, + std::set const& components) + : child_(std::move(child)), + tracing_options_(std::move(tracing_options)), + stream_logging_(components.find("rpc-streams") != components.end()) {} + +StatusOr +SessionServiceLogging::RunSession( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) { + return child_->RunSession(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +std::unique_ptr> +SessionServiceLogging::StreamRunSession( + std::shared_ptr context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](std::shared_ptr context, + Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) + -> std::unique_ptr> { + auto stream = + child_->StreamRunSession(std::move(context), options, request); + if (stream_logging_) { + stream = + std::make_unique>( + std::move(stream), tracing_options_, + google::cloud::internal::RequestIdForLogging()); + } + return stream; + }, + std::move(context), options, request, __func__, tracing_options_); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> +SessionServiceLogging::AsyncBidiRunSession( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + using LoggingStream = + ::google::cloud::internal::AsyncStreamingReadWriteRpcLogging< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>; + + auto request_id = google::cloud::internal::RequestIdForLogging(); + GCP_LOG(DEBUG) << __func__ << "(" << request_id << ")"; + auto stream = + child_->AsyncBidiRunSession(cq, std::move(context), std::move(options)); + if (stream_logging_) { + stream = std::make_unique( + std::move(stream), tracing_options_, std::move(request_id)); + } + return stream; +} + +StatusOr +SessionServiceLogging::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 SessionServiceLogging::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 +SessionServiceLogging::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 SessionServiceLogging::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 SessionServiceLogging::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 SessionServiceLogging::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_); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/session_logging_decorator.h b/google/cloud/ces/v1/internal/session_logging_decorator.h new file mode 100644 index 0000000000000..8b35f07e77396 --- /dev/null +++ b/google/cloud/ces/v1/internal/session_logging_decorator.h @@ -0,0 +1,99 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_LOGGING_DECORATOR_H + +#include "google/cloud/ces/v1/internal/session_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class SessionServiceLogging : public SessionServiceStub { + public: + ~SessionServiceLogging() override = default; + SessionServiceLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr RunSession( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) override; + + std::unique_ptr> + StreamRunSession( + std::shared_ptr context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> + AsyncBidiRunSession( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) 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; + + private: + std::shared_ptr child_; + TracingOptions tracing_options_; + bool stream_logging_; +}; // SessionServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_LOGGING_DECORATOR_H diff --git a/google/cloud/ces/v1/internal/session_metadata_decorator.cc b/google/cloud/ces/v1/internal/session_metadata_decorator.cc new file mode 100644 index 0000000000000..85a4c9cc7d20e --- /dev/null +++ b/google/cloud/ces/v1/internal/session_metadata_decorator.cc @@ -0,0 +1,152 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#include "google/cloud/ces/v1/internal/session_metadata_decorator.h" +#include "google/cloud/ces/v1/session_service.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +SessionServiceMetadata::SessionServiceMetadata( + 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 +SessionServiceMetadata::RunSession( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("config.session=", + internal::UrlEncode(request.config().session()))); + return child_->RunSession(context, options, request); +} + +std::unique_ptr> +SessionServiceMetadata::StreamRunSession( + std::shared_ptr context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) { + SetMetadata(*context, options, + absl::StrCat("config.session=", + internal::UrlEncode(request.config().session()))); + return child_->StreamRunSession(std::move(context), options, request); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> +SessionServiceMetadata::AsyncBidiRunSession( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + SetMetadata(*context, *options); + return child_->AsyncBidiRunSession(cq, std::move(context), + std::move(options)); +} + +StatusOr +SessionServiceMetadata::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 SessionServiceMetadata::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 +SessionServiceMetadata::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 SessionServiceMetadata::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 SessionServiceMetadata::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 SessionServiceMetadata::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); +} + +void SessionServiceMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void SessionServiceMetadata::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 ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/session_metadata_decorator.h b/google/cloud/ces/v1/internal/session_metadata_decorator.h new file mode 100644 index 0000000000000..638feed5f1ac3 --- /dev/null +++ b/google/cloud/ces/v1/internal/session_metadata_decorator.h @@ -0,0 +1,103 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_METADATA_DECORATOR_H + +#include "google/cloud/ces/v1/internal/session_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class SessionServiceMetadata : public SessionServiceStub { + public: + ~SessionServiceMetadata() override = default; + SessionServiceMetadata(std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr RunSession( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) override; + + std::unique_ptr> + StreamRunSession( + std::shared_ptr context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> + AsyncBidiRunSession( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) 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; + + 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 ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_METADATA_DECORATOR_H diff --git a/google/cloud/ces/v1/internal/session_option_defaults.cc b/google/cloud/ces/v1/internal/session_option_defaults.cc new file mode 100644 index 0000000000000..6224175e14269 --- /dev/null +++ b/google/cloud/ces/v1/internal/session_option_defaults.cc @@ -0,0 +1,64 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#include "google/cloud/ces/v1/internal/session_option_defaults.h" +#include "google/cloud/ces/v1/session_connection.h" +#include "google/cloud/ces/v1/session_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 ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options SessionServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_SESSION_SERVICE_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_SESSION_SERVICE_AUTHORITY", "ces.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + ces_v1::SessionServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) + .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( + ces_v1::MakeDefaultSessionServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/internal/session_option_defaults.h b/google/cloud/ces/v1/internal/session_option_defaults.h new file mode 100644 index 0000000000000..f8046e7a9b617 --- /dev/null +++ b/google/cloud/ces/v1/internal/session_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options SessionServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_OPTION_DEFAULTS_H diff --git a/google/cloud/ces/v1/internal/session_retry_traits.h b/google/cloud/ces/v1/internal/session_retry_traits.h new file mode 100644 index 0000000000000..ecc6910b1b066 --- /dev/null +++ b/google/cloud/ces/v1/internal/session_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct SessionServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_RETRY_TRAITS_H diff --git a/google/cloud/ces/v1/internal/session_sources.cc b/google/cloud/ces/v1/internal/session_sources.cc new file mode 100644 index 0000000000000..94f48b649e13c --- /dev/null +++ b/google/cloud/ces/v1/internal/session_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/ces/v1/internal/session_auth_decorator.cc" +#include "google/cloud/ces/v1/internal/session_connection_impl.cc" +#include "google/cloud/ces/v1/internal/session_logging_decorator.cc" +#include "google/cloud/ces/v1/internal/session_metadata_decorator.cc" +#include "google/cloud/ces/v1/internal/session_option_defaults.cc" +#include "google/cloud/ces/v1/internal/session_stub.cc" +#include "google/cloud/ces/v1/internal/session_stub_factory.cc" +#include "google/cloud/ces/v1/internal/session_tracing_connection.cc" +#include "google/cloud/ces/v1/internal/session_tracing_stub.cc" +#include "google/cloud/ces/v1/session_client.cc" +#include "google/cloud/ces/v1/session_connection.cc" +#include "google/cloud/ces/v1/session_connection_idempotency_policy.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/ces/v1/internal/session_stub.cc b/google/cloud/ces/v1/internal/session_stub.cc new file mode 100644 index 0000000000000..b43f5433e9379 --- /dev/null +++ b/google/cloud/ces/v1/internal/session_stub.cc @@ -0,0 +1,151 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#include "google/cloud/ces/v1/internal/session_stub.h" +#include "google/cloud/ces/v1/session_service.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/internal/async_read_write_stream_impl.h" +#include "google/cloud/status_or.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +SessionServiceStub::~SessionServiceStub() = default; + +StatusOr +DefaultSessionServiceStub::RunSession( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::RunSessionRequest const& request) { + google::cloud::ces::v1::RunSessionResponse response; + auto status = grpc_stub_->RunSession(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +std::unique_ptr> +DefaultSessionServiceStub::StreamRunSession( + std::shared_ptr context, Options const&, + google::cloud::ces::v1::RunSessionRequest const& request) { + auto stream = grpc_stub_->StreamRunSession(context.get(), request); + return std::make_unique>(std::move(context), + std::move(stream)); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> +DefaultSessionServiceStub::AsyncBidiRunSession( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + return google::cloud::internal::MakeStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>( + cq, std::move(context), std::move(options), + [this](grpc::ClientContext* context, grpc::CompletionQueue* cq) { + return grpc_stub_->PrepareAsyncBidiRunSession(context, cq); + }); +} + +StatusOr +DefaultSessionServiceStub::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 +DefaultSessionServiceStub::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 +DefaultSessionServiceStub::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 +DefaultSessionServiceStub::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 DefaultSessionServiceStub::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 DefaultSessionServiceStub::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(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/session_stub.h b/google/cloud/ces/v1/internal/session_stub.h new file mode 100644 index 0000000000000..c63fcaf278365 --- /dev/null +++ b/google/cloud/ces/v1/internal/session_stub.h @@ -0,0 +1,160 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_STUB_H + +#include "google/cloud/ces/v1/session_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/async_streaming_read_write_rpc.h" +#include "google/cloud/completion_queue.h" +#include "google/cloud/internal/streaming_read_rpc.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class SessionServiceStub { + public: + virtual ~SessionServiceStub() = 0; + + virtual StatusOr RunSession( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) = 0; + + virtual std::unique_ptr> + StreamRunSession( + std::shared_ptr context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) = 0; + + virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> + AsyncBidiRunSession(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) = 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; +}; + +class DefaultSessionServiceStub : public SessionServiceStub { + public: + explicit DefaultSessionServiceStub( + std::unique_ptr + grpc_stub, + std::unique_ptr + operations_stub, + std::unique_ptr + locations_stub) + : grpc_stub_(std::move(grpc_stub)), + operations_stub_(std::move(operations_stub)), + locations_stub_(std::move(locations_stub)) {} + + StatusOr RunSession( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) override; + + std::unique_ptr> + StreamRunSession( + std::shared_ptr context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> + AsyncBidiRunSession( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) 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; + + private: + std::unique_ptr + grpc_stub_; + std::unique_ptr + operations_stub_; + std::unique_ptr + locations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_STUB_H diff --git a/google/cloud/ces/v1/internal/session_stub_factory.cc b/google/cloud/ces/v1/internal/session_stub_factory.cc new file mode 100644 index 0000000000000..fde08279586f5 --- /dev/null +++ b/google/cloud/ces/v1/internal/session_stub_factory.cc @@ -0,0 +1,84 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#include "google/cloud/ces/v1/internal/session_stub_factory.h" +#include "google/cloud/ces/v1/internal/session_auth_decorator.h" +#include "google/cloud/ces/v1/internal/session_logging_decorator.h" +#include "google/cloud/ces/v1/internal/session_metadata_decorator.h" +#include "google/cloud/ces/v1/internal/session_stub.h" +#include "google/cloud/ces/v1/internal/session_tracing_stub.h" +#include "google/cloud/ces/v1/session_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultSessionServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::ces::v1::SessionService::NewStub(channel); + auto service_operations_stub = + google::longrunning::Operations::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_operations_stub), + std::move(service_locations_stub)); + + 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 = MakeSessionServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/session_stub_factory.h b/google/cloud/ces/v1/internal/session_stub_factory.h new file mode 100644 index 0000000000000..466fab2b11975 --- /dev/null +++ b/google/cloud/ces/v1/internal/session_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_STUB_FACTORY_H + +#include "google/cloud/ces/v1/internal/session_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultSessionServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_STUB_FACTORY_H diff --git a/google/cloud/ces/v1/internal/session_tracing_connection.cc b/google/cloud/ces/v1/internal/session_tracing_connection.cc new file mode 100644 index 0000000000000..4f23b06641b2f --- /dev/null +++ b/google/cloud/ces/v1/internal/session_tracing_connection.cc @@ -0,0 +1,129 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#include "google/cloud/ces/v1/internal/session_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +SessionServiceTracingConnection::SessionServiceTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StatusOr +SessionServiceTracingConnection::RunSession( + google::cloud::ces::v1::RunSessionRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::SessionServiceConnection::RunSession"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->RunSession(request)); +} + +StreamRange +SessionServiceTracingConnection::StreamRunSession( + google::cloud::ces::v1::RunSessionRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::SessionServiceConnection::StreamRunSession"); + internal::OTelScope scope(span); + auto sr = child_->StreamRunSession(request); + return internal::MakeTracedStreamRange< + google::cloud::ces::v1::RunSessionResponse>(std::move(span), + std::move(sr)); +} +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> +SessionServiceTracingConnection::AsyncBidiRunSession() { + return child_->AsyncBidiRunSession(); +} + +StreamRange +SessionServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = + internal::MakeSpan("ces_v1::SessionServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +SessionServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::SessionServiceConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +SessionServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = + internal::MakeSpan("ces_v1::SessionServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +SessionServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::SessionServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status SessionServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::SessionServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status SessionServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::SessionServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeSessionServiceTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/internal/session_tracing_connection.h b/google/cloud/ces/v1/internal/session_tracing_connection.h new file mode 100644 index 0000000000000..84ba6db670e2c --- /dev/null +++ b/google/cloud/ces/v1/internal/session_tracing_connection.h @@ -0,0 +1,89 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_TRACING_CONNECTION_H + +#include "google/cloud/ces/v1/session_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class SessionServiceTracingConnection + : public ces_v1::SessionServiceConnection { + public: + ~SessionServiceTracingConnection() override = default; + + explicit SessionServiceTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StatusOr RunSession( + google::cloud::ces::v1::RunSessionRequest const& request) override; + + StreamRange StreamRunSession( + google::cloud::ces::v1::RunSessionRequest const& request) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> + AsyncBidiRunSession() 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_; +}; + +/** + * 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 +MakeSessionServiceTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_TRACING_CONNECTION_H diff --git a/google/cloud/ces/v1/internal/session_tracing_stub.cc b/google/cloud/ces/v1/internal/session_tracing_stub.cc new file mode 100644 index 0000000000000..5ab2cdf05ea8f --- /dev/null +++ b/google/cloud/ces/v1/internal/session_tracing_stub.cc @@ -0,0 +1,162 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#include "google/cloud/ces/v1/internal/session_tracing_stub.h" +#include "google/cloud/internal/async_read_write_stream_tracing.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include "google/cloud/internal/streaming_read_rpc_tracing.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +SessionServiceTracingStub::SessionServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +SessionServiceTracingStub::RunSession( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.SessionService", + "RunSession"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->RunSession(context, options, request)); +} + +std::unique_ptr> +SessionServiceTracingStub::StreamRunSession( + std::shared_ptr context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.SessionService", + "StreamRunSession"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto stream = child_->StreamRunSession(context, options, request); + return std::make_unique>( + std::move(context), std::move(stream), std::move(span)); +} + +std::unique_ptr> +SessionServiceTracingStub::AsyncBidiRunSession( + CompletionQueue const& cq, std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.SessionService", + "BidiRunSession"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto stream = child_->AsyncBidiRunSession(cq, context, std::move(options)); + return std::make_unique>( + std::move(context), std::move(stream), std::move(span)); +} + +StatusOr +SessionServiceTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.SessionService", + "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +SessionServiceTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.SessionService", + "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +SessionServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.SessionService", + "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +SessionServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.SessionService", + "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status SessionServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.SessionService", + "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status SessionServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.SessionService", + "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +std::shared_ptr MakeSessionServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/session_tracing_stub.h b/google/cloud/ces/v1/internal/session_tracing_stub.h new file mode 100644 index 0000000000000..51a212d0391cd --- /dev/null +++ b/google/cloud/ces/v1/internal/session_tracing_stub.h @@ -0,0 +1,106 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_TRACING_STUB_H + +#include "google/cloud/ces/v1/internal/session_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class SessionServiceTracingStub : public SessionServiceStub { + public: + ~SessionServiceTracingStub() override = default; + + explicit SessionServiceTracingStub(std::shared_ptr child); + + StatusOr RunSession( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) override; + + std::unique_ptr> + StreamRunSession( + std::shared_ptr context, Options const& options, + google::cloud::ces::v1::RunSessionRequest const& request) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> + AsyncBidiRunSession( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) 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; + + private: + std::shared_ptr child_; + std::shared_ptr + propagator_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeSessionServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_SESSION_TRACING_STUB_H diff --git a/google/cloud/ces/v1/internal/tool_auth_decorator.cc b/google/cloud/ces/v1/internal/tool_auth_decorator.cc new file mode 100644 index 0000000000000..55679702987a1 --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_auth_decorator.cc @@ -0,0 +1,119 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#include "google/cloud/ces/v1/internal/tool_auth_decorator.h" +#include "google/cloud/ces/v1/tool_service.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ToolServiceAuth::ToolServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +ToolServiceAuth::ExecuteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExecuteToolRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ExecuteTool(context, options, request); +} + +StatusOr +ToolServiceAuth::RetrieveToolSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->RetrieveToolSchema(context, options, request); +} + +StatusOr +ToolServiceAuth::RetrieveTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->RetrieveTools(context, options, request); +} + +StatusOr +ToolServiceAuth::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 ToolServiceAuth::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 +ToolServiceAuth::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 ToolServiceAuth::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 ToolServiceAuth::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 ToolServiceAuth::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); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/tool_auth_decorator.h b/google/cloud/ces/v1/internal/tool_auth_decorator.h new file mode 100644 index 0000000000000..102291dd56c57 --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_auth_decorator.h @@ -0,0 +1,93 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_AUTH_DECORATOR_H + +#include "google/cloud/ces/v1/internal/tool_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ToolServiceAuth : public ToolServiceStub { + public: + ~ToolServiceAuth() override = default; + ToolServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr ExecuteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExecuteToolRequest const& request) override; + + StatusOr + RetrieveToolSchema(grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolSchemaRequest const& + request) override; + + StatusOr RetrieveTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolsRequest 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; + + private: + std::shared_ptr auth_; + std::shared_ptr child_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_AUTH_DECORATOR_H diff --git a/google/cloud/ces/v1/internal/tool_connection_impl.cc b/google/cloud/ces/v1/internal/tool_connection_impl.cc new file mode 100644 index 0000000000000..8fe19363c09b2 --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_connection_impl.cc @@ -0,0 +1,226 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#include "google/cloud/ces/v1/internal/tool_connection_impl.h" +#include "google/cloud/ces/v1/internal/tool_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/pagination_range.h" +#include "google/cloud/internal/retry_loop.h" +#include +#include + +namespace google { +namespace cloud { +namespace ces_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(); +} + +} // namespace + +ToolServiceConnectionImpl::ToolServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions(std::move(options), + ToolServiceConnection::options())) {} + +StatusOr +ToolServiceConnectionImpl::ExecuteTool( + google::cloud::ces::v1::ExecuteToolRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ExecuteTool(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExecuteToolRequest const& request) { + return stub_->ExecuteTool(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +ToolServiceConnectionImpl::RetrieveToolSchema( + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->RetrieveToolSchema(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request) { + return stub_->RetrieveToolSchema(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +ToolServiceConnectionImpl::RetrieveTools( + google::cloud::ces::v1::RetrieveToolsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->RetrieveTools(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolsRequest const& request) { + return stub_->RetrieveTools(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +ToolServiceConnectionImpl::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 +ToolServiceConnectionImpl::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 +ToolServiceConnectionImpl::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 +ToolServiceConnectionImpl::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 ToolServiceConnectionImpl::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 ToolServiceConnectionImpl::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 ces_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/internal/tool_connection_impl.h b/google/cloud/ces/v1/internal/tool_connection_impl.h new file mode 100644 index 0000000000000..8194b4083d487 --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_connection_impl.h @@ -0,0 +1,89 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_CONNECTION_IMPL_H + +#include "google/cloud/ces/v1/internal/tool_retry_traits.h" +#include "google/cloud/ces/v1/internal/tool_stub.h" +#include "google/cloud/ces/v1/tool_connection.h" +#include "google/cloud/ces/v1/tool_connection_idempotency_policy.h" +#include "google/cloud/ces/v1/tool_options.h" +#include "google/cloud/background_threads.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ToolServiceConnectionImpl : public ces_v1::ToolServiceConnection { + public: + ~ToolServiceConnectionImpl() override = default; + + ToolServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, Options options); + + Options options() override { return options_; } + + StatusOr ExecuteTool( + google::cloud::ces::v1::ExecuteToolRequest const& request) override; + + StatusOr + RetrieveToolSchema(google::cloud::ces::v1::RetrieveToolSchemaRequest const& + request) override; + + StatusOr RetrieveTools( + google::cloud::ces::v1::RetrieveToolsRequest const& request) 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 ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_CONNECTION_IMPL_H diff --git a/google/cloud/ces/v1/internal/tool_logging_decorator.cc b/google/cloud/ces/v1/internal/tool_logging_decorator.cc new file mode 100644 index 0000000000000..26036493fae1b --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_logging_decorator.cc @@ -0,0 +1,150 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#include "google/cloud/ces/v1/internal/tool_logging_decorator.h" +#include "google/cloud/ces/v1/tool_service.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ToolServiceLogging::ToolServiceLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +ToolServiceLogging::ExecuteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExecuteToolRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExecuteToolRequest const& request) { + return child_->ExecuteTool(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ToolServiceLogging::RetrieveToolSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request) { + return child_->RetrieveToolSchema(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ToolServiceLogging::RetrieveTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolsRequest const& request) { + return child_->RetrieveTools(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ToolServiceLogging::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 ToolServiceLogging::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 +ToolServiceLogging::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 ToolServiceLogging::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 ToolServiceLogging::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 ToolServiceLogging::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_); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/tool_logging_decorator.h b/google/cloud/ces/v1/internal/tool_logging_decorator.h new file mode 100644 index 0000000000000..72cd67ed6e594 --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_logging_decorator.h @@ -0,0 +1,93 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_LOGGING_DECORATOR_H + +#include "google/cloud/ces/v1/internal/tool_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ToolServiceLogging : public ToolServiceStub { + public: + ~ToolServiceLogging() override = default; + ToolServiceLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr ExecuteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExecuteToolRequest const& request) override; + + StatusOr + RetrieveToolSchema(grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolSchemaRequest const& + request) override; + + StatusOr RetrieveTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolsRequest 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; + + private: + std::shared_ptr child_; + TracingOptions tracing_options_; +}; // ToolServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_LOGGING_DECORATOR_H diff --git a/google/cloud/ces/v1/internal/tool_metadata_decorator.cc b/google/cloud/ces/v1/internal/tool_metadata_decorator.cc new file mode 100644 index 0000000000000..d0fd20c08a4c3 --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_metadata_decorator.cc @@ -0,0 +1,146 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#include "google/cloud/ces/v1/internal/tool_metadata_decorator.h" +#include "google/cloud/ces/v1/tool_service.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ToolServiceMetadata::ToolServiceMetadata( + 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 +ToolServiceMetadata::ExecuteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExecuteToolRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ExecuteTool(context, options, request); +} + +StatusOr +ToolServiceMetadata::RetrieveToolSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->RetrieveToolSchema(context, options, request); +} + +StatusOr +ToolServiceMetadata::RetrieveTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("toolset=", internal::UrlEncode(request.toolset()))); + return child_->RetrieveTools(context, options, request); +} + +StatusOr +ToolServiceMetadata::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 ToolServiceMetadata::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 +ToolServiceMetadata::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 ToolServiceMetadata::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 ToolServiceMetadata::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 ToolServiceMetadata::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); +} + +void ToolServiceMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void ToolServiceMetadata::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 ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/tool_metadata_decorator.h b/google/cloud/ces/v1/internal/tool_metadata_decorator.h new file mode 100644 index 0000000000000..3674224c51dc3 --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_metadata_decorator.h @@ -0,0 +1,98 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_METADATA_DECORATOR_H + +#include "google/cloud/ces/v1/internal/tool_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ToolServiceMetadata : public ToolServiceStub { + public: + ~ToolServiceMetadata() override = default; + ToolServiceMetadata(std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr ExecuteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExecuteToolRequest const& request) override; + + StatusOr + RetrieveToolSchema(grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolSchemaRequest const& + request) override; + + StatusOr RetrieveTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolsRequest 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; + + 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 ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_METADATA_DECORATOR_H diff --git a/google/cloud/ces/v1/internal/tool_option_defaults.cc b/google/cloud/ces/v1/internal/tool_option_defaults.cc new file mode 100644 index 0000000000000..b924efccf4c8f --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_option_defaults.cc @@ -0,0 +1,64 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#include "google/cloud/ces/v1/internal/tool_option_defaults.h" +#include "google/cloud/ces/v1/tool_connection.h" +#include "google/cloud/ces/v1/tool_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 ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options ToolServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_TOOL_SERVICE_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_TOOL_SERVICE_AUTHORITY", "ces.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + ces_v1::ToolServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) + .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( + ces_v1::MakeDefaultToolServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/internal/tool_option_defaults.h b/google/cloud/ces/v1/internal/tool_option_defaults.h new file mode 100644 index 0000000000000..36090e5547cfb --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options ToolServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_OPTION_DEFAULTS_H diff --git a/google/cloud/ces/v1/internal/tool_retry_traits.h b/google/cloud/ces/v1/internal/tool_retry_traits.h new file mode 100644 index 0000000000000..c744035d4d266 --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct ToolServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_RETRY_TRAITS_H diff --git a/google/cloud/ces/v1/internal/tool_sources.cc b/google/cloud/ces/v1/internal/tool_sources.cc new file mode 100644 index 0000000000000..6f06559be9d8b --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/ces/v1/internal/tool_auth_decorator.cc" +#include "google/cloud/ces/v1/internal/tool_connection_impl.cc" +#include "google/cloud/ces/v1/internal/tool_logging_decorator.cc" +#include "google/cloud/ces/v1/internal/tool_metadata_decorator.cc" +#include "google/cloud/ces/v1/internal/tool_option_defaults.cc" +#include "google/cloud/ces/v1/internal/tool_stub.cc" +#include "google/cloud/ces/v1/internal/tool_stub_factory.cc" +#include "google/cloud/ces/v1/internal/tool_tracing_connection.cc" +#include "google/cloud/ces/v1/internal/tool_tracing_stub.cc" +#include "google/cloud/ces/v1/tool_client.cc" +#include "google/cloud/ces/v1/tool_connection.cc" +#include "google/cloud/ces/v1/tool_connection_idempotency_policy.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/ces/v1/internal/tool_stub.cc b/google/cloud/ces/v1/internal/tool_stub.cc new file mode 100644 index 0000000000000..36f9b2e06a983 --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_stub.cc @@ -0,0 +1,145 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#include "google/cloud/ces/v1/internal/tool_stub.h" +#include "google/cloud/ces/v1/tool_service.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ToolServiceStub::~ToolServiceStub() = default; + +StatusOr +DefaultToolServiceStub::ExecuteTool( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::ExecuteToolRequest const& request) { + google::cloud::ces::v1::ExecuteToolResponse response; + auto status = grpc_stub_->ExecuteTool(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultToolServiceStub::RetrieveToolSchema( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request) { + google::cloud::ces::v1::RetrieveToolSchemaResponse response; + auto status = grpc_stub_->RetrieveToolSchema(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultToolServiceStub::RetrieveTools( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::RetrieveToolsRequest const& request) { + google::cloud::ces::v1::RetrieveToolsResponse response; + auto status = grpc_stub_->RetrieveTools(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultToolServiceStub::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 DefaultToolServiceStub::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 +DefaultToolServiceStub::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 DefaultToolServiceStub::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 DefaultToolServiceStub::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 DefaultToolServiceStub::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(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/tool_stub.h b/google/cloud/ces/v1/internal/tool_stub.h new file mode 100644 index 0000000000000..5685f0c4c0b68 --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_stub.h @@ -0,0 +1,148 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_STUB_H + +#include "google/cloud/ces/v1/tool_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ToolServiceStub { + public: + virtual ~ToolServiceStub() = 0; + + virtual StatusOr ExecuteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExecuteToolRequest const& request) = 0; + + virtual StatusOr + RetrieveToolSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request) = 0; + + virtual StatusOr RetrieveTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolsRequest 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; +}; + +class DefaultToolServiceStub : public ToolServiceStub { + public: + explicit DefaultToolServiceStub( + std::unique_ptr + grpc_stub, + std::unique_ptr + operations_stub, + std::unique_ptr + locations_stub) + : grpc_stub_(std::move(grpc_stub)), + operations_stub_(std::move(operations_stub)), + locations_stub_(std::move(locations_stub)) {} + + StatusOr ExecuteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExecuteToolRequest const& request) override; + + StatusOr + RetrieveToolSchema(grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolSchemaRequest const& + request) override; + + StatusOr RetrieveTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolsRequest 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; + + private: + std::unique_ptr + grpc_stub_; + std::unique_ptr + operations_stub_; + std::unique_ptr + locations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_STUB_H diff --git a/google/cloud/ces/v1/internal/tool_stub_factory.cc b/google/cloud/ces/v1/internal/tool_stub_factory.cc new file mode 100644 index 0000000000000..6c52f472af306 --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_stub_factory.cc @@ -0,0 +1,83 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#include "google/cloud/ces/v1/internal/tool_stub_factory.h" +#include "google/cloud/ces/v1/internal/tool_auth_decorator.h" +#include "google/cloud/ces/v1/internal/tool_logging_decorator.h" +#include "google/cloud/ces/v1/internal/tool_metadata_decorator.h" +#include "google/cloud/ces/v1/internal/tool_stub.h" +#include "google/cloud/ces/v1/internal/tool_tracing_stub.h" +#include "google/cloud/ces/v1/tool_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultToolServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::ces::v1::ToolService::NewStub(channel); + auto service_operations_stub = + google::longrunning::Operations::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_operations_stub), + std::move(service_locations_stub)); + + 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 = MakeToolServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/tool_stub_factory.h b/google/cloud/ces/v1/internal/tool_stub_factory.h new file mode 100644 index 0000000000000..1932244605d1f --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_STUB_FACTORY_H + +#include "google/cloud/ces/v1/internal/tool_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultToolServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_STUB_FACTORY_H diff --git a/google/cloud/ces/v1/internal/tool_tracing_connection.cc b/google/cloud/ces/v1/internal/tool_tracing_connection.cc new file mode 100644 index 0000000000000..0d838a0b4826d --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_tracing_connection.cc @@ -0,0 +1,125 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#include "google/cloud/ces/v1/internal/tool_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ToolServiceTracingConnection::ToolServiceTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StatusOr +ToolServiceTracingConnection::ExecuteTool( + google::cloud::ces::v1::ExecuteToolRequest const& request) { + auto span = internal::MakeSpan("ces_v1::ToolServiceConnection::ExecuteTool"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->ExecuteTool(request)); +} + +StatusOr +ToolServiceTracingConnection::RetrieveToolSchema( + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::ToolServiceConnection::RetrieveToolSchema"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->RetrieveToolSchema(request)); +} + +StatusOr +ToolServiceTracingConnection::RetrieveTools( + google::cloud::ces::v1::RetrieveToolsRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::ToolServiceConnection::RetrieveTools"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->RetrieveTools(request)); +} + +StreamRange +ToolServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = + internal::MakeSpan("ces_v1::ToolServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +ToolServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpan("ces_v1::ToolServiceConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +ToolServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = + internal::MakeSpan("ces_v1::ToolServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +ToolServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpan("ces_v1::ToolServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status ToolServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::ToolServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status ToolServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::ToolServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr MakeToolServiceTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/internal/tool_tracing_connection.h b/google/cloud/ces/v1/internal/tool_tracing_connection.h new file mode 100644 index 0000000000000..18c15cb59127c --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_tracing_connection.h @@ -0,0 +1,86 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_TRACING_CONNECTION_H + +#include "google/cloud/ces/v1/tool_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ToolServiceTracingConnection : public ces_v1::ToolServiceConnection { + public: + ~ToolServiceTracingConnection() override = default; + + explicit ToolServiceTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StatusOr ExecuteTool( + google::cloud::ces::v1::ExecuteToolRequest const& request) override; + + StatusOr + RetrieveToolSchema(google::cloud::ces::v1::RetrieveToolSchemaRequest const& + request) override; + + StatusOr RetrieveTools( + google::cloud::ces::v1::RetrieveToolsRequest const& request) 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_; +}; + +/** + * 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 MakeToolServiceTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_TRACING_CONNECTION_H diff --git a/google/cloud/ces/v1/internal/tool_tracing_stub.cc b/google/cloud/ces/v1/internal/tool_tracing_stub.cc new file mode 100644 index 0000000000000..2424caf5f0ff9 --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_tracing_stub.cc @@ -0,0 +1,150 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#include "google/cloud/ces/v1/internal/tool_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ToolServiceTracingStub::ToolServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +ToolServiceTracingStub::ExecuteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExecuteToolRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.ToolService", "ExecuteTool"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ExecuteTool(context, options, request)); +} + +StatusOr +ToolServiceTracingStub::RetrieveToolSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.ToolService", + "RetrieveToolSchema"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->RetrieveToolSchema(context, options, request)); +} + +StatusOr +ToolServiceTracingStub::RetrieveTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.ToolService", + "RetrieveTools"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->RetrieveTools(context, options, request)); +} + +StatusOr +ToolServiceTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.ToolService", + "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr ToolServiceTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.ToolService", "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +ToolServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.ToolService", + "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr ToolServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.ces.v1.ToolService", "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status ToolServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.ToolService", + "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status ToolServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.ToolService", + "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +std::shared_ptr MakeToolServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/tool_tracing_stub.h b/google/cloud/ces/v1/internal/tool_tracing_stub.h new file mode 100644 index 0000000000000..e8a0b4df0ea28 --- /dev/null +++ b/google/cloud/ces/v1/internal/tool_tracing_stub.h @@ -0,0 +1,101 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_TRACING_STUB_H + +#include "google/cloud/ces/v1/internal/tool_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ToolServiceTracingStub : public ToolServiceStub { + public: + ~ToolServiceTracingStub() override = default; + + explicit ToolServiceTracingStub(std::shared_ptr child); + + StatusOr ExecuteTool( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::ExecuteToolRequest const& request) override; + + StatusOr + RetrieveToolSchema(grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolSchemaRequest const& + request) override; + + StatusOr RetrieveTools( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::RetrieveToolsRequest 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; + + private: + std::shared_ptr child_; + std::shared_ptr + propagator_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeToolServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_TOOL_TRACING_STUB_H diff --git a/google/cloud/ces/v1/internal/widget_auth_decorator.cc b/google/cloud/ces/v1/internal/widget_auth_decorator.cc new file mode 100644 index 0000000000000..816c764752445 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_auth_decorator.cc @@ -0,0 +1,101 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#include "google/cloud/ces/v1/internal/widget_auth_decorator.h" +#include "google/cloud/ces/v1/widget_service.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WidgetServiceAuth::WidgetServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +WidgetServiceAuth::GenerateChatToken( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GenerateChatTokenRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GenerateChatToken(context, options, request); +} + +StatusOr +WidgetServiceAuth::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 WidgetServiceAuth::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 +WidgetServiceAuth::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 WidgetServiceAuth::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 WidgetServiceAuth::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 WidgetServiceAuth::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); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/widget_auth_decorator.h b/google/cloud/ces/v1/internal/widget_auth_decorator.h new file mode 100644 index 0000000000000..9629e59b175e0 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_auth_decorator.h @@ -0,0 +1,84 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_AUTH_DECORATOR_H + +#include "google/cloud/ces/v1/internal/widget_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WidgetServiceAuth : public WidgetServiceStub { + public: + ~WidgetServiceAuth() override = default; + WidgetServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr GenerateChatToken( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GenerateChatTokenRequest 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; + + private: + std::shared_ptr auth_; + std::shared_ptr child_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_AUTH_DECORATOR_H diff --git a/google/cloud/ces/v1/internal/widget_connection_impl.cc b/google/cloud/ces/v1/internal/widget_connection_impl.cc new file mode 100644 index 0000000000000..7156e4753203d --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_connection_impl.cc @@ -0,0 +1,198 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#include "google/cloud/ces/v1/internal/widget_connection_impl.h" +#include "google/cloud/ces/v1/internal/widget_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/pagination_range.h" +#include "google/cloud/internal/retry_loop.h" +#include +#include + +namespace google { +namespace cloud { +namespace ces_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(); +} + +} // namespace + +WidgetServiceConnectionImpl::WidgetServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions(std::move(options), + WidgetServiceConnection::options())) {} + +StatusOr +WidgetServiceConnectionImpl::GenerateChatToken( + google::cloud::ces::v1::GenerateChatTokenRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GenerateChatToken(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GenerateChatTokenRequest const& request) { + return stub_->GenerateChatToken(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +WidgetServiceConnectionImpl::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 +WidgetServiceConnectionImpl::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 +WidgetServiceConnectionImpl::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 +WidgetServiceConnectionImpl::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 WidgetServiceConnectionImpl::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 WidgetServiceConnectionImpl::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 ces_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/internal/widget_connection_impl.h b/google/cloud/ces/v1/internal/widget_connection_impl.h new file mode 100644 index 0000000000000..2aa1a972c9df3 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_connection_impl.h @@ -0,0 +1,83 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_CONNECTION_IMPL_H + +#include "google/cloud/ces/v1/internal/widget_retry_traits.h" +#include "google/cloud/ces/v1/internal/widget_stub.h" +#include "google/cloud/ces/v1/widget_connection.h" +#include "google/cloud/ces/v1/widget_connection_idempotency_policy.h" +#include "google/cloud/ces/v1/widget_options.h" +#include "google/cloud/background_threads.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WidgetServiceConnectionImpl : public ces_v1::WidgetServiceConnection { + public: + ~WidgetServiceConnectionImpl() override = default; + + WidgetServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + StatusOr GenerateChatToken( + google::cloud::ces::v1::GenerateChatTokenRequest const& request) 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 ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_CONNECTION_IMPL_H diff --git a/google/cloud/ces/v1/internal/widget_logging_decorator.cc b/google/cloud/ces/v1/internal/widget_logging_decorator.cc new file mode 100644 index 0000000000000..3fbb098efb69b --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_logging_decorator.cc @@ -0,0 +1,126 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#include "google/cloud/ces/v1/internal/widget_logging_decorator.h" +#include "google/cloud/ces/v1/widget_service.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WidgetServiceLogging::WidgetServiceLogging( + std::shared_ptr child, TracingOptions tracing_options, + std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +WidgetServiceLogging::GenerateChatToken( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GenerateChatTokenRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GenerateChatTokenRequest const& request) { + return child_->GenerateChatToken(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WidgetServiceLogging::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 WidgetServiceLogging::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 +WidgetServiceLogging::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 WidgetServiceLogging::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 WidgetServiceLogging::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 WidgetServiceLogging::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_); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/widget_logging_decorator.h b/google/cloud/ces/v1/internal/widget_logging_decorator.h new file mode 100644 index 0000000000000..20c3130ab1ffb --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_logging_decorator.h @@ -0,0 +1,84 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_LOGGING_DECORATOR_H + +#include "google/cloud/ces/v1/internal/widget_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WidgetServiceLogging : public WidgetServiceStub { + public: + ~WidgetServiceLogging() override = default; + WidgetServiceLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr GenerateChatToken( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GenerateChatTokenRequest 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; + + private: + std::shared_ptr child_; + TracingOptions tracing_options_; +}; // WidgetServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_LOGGING_DECORATOR_H diff --git a/google/cloud/ces/v1/internal/widget_metadata_decorator.cc b/google/cloud/ces/v1/internal/widget_metadata_decorator.cc new file mode 100644 index 0000000000000..b1d5b8cb741e7 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_metadata_decorator.cc @@ -0,0 +1,128 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#include "google/cloud/ces/v1/internal/widget_metadata_decorator.h" +#include "google/cloud/ces/v1/widget_service.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WidgetServiceMetadata::WidgetServiceMetadata( + 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 +WidgetServiceMetadata::GenerateChatToken( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GenerateChatTokenRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GenerateChatToken(context, options, request); +} + +StatusOr +WidgetServiceMetadata::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 WidgetServiceMetadata::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 +WidgetServiceMetadata::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 WidgetServiceMetadata::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 WidgetServiceMetadata::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 WidgetServiceMetadata::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); +} + +void WidgetServiceMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void WidgetServiceMetadata::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 ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/widget_metadata_decorator.h b/google/cloud/ces/v1/internal/widget_metadata_decorator.h new file mode 100644 index 0000000000000..4db9741a873e2 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_metadata_decorator.h @@ -0,0 +1,89 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_METADATA_DECORATOR_H + +#include "google/cloud/ces/v1/internal/widget_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WidgetServiceMetadata : public WidgetServiceStub { + public: + ~WidgetServiceMetadata() override = default; + WidgetServiceMetadata(std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr GenerateChatToken( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GenerateChatTokenRequest 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; + + 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 ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_METADATA_DECORATOR_H diff --git a/google/cloud/ces/v1/internal/widget_option_defaults.cc b/google/cloud/ces/v1/internal/widget_option_defaults.cc new file mode 100644 index 0000000000000..ffd69d3e72285 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_option_defaults.cc @@ -0,0 +1,64 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#include "google/cloud/ces/v1/internal/widget_option_defaults.h" +#include "google/cloud/ces/v1/widget_connection.h" +#include "google/cloud/ces/v1/widget_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 ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options WidgetServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_WIDGET_SERVICE_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_WIDGET_SERVICE_AUTHORITY", "ces.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + ces_v1::WidgetServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) + .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( + ces_v1::MakeDefaultWidgetServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/internal/widget_option_defaults.h b/google/cloud/ces/v1/internal/widget_option_defaults.h new file mode 100644 index 0000000000000..d3d4dd82bf778 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options WidgetServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_OPTION_DEFAULTS_H diff --git a/google/cloud/ces/v1/internal/widget_retry_traits.h b/google/cloud/ces/v1/internal/widget_retry_traits.h new file mode 100644 index 0000000000000..abbd28fa56b33 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct WidgetServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_RETRY_TRAITS_H diff --git a/google/cloud/ces/v1/internal/widget_sources.cc b/google/cloud/ces/v1/internal/widget_sources.cc new file mode 100644 index 0000000000000..e2a7c2e2615e9 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/ces/v1/internal/widget_auth_decorator.cc" +#include "google/cloud/ces/v1/internal/widget_connection_impl.cc" +#include "google/cloud/ces/v1/internal/widget_logging_decorator.cc" +#include "google/cloud/ces/v1/internal/widget_metadata_decorator.cc" +#include "google/cloud/ces/v1/internal/widget_option_defaults.cc" +#include "google/cloud/ces/v1/internal/widget_stub.cc" +#include "google/cloud/ces/v1/internal/widget_stub_factory.cc" +#include "google/cloud/ces/v1/internal/widget_tracing_connection.cc" +#include "google/cloud/ces/v1/internal/widget_tracing_stub.cc" +#include "google/cloud/ces/v1/widget_client.cc" +#include "google/cloud/ces/v1/widget_connection.cc" +#include "google/cloud/ces/v1/widget_connection_idempotency_policy.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/ces/v1/internal/widget_stub.cc b/google/cloud/ces/v1/internal/widget_stub.cc new file mode 100644 index 0000000000000..46083972aa37e --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_stub.cc @@ -0,0 +1,122 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#include "google/cloud/ces/v1/internal/widget_stub.h" +#include "google/cloud/ces/v1/widget_service.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WidgetServiceStub::~WidgetServiceStub() = default; + +StatusOr +DefaultWidgetServiceStub::GenerateChatToken( + grpc::ClientContext& context, Options const&, + google::cloud::ces::v1::GenerateChatTokenRequest const& request) { + google::cloud::ces::v1::GenerateChatTokenResponse response; + auto status = grpc_stub_->GenerateChatToken(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWidgetServiceStub::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 +DefaultWidgetServiceStub::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 +DefaultWidgetServiceStub::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 DefaultWidgetServiceStub::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 DefaultWidgetServiceStub::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 DefaultWidgetServiceStub::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(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/widget_stub.h b/google/cloud/ces/v1/internal/widget_stub.h new file mode 100644 index 0000000000000..3926d810b596d --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_stub.h @@ -0,0 +1,131 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_STUB_H + +#include "google/cloud/ces/v1/widget_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WidgetServiceStub { + public: + virtual ~WidgetServiceStub() = 0; + + virtual StatusOr + GenerateChatToken( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GenerateChatTokenRequest 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; +}; + +class DefaultWidgetServiceStub : public WidgetServiceStub { + public: + explicit DefaultWidgetServiceStub( + std::unique_ptr + grpc_stub, + std::unique_ptr + operations_stub, + std::unique_ptr + locations_stub) + : grpc_stub_(std::move(grpc_stub)), + operations_stub_(std::move(operations_stub)), + locations_stub_(std::move(locations_stub)) {} + + StatusOr GenerateChatToken( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GenerateChatTokenRequest 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; + + private: + std::unique_ptr + grpc_stub_; + std::unique_ptr + operations_stub_; + std::unique_ptr + locations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_STUB_H diff --git a/google/cloud/ces/v1/internal/widget_stub_factory.cc b/google/cloud/ces/v1/internal/widget_stub_factory.cc new file mode 100644 index 0000000000000..a4e9dd3bed944 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_stub_factory.cc @@ -0,0 +1,84 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#include "google/cloud/ces/v1/internal/widget_stub_factory.h" +#include "google/cloud/ces/v1/internal/widget_auth_decorator.h" +#include "google/cloud/ces/v1/internal/widget_logging_decorator.h" +#include "google/cloud/ces/v1/internal/widget_metadata_decorator.h" +#include "google/cloud/ces/v1/internal/widget_stub.h" +#include "google/cloud/ces/v1/internal/widget_tracing_stub.h" +#include "google/cloud/ces/v1/widget_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultWidgetServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::ces::v1::WidgetService::NewStub(channel); + auto service_operations_stub = + google::longrunning::Operations::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_operations_stub), + std::move(service_locations_stub)); + + 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 = MakeWidgetServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/widget_stub_factory.h b/google/cloud/ces/v1/internal/widget_stub_factory.h new file mode 100644 index 0000000000000..91880f653a868 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_STUB_FACTORY_H + +#include "google/cloud/ces/v1/internal/widget_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultWidgetServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_STUB_FACTORY_H diff --git a/google/cloud/ces/v1/internal/widget_tracing_connection.cc b/google/cloud/ces/v1/internal/widget_tracing_connection.cc new file mode 100644 index 0000000000000..9ccdc7ee4edb2 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_tracing_connection.cc @@ -0,0 +1,111 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#include "google/cloud/ces/v1/internal/widget_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WidgetServiceTracingConnection::WidgetServiceTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StatusOr +WidgetServiceTracingConnection::GenerateChatToken( + google::cloud::ces::v1::GenerateChatTokenRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::WidgetServiceConnection::GenerateChatToken"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GenerateChatToken(request)); +} + +StreamRange +WidgetServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = + internal::MakeSpan("ces_v1::WidgetServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +WidgetServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::WidgetServiceConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +WidgetServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = + internal::MakeSpan("ces_v1::WidgetServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +WidgetServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::WidgetServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status WidgetServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::WidgetServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status WidgetServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = + internal::MakeSpan("ces_v1::WidgetServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeWidgetServiceTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/internal/widget_tracing_connection.h b/google/cloud/ces/v1/internal/widget_tracing_connection.h new file mode 100644 index 0000000000000..91182d3214b39 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_tracing_connection.h @@ -0,0 +1,80 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_TRACING_CONNECTION_H + +#include "google/cloud/ces/v1/widget_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WidgetServiceTracingConnection : public ces_v1::WidgetServiceConnection { + public: + ~WidgetServiceTracingConnection() override = default; + + explicit WidgetServiceTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StatusOr GenerateChatToken( + google::cloud::ces::v1::GenerateChatTokenRequest const& request) 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_; +}; + +/** + * 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 +MakeWidgetServiceTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_TRACING_CONNECTION_H diff --git a/google/cloud/ces/v1/internal/widget_tracing_stub.cc b/google/cloud/ces/v1/internal/widget_tracing_stub.cc new file mode 100644 index 0000000000000..fbbc67894c481 --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_tracing_stub.cc @@ -0,0 +1,127 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#include "google/cloud/ces/v1/internal/widget_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WidgetServiceTracingStub::WidgetServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +WidgetServiceTracingStub::GenerateChatToken( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GenerateChatTokenRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.WidgetService", + "GenerateChatToken"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->GenerateChatToken(context, options, request)); +} + +StatusOr +WidgetServiceTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.WidgetService", + "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +WidgetServiceTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.WidgetService", + "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +WidgetServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.WidgetService", + "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr WidgetServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.WidgetService", + "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status WidgetServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.WidgetService", + "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status WidgetServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.ces.v1.WidgetService", + "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +std::shared_ptr MakeWidgetServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/ces/v1/internal/widget_tracing_stub.h b/google/cloud/ces/v1/internal/widget_tracing_stub.h new file mode 100644 index 0000000000000..036813e6af8ea --- /dev/null +++ b/google/cloud/ces/v1/internal/widget_tracing_stub.h @@ -0,0 +1,92 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_TRACING_STUB_H + +#include "google/cloud/ces/v1/internal/widget_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace ces_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WidgetServiceTracingStub : public WidgetServiceStub { + public: + ~WidgetServiceTracingStub() override = default; + + explicit WidgetServiceTracingStub(std::shared_ptr child); + + StatusOr GenerateChatToken( + grpc::ClientContext& context, Options const& options, + google::cloud::ces::v1::GenerateChatTokenRequest 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; + + private: + std::shared_ptr child_; + std::shared_ptr + propagator_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeWidgetServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_INTERNAL_WIDGET_TRACING_STUB_H diff --git a/google/cloud/ces/v1/mocks/mock_agent_connection.h b/google/cloud/ces/v1/mocks/mock_agent_connection.h new file mode 100644 index 0000000000000..117974e9e6775 --- /dev/null +++ b/google/cloud/ces/v1/mocks/mock_agent_connection.h @@ -0,0 +1,471 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_MOCKS_MOCK_AGENT_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_MOCKS_MOCK_AGENT_CONNECTION_H + +#include "google/cloud/ces/v1/agent_connection.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `AgentServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `AgentServiceClient`. To do so, + * construct an object of type `AgentServiceClient` 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 MockAgentServiceConnection : public ces_v1::AgentServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD((StreamRange), ListApps, + (google::cloud::ces::v1::ListAppsRequest request), (override)); + + MOCK_METHOD(StatusOr, GetApp, + (google::cloud::ces::v1::GetAppRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateApp(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, CreateApp, + (google::cloud::ces::v1::CreateAppRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateApp(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, CreateApp, + (NoAwaitTag, + google::cloud::ces::v1::CreateAppRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateApp(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, CreateApp, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD(StatusOr, UpdateApp, + (google::cloud::ces::v1::UpdateAppRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteApp(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteApp, + (google::cloud::ces::v1::DeleteAppRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteApp(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteApp, + (NoAwaitTag, + google::cloud::ces::v1::DeleteAppRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteApp(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteApp, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ExportApp(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ExportApp, + (google::cloud::ces::v1::ExportAppRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, ExportApp(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, ExportApp, + (NoAwaitTag, + google::cloud::ces::v1::ExportAppRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, ExportApp(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ExportApp, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ImportApp(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ImportApp, + (google::cloud::ces::v1::ImportAppRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, ImportApp(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, ImportApp, + (NoAwaitTag, + google::cloud::ces::v1::ImportAppRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, ImportApp(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ImportApp, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), ListAgents, + (google::cloud::ces::v1::ListAgentsRequest request), (override)); + + MOCK_METHOD(StatusOr, GetAgent, + (google::cloud::ces::v1::GetAgentRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, CreateAgent, + (google::cloud::ces::v1::CreateAgentRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, UpdateAgent, + (google::cloud::ces::v1::UpdateAgentRequest const& request), + (override)); + + MOCK_METHOD(Status, DeleteAgent, + (google::cloud::ces::v1::DeleteAgentRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), ListExamples, + (google::cloud::ces::v1::ListExamplesRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetExample, + (google::cloud::ces::v1::GetExampleRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, CreateExample, + (google::cloud::ces::v1::CreateExampleRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, UpdateExample, + (google::cloud::ces::v1::UpdateExampleRequest const& request), + (override)); + + MOCK_METHOD(Status, DeleteExample, + (google::cloud::ces::v1::DeleteExampleRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), ListTools, + (google::cloud::ces::v1::ListToolsRequest request), (override)); + + MOCK_METHOD(StatusOr, GetTool, + (google::cloud::ces::v1::GetToolRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListConversations, + (google::cloud::ces::v1::ListConversationsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetConversation, + (google::cloud::ces::v1::GetConversationRequest const& request), + (override)); + + MOCK_METHOD( + Status, DeleteConversation, + (google::cloud::ces::v1::DeleteConversationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// BatchDeleteConversations(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + BatchDeleteConversations, + (google::cloud::ces::v1::BatchDeleteConversationsRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, BatchDeleteConversations(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, BatchDeleteConversations, + (NoAwaitTag, + google::cloud::ces::v1::BatchDeleteConversationsRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// BatchDeleteConversations(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + BatchDeleteConversations, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD(StatusOr, CreateTool, + (google::cloud::ces::v1::CreateToolRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, UpdateTool, + (google::cloud::ces::v1::UpdateToolRequest const& request), + (override)); + + MOCK_METHOD(Status, DeleteTool, + (google::cloud::ces::v1::DeleteToolRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), ListGuardrails, + (google::cloud::ces::v1::ListGuardrailsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetGuardrail, + (google::cloud::ces::v1::GetGuardrailRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, CreateGuardrail, + (google::cloud::ces::v1::CreateGuardrailRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, UpdateGuardrail, + (google::cloud::ces::v1::UpdateGuardrailRequest const& request), + (override)); + + MOCK_METHOD(Status, DeleteGuardrail, + (google::cloud::ces::v1::DeleteGuardrailRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListDeployments, + (google::cloud::ces::v1::ListDeploymentsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetDeployment, + (google::cloud::ces::v1::GetDeploymentRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, CreateDeployment, + (google::cloud::ces::v1::CreateDeploymentRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, UpdateDeployment, + (google::cloud::ces::v1::UpdateDeploymentRequest const& request), + (override)); + + MOCK_METHOD(Status, DeleteDeployment, + (google::cloud::ces::v1::DeleteDeploymentRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), ListToolsets, + (google::cloud::ces::v1::ListToolsetsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetToolset, + (google::cloud::ces::v1::GetToolsetRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, CreateToolset, + (google::cloud::ces::v1::CreateToolsetRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, UpdateToolset, + (google::cloud::ces::v1::UpdateToolsetRequest const& request), + (override)); + + MOCK_METHOD(Status, DeleteToolset, + (google::cloud::ces::v1::DeleteToolsetRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListAppVersions, + (google::cloud::ces::v1::ListAppVersionsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetAppVersion, + (google::cloud::ces::v1::GetAppVersionRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, CreateAppVersion, + (google::cloud::ces::v1::CreateAppVersionRequest const& request), + (override)); + + MOCK_METHOD(Status, DeleteAppVersion, + (google::cloud::ces::v1::DeleteAppVersionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// RestoreAppVersion(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + RestoreAppVersion, + (google::cloud::ces::v1::RestoreAppVersionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, RestoreAppVersion(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, RestoreAppVersion, + (NoAwaitTag, + google::cloud::ces::v1::RestoreAppVersionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// RestoreAppVersion(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + RestoreAppVersion, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), ListChangelogs, + (google::cloud::ces::v1::ListChangelogsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetChangelog, + (google::cloud::ces::v1::GetChangelogRequest const& request), + (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 ces_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_MOCKS_MOCK_AGENT_CONNECTION_H diff --git a/google/cloud/ces/v1/mocks/mock_session_connection.h b/google/cloud/ces/v1/mocks/mock_session_connection.h new file mode 100644 index 0000000000000..79619823353f5 --- /dev/null +++ b/google/cloud/ces/v1/mocks/mock_session_connection.h @@ -0,0 +1,92 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_MOCKS_MOCK_SESSION_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_MOCKS_MOCK_SESSION_CONNECTION_H + +#include "google/cloud/ces/v1/session_connection.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `SessionServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `SessionServiceClient`. To do so, + * construct an object of type `SessionServiceClient` 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 MockSessionServiceConnection : public ces_v1::SessionServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD(StatusOr, RunSession, + (google::cloud::ces::v1::RunSessionRequest const& request), + (override)); + + MOCK_METHOD(StreamRange, + StreamRunSession, + (google::cloud::ces::v1::RunSessionRequest const& request), + (override)); + + MOCK_METHOD((std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>>), + AsyncBidiRunSession, (), (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 ces_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_MOCKS_MOCK_SESSION_CONNECTION_H diff --git a/google/cloud/ces/v1/mocks/mock_tool_connection.h b/google/cloud/ces/v1/mocks/mock_tool_connection.h new file mode 100644 index 0000000000000..715f067c4d420 --- /dev/null +++ b/google/cloud/ces/v1/mocks/mock_tool_connection.h @@ -0,0 +1,94 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_MOCKS_MOCK_TOOL_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_MOCKS_MOCK_TOOL_CONNECTION_H + +#include "google/cloud/ces/v1/tool_connection.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `ToolServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `ToolServiceClient`. To do so, + * construct an object of type `ToolServiceClient` 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 MockToolServiceConnection : public ces_v1::ToolServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD(StatusOr, + ExecuteTool, + (google::cloud::ces::v1::ExecuteToolRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, + RetrieveToolSchema, + (google::cloud::ces::v1::RetrieveToolSchemaRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, + RetrieveTools, + (google::cloud::ces::v1::RetrieveToolsRequest const& request), + (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 ces_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_MOCKS_MOCK_TOOL_CONNECTION_H diff --git a/google/cloud/ces/v1/mocks/mock_widget_connection.h b/google/cloud/ces/v1/mocks/mock_widget_connection.h new file mode 100644 index 0000000000000..728d6784b5f7f --- /dev/null +++ b/google/cloud/ces/v1/mocks/mock_widget_connection.h @@ -0,0 +1,83 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_MOCKS_MOCK_WIDGET_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_MOCKS_MOCK_WIDGET_CONNECTION_H + +#include "google/cloud/ces/v1/widget_connection.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `WidgetServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `WidgetServiceClient`. To do so, + * construct an object of type `WidgetServiceClient` 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 MockWidgetServiceConnection : public ces_v1::WidgetServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD(StatusOr, + GenerateChatToken, + (google::cloud::ces::v1::GenerateChatTokenRequest const& request), + (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 ces_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_MOCKS_MOCK_WIDGET_CONNECTION_H diff --git a/google/cloud/ces/v1/samples/agent_client_samples.cc b/google/cloud/ces/v1/samples/agent_client_samples.cc new file mode 100644 index 0000000000000..ed547d22e94d1 --- /dev/null +++ b/google/cloud/ces/v1/samples/agent_client_samples.cc @@ -0,0 +1,220 @@ +// Copyright 2026 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/ces/v1/agent_service.proto + +#include "google/cloud/ces/v1/agent_client.h" +#include "google/cloud/ces/v1/agent_connection_idempotency_policy.h" +#include "google/cloud/ces/v1/agent_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 "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: ces_v1::AgentServiceClient +// 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::ces_v1::AgentServiceClient( + google::cloud::ces_v1::MakeAgentServiceConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::ces_v1::AgentServiceClient( + google::cloud::ces_v1::MakeAgentServiceConnection(*ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::ces_v1::AgentServiceConnectionIdempotencyPolicy { + public: + ~CustomIdempotencyPolicy() override = default; + std::unique_ptr< + google::cloud::ces_v1::AgentServiceConnectionIdempotencyPolicy> + 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::ces_v1::AgentServiceLimitedErrorCountRetryPolicy(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::ces_v1::MakeAgentServiceConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::ces_v1::AgentServiceClient(connection); + auto c2 = google::cloud::ces_v1::AgentServiceClient(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::ces_v1::AgentServiceClient( + connection, + google::cloud::Options{} + .set( + google::cloud::ces_v1::AgentServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::ces_v1::AgentServiceLimitedErrorCountRetryPolicy(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::ces_v1::AgentServiceRetryPolicyOption::Type, + google::cloud::ces_v1::AgentServiceBackoffPolicyOption::Type>( + google::cloud::ces_v1::AgentServiceLimitedTimeRetryPolicy( + /*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::ces_v1::MakeAgentServiceConnection(options); + + // c1 and c2 share the same polling policies. + auto c1 = google::cloud::ces_v1::AgentServiceClient(connection); + auto c2 = google::cloud::ces_v1::AgentServiceClient(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::ces_v1::AgentServiceClient( + google::cloud::ces_v1::MakeAgentServiceConnection(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}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/ces/v1/samples/session_client_samples.cc b/google/cloud/ces/v1/samples/session_client_samples.cc new file mode 100644 index 0000000000000..3107865f4cdd7 --- /dev/null +++ b/google/cloud/ces/v1/samples/session_client_samples.cc @@ -0,0 +1,180 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#include "google/cloud/ces/v1/session_client.h" +#include "google/cloud/ces/v1/session_connection_idempotency_policy.h" +#include "google/cloud/ces/v1/session_options.h" +#include "google/cloud/common_options.h" +#include "google/cloud/credentials.h" +#include "google/cloud/internal/getenv.h" +#include "google/cloud/testing_util/example_driver.h" +#include "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: ces_v1::SessionServiceClient +// 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::ces_v1::SessionServiceClient( + google::cloud::ces_v1::MakeSessionServiceConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::ces_v1::SessionServiceClient( + google::cloud::ces_v1::MakeSessionServiceConnection(*ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::ces_v1::SessionServiceConnectionIdempotencyPolicy { + public: + ~CustomIdempotencyPolicy() override = default; + std::unique_ptr< + google::cloud::ces_v1::SessionServiceConnectionIdempotencyPolicy> + 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::ces_v1::SessionServiceLimitedErrorCountRetryPolicy( + 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::ces_v1::MakeSessionServiceConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::ces_v1::SessionServiceClient(connection); + auto c2 = google::cloud::ces_v1::SessionServiceClient(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::ces_v1::SessionServiceClient( + connection, + google::cloud::Options{} + .set( + google::cloud::ces_v1::SessionServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::ces_v1::SessionServiceLimitedErrorCountRetryPolicy(10).clone())); + //! [set-retry-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::ces_v1::SessionServiceClient( + google::cloud::ces_v1::MakeSessionServiceConnection(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 WithServiceAccount() example" << std::endl; + WithServiceAccount({keyfile}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"with-service-account", WithServiceAccount}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/ces/v1/samples/tool_client_samples.cc b/google/cloud/ces/v1/samples/tool_client_samples.cc new file mode 100644 index 0000000000000..0b923afc4dcdd --- /dev/null +++ b/google/cloud/ces/v1/samples/tool_client_samples.cc @@ -0,0 +1,177 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#include "google/cloud/ces/v1/tool_client.h" +#include "google/cloud/ces/v1/tool_connection_idempotency_policy.h" +#include "google/cloud/ces/v1/tool_options.h" +#include "google/cloud/common_options.h" +#include "google/cloud/credentials.h" +#include "google/cloud/internal/getenv.h" +#include "google/cloud/testing_util/example_driver.h" +#include "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: ces_v1::ToolServiceClient +// 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::ces_v1::ToolServiceClient( + google::cloud::ces_v1::MakeToolServiceConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::ces_v1::ToolServiceClient( + google::cloud::ces_v1::MakeToolServiceConnection(*ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::ces_v1::ToolServiceConnectionIdempotencyPolicy { + 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::ces_v1::ToolServiceLimitedErrorCountRetryPolicy(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::ces_v1::MakeToolServiceConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::ces_v1::ToolServiceClient(connection); + auto c2 = google::cloud::ces_v1::ToolServiceClient(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::ces_v1::ToolServiceClient( + connection, + google::cloud::Options{} + .set( + google::cloud::ces_v1::ToolServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::ces_v1::ToolServiceLimitedErrorCountRetryPolicy(10).clone())); + //! [set-retry-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::ces_v1::ToolServiceClient( + google::cloud::ces_v1::MakeToolServiceConnection(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 WithServiceAccount() example" << std::endl; + WithServiceAccount({keyfile}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"with-service-account", WithServiceAccount}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/ces/v1/samples/widget_client_samples.cc b/google/cloud/ces/v1/samples/widget_client_samples.cc new file mode 100644 index 0000000000000..f48b9bf64f9ca --- /dev/null +++ b/google/cloud/ces/v1/samples/widget_client_samples.cc @@ -0,0 +1,179 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#include "google/cloud/ces/v1/widget_client.h" +#include "google/cloud/ces/v1/widget_connection_idempotency_policy.h" +#include "google/cloud/ces/v1/widget_options.h" +#include "google/cloud/common_options.h" +#include "google/cloud/credentials.h" +#include "google/cloud/internal/getenv.h" +#include "google/cloud/testing_util/example_driver.h" +#include "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: ces_v1::WidgetServiceClient +// 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::ces_v1::WidgetServiceClient( + google::cloud::ces_v1::MakeWidgetServiceConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::ces_v1::WidgetServiceClient( + google::cloud::ces_v1::MakeWidgetServiceConnection(*ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::ces_v1::WidgetServiceConnectionIdempotencyPolicy { + public: + ~CustomIdempotencyPolicy() override = default; + std::unique_ptr< + google::cloud::ces_v1::WidgetServiceConnectionIdempotencyPolicy> + 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::ces_v1::WidgetServiceLimitedErrorCountRetryPolicy( + 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::ces_v1::MakeWidgetServiceConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::ces_v1::WidgetServiceClient(connection); + auto c2 = google::cloud::ces_v1::WidgetServiceClient(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::ces_v1::WidgetServiceClient( + connection, + google::cloud::Options{} + .set( + google::cloud::ces_v1::WidgetServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::ces_v1::WidgetServiceLimitedErrorCountRetryPolicy(10).clone())); + //! [set-retry-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::ces_v1::WidgetServiceClient( + google::cloud::ces_v1::MakeWidgetServiceConnection(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 WithServiceAccount() example" << std::endl; + WithServiceAccount({keyfile}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"with-service-account", WithServiceAccount}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/ces/v1/session_client.cc b/google/cloud/ces/v1/session_client.cc new file mode 100644 index 0000000000000..35c6a65af4bce --- /dev/null +++ b/google/cloud/ces/v1/session_client.cc @@ -0,0 +1,132 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#include "google/cloud/ces/v1/session_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +SessionServiceClient::SessionServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +SessionServiceClient::~SessionServiceClient() = default; + +StatusOr +SessionServiceClient::RunSession( + google::cloud::ces::v1::RunSessionRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RunSession(request); +} + +StreamRange +SessionServiceClient::StreamRunSession( + google::cloud::ces::v1::RunSessionRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->StreamRunSession(request); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> +SessionServiceClient::AsyncBidiRunSession(Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AsyncBidiRunSession(); +} + +StreamRange +SessionServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr SessionServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange +SessionServiceClient::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 +SessionServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr SessionServiceClient::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 SessionServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status SessionServiceClient::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 SessionServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status SessionServiceClient::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 SessionServiceClient::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 ces_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/session_client.h b/google/cloud/ces/v1/session_client.h new file mode 100644 index 0000000000000..04b672f24fc84 --- /dev/null +++ b/google/cloud/ces/v1/session_client.h @@ -0,0 +1,611 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_SESSION_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_SESSION_CLIENT_H + +#include "google/cloud/ces/v1/session_connection.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/version.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// Session service provides APIs for interacting with CES agents. +/// +/// @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 SessionServiceClient { + public: + explicit SessionServiceClient( + std::shared_ptr connection, Options opts = {}); + ~SessionServiceClient(); + + ///@{ + /// @name Copy and move support + SessionServiceClient(SessionServiceClient const&) = default; + SessionServiceClient& operator=(SessionServiceClient const&) = default; + SessionServiceClient(SessionServiceClient&&) = default; + SessionServiceClient& operator=(SessionServiceClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(SessionServiceClient const& a, + SessionServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(SessionServiceClient const& a, + SessionServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Initiates a single-turn interaction with the CES agent within a session. + /// + /// @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.ces.v1.RunSessionRequest]. + /// 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.ces.v1.RunSessionResponse]) + /// 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.ces.v1.RunSessionRequest]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L433} + /// [google.cloud.ces.v1.RunSessionResponse]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L443} + /// + // clang-format on + StatusOr RunSession( + google::cloud::ces::v1::RunSessionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Initiates a single-turn interaction with the CES agent. Uses server-side + /// streaming to deliver incremental results and partial responses as they are + /// generated. + /// + /// By default, complete responses (e.g., messages from callbacks or full LLM + /// responses) are sent to the client as soon as they are available. To enable + /// streaming individual text chunks directly from the model, set + /// [enable_text_streaming][google.cloud.ces.v1.SessionConfig.enable_text_streaming] + /// to true. + /// + /// @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.ces.v1.RunSessionRequest]. + /// 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.ces.v1.RunSessionResponse]) + /// 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.ces.v1.RunSessionRequest]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L433} + /// [google.cloud.ces.v1.RunSessionResponse]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L443} + /// [google.cloud.ces.v1.SessionConfig.enable_text_streaming]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L261} + /// + // clang-format on + StreamRange StreamRunSession( + google::cloud::ces::v1::RunSessionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Establishes a bidirectional streaming connection with the CES agent. + /// The agent processes continuous multimodal inputs (e.g., text, audio) and + /// generates real-time multimodal output streams. + /// + /// - Client Request Stream - + /// The client streams requests in the following order: + /// + /// 1. Initialization: + /// The first message must contain + /// [SessionConfig][google.cloud.ces.v1.BidiSessionClientMessage.config]. + /// For audio sessions, this should also include + /// [InputAudioConfig][google.cloud.ces.v1.SessionConfig.input_audio_config] + /// and + /// [OutputAudioConfig][google.cloud.ces.v1.SessionConfig.output_audio_config] + /// to define audio processing and synthesis parameters. + /// + /// 2. Interaction: + /// Subsequent messages stream + /// [SessionInput][google.cloud.ces.v1.BidiSessionClientMessage.realtime_input] + /// containing real-time user input data. + /// + /// 3. Termination: + /// The client should half-close the stream when there is no more user + /// input. It should also half-close upon receiving + /// [EndSession][google.cloud.ces.v1.BidiSessionServerMessage.end_session] + /// or [GoAway][google.cloud.ces.v1.BidiSessionServerMessage.go_away] from + /// the agent. + /// + /// - Server Response Stream - + /// For each interaction turn, the agent streams messages in the following + /// sequence: + /// + /// 1. Speech Recognition (First N messages): + /// Contains + /// [RecognitionResult][google.cloud.ces.v1.BidiSessionServerMessage.recognition_result] + /// representing the concatenated user speech segments captured so far. + /// This is only populated for audio sessions. + /// + /// 2. Response (Next M messages): + /// Contains + /// [SessionOutput][google.cloud.ces.v1.BidiSessionServerMessage.session_output] + /// delivering the agent's response in various modalities (e.g., text, + /// audio). + /// + /// 3. Turn Completion (Final message of the turn): + /// Contains + /// [SessionOutput][google.cloud.ces.v1.BidiSessionServerMessage.session_output] + /// with [turn_completed][google.cloud.ces.v1.SessionOutput.turn_completed] + /// set to true. This signals the end of the current turn and includes + /// [DiagnosticInfo][google.cloud.ces.v1.SessionOutput.diagnostic_info] + /// with execution details. + /// + /// - Audio Best Practices - + /// 1. Streaming: + /// Stream [audio data][google.cloud.ces.v1.SessionInput.audio] + /// **CONTINUOUSLY**, even during silence. Recommended chunk size: 40-120ms + /// (balances latency vs. efficiency). + /// + /// 2. Playback & Interruption: + /// Play [audio responses][google.cloud.ces.v1.SessionOutput.audio] upon + /// receipt. Stop playback immediately if an + /// [InterruptionSignal][google.cloud.ces.v1.BidiSessionServerMessage.interruption_signal] + /// is received (e.g., user barge-in or new agent response). + /// + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return An object representing the bidirectional streaming + /// RPC. Applications can send multiple request messages and receive + /// multiple response messages through this API. Bidirectional streaming + /// RPCs can impose restrictions on the sequence of request and response + /// messages. Please consult the service documentation for details. + /// The request message type ([google.cloud.ces.v1.BidiSessionClientMessage]) and response messages + /// ([google.cloud.ces.v1.BidiSessionServerMessage]) are mapped to C++ classes 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 + /// [`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.ces.v1.BidiSessionClientMessage]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L451} + /// [google.cloud.ces.v1.BidiSessionClientMessage.config]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L455} + /// [google.cloud.ces.v1.BidiSessionClientMessage.realtime_input]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L458} + /// [google.cloud.ces.v1.BidiSessionServerMessage]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L465} + /// [google.cloud.ces.v1.BidiSessionServerMessage.end_session]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L480} + /// [google.cloud.ces.v1.BidiSessionServerMessage.go_away]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L484} + /// [google.cloud.ces.v1.BidiSessionServerMessage.interruption_signal]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L476} + /// [google.cloud.ces.v1.BidiSessionServerMessage.recognition_result]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L472} + /// [google.cloud.ces.v1.BidiSessionServerMessage.session_output]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L469} + /// [google.cloud.ces.v1.SessionConfig.input_audio_config]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L205} + /// [google.cloud.ces.v1.SessionConfig.output_audio_config]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L209} + /// [google.cloud.ces.v1.SessionInput.audio]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L313} + /// [google.cloud.ces.v1.SessionOutput.audio]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L366} + /// [google.cloud.ces.v1.SessionOutput.diagnostic_info]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L397} + /// [google.cloud.ces.v1.SessionOutput.turn_completed]: @googleapis_reference_link{google/cloud/ces/v1/session_service.proto#L392} + /// + // clang-format on + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> + AsyncBidiRunSession(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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_SESSION_CLIENT_H diff --git a/google/cloud/ces/v1/session_connection.cc b/google/cloud/ces/v1/session_connection.cc new file mode 100644 index 0000000000000..3e87c93deb296 --- /dev/null +++ b/google/cloud/ces/v1/session_connection.cc @@ -0,0 +1,125 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#include "google/cloud/ces/v1/session_connection.h" +#include "google/cloud/ces/v1/internal/session_connection_impl.h" +#include "google/cloud/ces/v1/internal/session_option_defaults.h" +#include "google/cloud/ces/v1/internal/session_stub_factory.h" +#include "google/cloud/ces/v1/internal/session_tracing_connection.h" +#include "google/cloud/ces/v1/session_options.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 ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +SessionServiceConnection::~SessionServiceConnection() = default; + +StatusOr +SessionServiceConnection::RunSession( + google::cloud::ces::v1::RunSessionRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +SessionServiceConnection::StreamRunSession( + google::cloud::ces::v1::RunSessionRequest const&) { + return google::cloud::internal::MakeStreamRange< + google::cloud::ces::v1::RunSessionResponse>( + []() + -> absl::variant { + return Status(StatusCode::kUnimplemented, "not implemented"); + }); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> +SessionServiceConnection::AsyncBidiRunSession() { + return std::make_unique< + ::google::cloud::internal::AsyncStreamingReadWriteRpcError< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +SessionServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +SessionServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +SessionServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr SessionServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status SessionServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status SessionServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeSessionServiceConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = ces_v1_internal::SessionServiceDefaultOptions(std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = ces_v1_internal::CreateDefaultSessionServiceStub(std::move(auth), + options); + return ces_v1_internal::MakeSessionServiceTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/session_connection.h b/google/cloud/ces/v1/session_connection.h new file mode 100644 index 0000000000000..3d3c64abeaa87 --- /dev/null +++ b/google/cloud/ces/v1/session_connection.h @@ -0,0 +1,245 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_SESSION_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_SESSION_CONNECTION_H + +#include "google/cloud/ces/v1/internal/session_retry_traits.h" +#include "google/cloud/ces/v1/session_connection_idempotency_policy.h" +#include "google/cloud/ces/v1/session_service.pb.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/internal/async_read_write_stream_impl.h" +#include "google/cloud/internal/retry_policy_impl.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `SessionServiceConnection`. +class SessionServiceRetryPolicy : 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 `SessionServiceConnection` 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 SessionServiceLimitedErrorCountRetryPolicy + : public SessionServiceRetryPolicy { + 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 SessionServiceLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + SessionServiceLimitedErrorCountRetryPolicy( + SessionServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : SessionServiceLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + SessionServiceLimitedErrorCountRetryPolicy( + SessionServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : SessionServiceLimitedErrorCountRetryPolicy(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 = SessionServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + ces_v1_internal::SessionServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `SessionServiceConnection` 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 SessionServiceLimitedTimeRetryPolicy : public SessionServiceRetryPolicy { + 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 SessionServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + SessionServiceLimitedTimeRetryPolicy( + SessionServiceLimitedTimeRetryPolicy&& rhs) noexcept + : SessionServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + SessionServiceLimitedTimeRetryPolicy( + SessionServiceLimitedTimeRetryPolicy const& rhs) noexcept + : SessionServiceLimitedTimeRetryPolicy(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 = SessionServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + ces_v1_internal::SessionServiceRetryTraits> + impl_; +}; + +/** + * The `SessionServiceConnection` object for `SessionServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `SessionServiceClient`. This allows users to inject custom behavior + * (e.g., with a Google Mock object) when writing tests that use objects of type + * `SessionServiceClient`. + * + * To create a concrete instance, see `MakeSessionServiceConnection()`. + * + * For mocking, see `ces_v1_mocks::MockSessionServiceConnection`. + */ +class SessionServiceConnection { + public: + virtual ~SessionServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StatusOr RunSession( + google::cloud::ces::v1::RunSessionRequest const& request); + + virtual StreamRange + StreamRunSession(google::cloud::ces::v1::RunSessionRequest const& request); + + virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::ces::v1::BidiSessionClientMessage, + google::cloud::ces::v1::BidiSessionServerMessage>> + AsyncBidiRunSession(); + + 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 `SessionServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of SessionServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `SessionServiceConnection`. Expected options are any of the types in + * the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::ces_v1::SessionServicePolicyOptionList` + * + * @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 `SessionServiceConnection` created by + * this function. + */ +std::shared_ptr MakeSessionServiceConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_SESSION_CONNECTION_H diff --git a/google/cloud/ces/v1/session_connection_idempotency_policy.cc b/google/cloud/ces/v1/session_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..4443e42587b0c --- /dev/null +++ b/google/cloud/ces/v1/session_connection_idempotency_policy.cc @@ -0,0 +1,80 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#include "google/cloud/ces/v1/session_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +SessionServiceConnectionIdempotencyPolicy:: + ~SessionServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +SessionServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency SessionServiceConnectionIdempotencyPolicy::RunSession( + google::cloud::ces::v1::RunSessionRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency SessionServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency SessionServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency SessionServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency SessionServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency SessionServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency SessionServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultSessionServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/session_connection_idempotency_policy.h b/google/cloud/ces/v1/session_connection_idempotency_policy.h new file mode 100644 index 0000000000000..0b77dfbdaa45f --- /dev/null +++ b/google/cloud/ces/v1/session_connection_idempotency_policy.h @@ -0,0 +1,72 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_SESSION_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_SESSION_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/ces/v1/session_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class SessionServiceConnectionIdempotencyPolicy { + public: + virtual ~SessionServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() + const; + + virtual google::cloud::Idempotency RunSession( + google::cloud::ces::v1::RunSessionRequest 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 +MakeDefaultSessionServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_SESSION_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/ces/v1/session_options.h b/google/cloud/ces/v1/session_options.h new file mode 100644 index 0000000000000..40f11db72571a --- /dev/null +++ b/google/cloud/ces/v1/session_options.h @@ -0,0 +1,76 @@ +// Copyright 2026 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/ces/v1/session_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_SESSION_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_SESSION_OPTIONS_H + +#include "google/cloud/ces/v1/session_connection.h" +#include "google/cloud/ces/v1/session_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 ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-ces-options + */ +struct SessionServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-ces-options + */ +struct SessionServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-ces-options + */ +struct SessionServiceConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to SessionService. + * + * @ingroup google-cloud-ces-options + */ +using SessionServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_SESSION_OPTIONS_H diff --git a/google/cloud/ces/v1/tool_client.cc b/google/cloud/ces/v1/tool_client.cc new file mode 100644 index 0000000000000..c59f9255bdfdb --- /dev/null +++ b/google/cloud/ces/v1/tool_client.cc @@ -0,0 +1,129 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#include "google/cloud/ces/v1/tool_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ToolServiceClient::ToolServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +ToolServiceClient::~ToolServiceClient() = default; + +StatusOr +ToolServiceClient::ExecuteTool( + google::cloud::ces::v1::ExecuteToolRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExecuteTool(request); +} + +StatusOr +ToolServiceClient::RetrieveToolSchema( + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RetrieveToolSchema(request); +} + +StatusOr +ToolServiceClient::RetrieveTools( + google::cloud::ces::v1::RetrieveToolsRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RetrieveTools(request); +} + +StreamRange ToolServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr ToolServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange ToolServiceClient::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 ToolServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr ToolServiceClient::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 ToolServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status ToolServiceClient::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 ToolServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status ToolServiceClient::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 ToolServiceClient::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 ces_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/tool_client.h b/google/cloud/ces/v1/tool_client.h new file mode 100644 index 0000000000000..3c8a0faa1ab56 --- /dev/null +++ b/google/cloud/ces/v1/tool_client.h @@ -0,0 +1,530 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_TOOL_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_TOOL_CLIENT_H + +#include "google/cloud/ces/v1/tool_connection.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/version.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// Tool service provides APIs for interacting with CES tools. +/// +/// @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 ToolServiceClient { + public: + explicit ToolServiceClient(std::shared_ptr connection, + Options opts = {}); + ~ToolServiceClient(); + + ///@{ + /// @name Copy and move support + ToolServiceClient(ToolServiceClient const&) = default; + ToolServiceClient& operator=(ToolServiceClient const&) = default; + ToolServiceClient(ToolServiceClient&&) = default; + ToolServiceClient& operator=(ToolServiceClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(ToolServiceClient const& a, + ToolServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(ToolServiceClient const& a, + ToolServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Executes the given tool with the given arguments. + /// + /// @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.ces.v1.ExecuteToolRequest]. + /// 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.ces.v1.ExecuteToolResponse]) + /// 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.ces.v1.ExecuteToolRequest]: @googleapis_reference_link{google/cloud/ces/v1/tool_service.proto#L69} + /// [google.cloud.ces.v1.ExecuteToolResponse]: @googleapis_reference_link{google/cloud/ces/v1/tool_service.proto#L112} + /// + // clang-format on + StatusOr ExecuteTool( + google::cloud::ces::v1::ExecuteToolRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Retrieve the schema of the given tool. The schema is computed on the fly + /// for the given instance of the tool. + /// + /// @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.ces.v1.RetrieveToolSchemaRequest]. + /// 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.ces.v1.RetrieveToolSchemaResponse]) + /// 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.ces.v1.RetrieveToolSchemaRequest]: @googleapis_reference_link{google/cloud/ces/v1/tool_service.proto#L136} + /// [google.cloud.ces.v1.RetrieveToolSchemaResponse]: @googleapis_reference_link{google/cloud/ces/v1/tool_service.proto#L164} + /// + // clang-format on + StatusOr + RetrieveToolSchema( + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Retrieve the list of tools included in the specified toolset. + /// + /// @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.ces.v1.RetrieveToolsRequest]. + /// 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.ces.v1.RetrieveToolsResponse]) + /// 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.ces.v1.RetrieveToolsRequest]: @googleapis_reference_link{google/cloud/ces/v1/tool_service.proto#L185} + /// [google.cloud.ces.v1.RetrieveToolsResponse]: @googleapis_reference_link{google/cloud/ces/v1/tool_service.proto#L201} + /// + // clang-format on + StatusOr RetrieveTools( + google::cloud::ces::v1::RetrieveToolsRequest const& request, + 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_TOOL_CLIENT_H diff --git a/google/cloud/ces/v1/tool_connection.cc b/google/cloud/ces/v1/tool_connection.cc new file mode 100644 index 0000000000000..abbb839aaca3b --- /dev/null +++ b/google/cloud/ces/v1/tool_connection.cc @@ -0,0 +1,114 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#include "google/cloud/ces/v1/tool_connection.h" +#include "google/cloud/ces/v1/internal/tool_connection_impl.h" +#include "google/cloud/ces/v1/internal/tool_option_defaults.h" +#include "google/cloud/ces/v1/internal/tool_stub_factory.h" +#include "google/cloud/ces/v1/internal/tool_tracing_connection.h" +#include "google/cloud/ces/v1/tool_options.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 ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ToolServiceConnection::~ToolServiceConnection() = default; + +StatusOr +ToolServiceConnection::ExecuteTool( + google::cloud::ces::v1::ExecuteToolRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +ToolServiceConnection::RetrieveToolSchema( + google::cloud::ces::v1::RetrieveToolSchemaRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +ToolServiceConnection::RetrieveTools( + google::cloud::ces::v1::RetrieveToolsRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +ToolServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr ToolServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +ToolServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr ToolServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status ToolServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status ToolServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeToolServiceConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = ces_v1_internal::ToolServiceDefaultOptions(std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = + ces_v1_internal::CreateDefaultToolServiceStub(std::move(auth), options); + return ces_v1_internal::MakeToolServiceTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/tool_connection.h b/google/cloud/ces/v1/tool_connection.h new file mode 100644 index 0000000000000..2a05b36103273 --- /dev/null +++ b/google/cloud/ces/v1/tool_connection.h @@ -0,0 +1,242 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_TOOL_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_TOOL_CONNECTION_H + +#include "google/cloud/ces/v1/internal/tool_retry_traits.h" +#include "google/cloud/ces/v1/tool_connection_idempotency_policy.h" +#include "google/cloud/ces/v1/tool_service.pb.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/internal/retry_policy_impl.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `ToolServiceConnection`. +class ToolServiceRetryPolicy : 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 `ToolServiceConnection` 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 ToolServiceLimitedErrorCountRetryPolicy : public ToolServiceRetryPolicy { + 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 ToolServiceLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + ToolServiceLimitedErrorCountRetryPolicy( + ToolServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : ToolServiceLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + ToolServiceLimitedErrorCountRetryPolicy( + ToolServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : ToolServiceLimitedErrorCountRetryPolicy(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 = ToolServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + ces_v1_internal::ToolServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `ToolServiceConnection` 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 ToolServiceLimitedTimeRetryPolicy : public ToolServiceRetryPolicy { + 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 ToolServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + ToolServiceLimitedTimeRetryPolicy( + ToolServiceLimitedTimeRetryPolicy&& rhs) noexcept + : ToolServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + ToolServiceLimitedTimeRetryPolicy( + ToolServiceLimitedTimeRetryPolicy const& rhs) noexcept + : ToolServiceLimitedTimeRetryPolicy(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 = ToolServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + ces_v1_internal::ToolServiceRetryTraits> + impl_; +}; + +/** + * The `ToolServiceConnection` object for `ToolServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `ToolServiceClient`. This allows users to inject custom behavior + * (e.g., with a Google Mock object) when writing tests that use objects of type + * `ToolServiceClient`. + * + * To create a concrete instance, see `MakeToolServiceConnection()`. + * + * For mocking, see `ces_v1_mocks::MockToolServiceConnection`. + */ +class ToolServiceConnection { + public: + virtual ~ToolServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StatusOr ExecuteTool( + google::cloud::ces::v1::ExecuteToolRequest const& request); + + virtual StatusOr + RetrieveToolSchema( + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request); + + virtual StatusOr RetrieveTools( + google::cloud::ces::v1::RetrieveToolsRequest const& request); + + 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 `ToolServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of ToolServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `ToolServiceConnection`. Expected options are any of the types in + * the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::ces_v1::ToolServicePolicyOptionList` + * + * @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 `ToolServiceConnection` created by + * this function. + */ +std::shared_ptr MakeToolServiceConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_TOOL_CONNECTION_H diff --git a/google/cloud/ces/v1/tool_connection_idempotency_policy.cc b/google/cloud/ces/v1/tool_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..f2ca90c41835c --- /dev/null +++ b/google/cloud/ces/v1/tool_connection_idempotency_policy.cc @@ -0,0 +1,90 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#include "google/cloud/ces/v1/tool_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +ToolServiceConnectionIdempotencyPolicy:: + ~ToolServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +ToolServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency ToolServiceConnectionIdempotencyPolicy::ExecuteTool( + google::cloud::ces::v1::ExecuteToolRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ToolServiceConnectionIdempotencyPolicy::RetrieveToolSchema( + google::cloud::ces::v1::RetrieveToolSchemaRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ToolServiceConnectionIdempotencyPolicy::RetrieveTools( + google::cloud::ces::v1::RetrieveToolsRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ToolServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency ToolServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency ToolServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency ToolServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency ToolServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ToolServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultToolServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/tool_connection_idempotency_policy.h b/google/cloud/ces/v1/tool_connection_idempotency_policy.h new file mode 100644 index 0000000000000..a5fbdfced6f9b --- /dev/null +++ b/google/cloud/ces/v1/tool_connection_idempotency_policy.h @@ -0,0 +1,77 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_TOOL_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_TOOL_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/ces/v1/tool_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ToolServiceConnectionIdempotencyPolicy { + public: + virtual ~ToolServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() const; + + virtual google::cloud::Idempotency ExecuteTool( + google::cloud::ces::v1::ExecuteToolRequest const& request); + + virtual google::cloud::Idempotency RetrieveToolSchema( + google::cloud::ces::v1::RetrieveToolSchemaRequest const& request); + + virtual google::cloud::Idempotency RetrieveTools( + google::cloud::ces::v1::RetrieveToolsRequest 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 +MakeDefaultToolServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_TOOL_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/ces/v1/tool_options.h b/google/cloud/ces/v1/tool_options.h new file mode 100644 index 0000000000000..8b7868f1650e4 --- /dev/null +++ b/google/cloud/ces/v1/tool_options.h @@ -0,0 +1,75 @@ +// Copyright 2026 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/ces/v1/tool_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_TOOL_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_TOOL_OPTIONS_H + +#include "google/cloud/ces/v1/tool_connection.h" +#include "google/cloud/ces/v1/tool_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 ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-ces-options + */ +struct ToolServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-ces-options + */ +struct ToolServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-ces-options + */ +struct ToolServiceConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to ToolService. + * + * @ingroup google-cloud-ces-options + */ +using ToolServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_TOOL_OPTIONS_H diff --git a/google/cloud/ces/v1/widget_client.cc b/google/cloud/ces/v1/widget_client.cc new file mode 100644 index 0000000000000..e3fed48a9956e --- /dev/null +++ b/google/cloud/ces/v1/widget_client.cc @@ -0,0 +1,116 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#include "google/cloud/ces/v1/widget_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WidgetServiceClient::WidgetServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +WidgetServiceClient::~WidgetServiceClient() = default; + +StatusOr +WidgetServiceClient::GenerateChatToken( + google::cloud::ces::v1::GenerateChatTokenRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GenerateChatToken(request); +} + +StreamRange +WidgetServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr WidgetServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange WidgetServiceClient::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 WidgetServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr WidgetServiceClient::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 WidgetServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status WidgetServiceClient::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 WidgetServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status WidgetServiceClient::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 WidgetServiceClient::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 ces_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/widget_client.h b/google/cloud/ces/v1/widget_client.h new file mode 100644 index 0000000000000..32ab2e9ff22a1 --- /dev/null +++ b/google/cloud/ces/v1/widget_client.h @@ -0,0 +1,467 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_WIDGET_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_WIDGET_CLIENT_H + +#include "google/cloud/ces/v1/widget_connection.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/version.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// Provides APIs for widgets to interact with CES APIs. +/// +/// @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 WidgetServiceClient { + public: + explicit WidgetServiceClient( + std::shared_ptr connection, Options opts = {}); + ~WidgetServiceClient(); + + ///@{ + /// @name Copy and move support + WidgetServiceClient(WidgetServiceClient const&) = default; + WidgetServiceClient& operator=(WidgetServiceClient const&) = default; + WidgetServiceClient(WidgetServiceClient&&) = default; + WidgetServiceClient& operator=(WidgetServiceClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(WidgetServiceClient const& a, + WidgetServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(WidgetServiceClient const& a, + WidgetServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Generates a session scoped token for chat widget to authenticate with + /// Session APIs. + /// + /// @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.ces.v1.GenerateChatTokenRequest]. + /// 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.ces.v1.GenerateChatTokenResponse]) + /// 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.ces.v1.GenerateChatTokenRequest]: @googleapis_reference_link{google/cloud/ces/v1/widget_service.proto#L50} + /// [google.cloud.ces.v1.GenerateChatTokenResponse]: @googleapis_reference_link{google/cloud/ces/v1/widget_service.proto#L76} + /// + // clang-format on + StatusOr GenerateChatToken( + google::cloud::ces::v1::GenerateChatTokenRequest const& request, + 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_WIDGET_CLIENT_H diff --git a/google/cloud/ces/v1/widget_connection.cc b/google/cloud/ces/v1/widget_connection.cc new file mode 100644 index 0000000000000..6494a44498973 --- /dev/null +++ b/google/cloud/ces/v1/widget_connection.cc @@ -0,0 +1,103 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#include "google/cloud/ces/v1/widget_connection.h" +#include "google/cloud/ces/v1/internal/widget_connection_impl.h" +#include "google/cloud/ces/v1/internal/widget_option_defaults.h" +#include "google/cloud/ces/v1/internal/widget_stub_factory.h" +#include "google/cloud/ces/v1/internal/widget_tracing_connection.h" +#include "google/cloud/ces/v1/widget_options.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 ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WidgetServiceConnection::~WidgetServiceConnection() = default; + +StatusOr +WidgetServiceConnection::GenerateChatToken( + google::cloud::ces::v1::GenerateChatTokenRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +WidgetServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +WidgetServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +WidgetServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr WidgetServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status WidgetServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status WidgetServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeWidgetServiceConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = ces_v1_internal::WidgetServiceDefaultOptions(std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = + ces_v1_internal::CreateDefaultWidgetServiceStub(std::move(auth), options); + return ces_v1_internal::MakeWidgetServiceTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/widget_connection.h b/google/cloud/ces/v1/widget_connection.h new file mode 100644 index 0000000000000..c5ea0446d1f6a --- /dev/null +++ b/google/cloud/ces/v1/widget_connection.h @@ -0,0 +1,237 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_WIDGET_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_WIDGET_CONNECTION_H + +#include "google/cloud/ces/v1/internal/widget_retry_traits.h" +#include "google/cloud/ces/v1/widget_connection_idempotency_policy.h" +#include "google/cloud/ces/v1/widget_service.pb.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/internal/retry_policy_impl.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `WidgetServiceConnection`. +class WidgetServiceRetryPolicy : 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 `WidgetServiceConnection` 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 WidgetServiceLimitedErrorCountRetryPolicy + : public WidgetServiceRetryPolicy { + 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 WidgetServiceLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + WidgetServiceLimitedErrorCountRetryPolicy( + WidgetServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : WidgetServiceLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + WidgetServiceLimitedErrorCountRetryPolicy( + WidgetServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : WidgetServiceLimitedErrorCountRetryPolicy(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 = WidgetServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + ces_v1_internal::WidgetServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `WidgetServiceConnection` 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 WidgetServiceLimitedTimeRetryPolicy : public WidgetServiceRetryPolicy { + 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 WidgetServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + WidgetServiceLimitedTimeRetryPolicy( + WidgetServiceLimitedTimeRetryPolicy&& rhs) noexcept + : WidgetServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + WidgetServiceLimitedTimeRetryPolicy( + WidgetServiceLimitedTimeRetryPolicy const& rhs) noexcept + : WidgetServiceLimitedTimeRetryPolicy(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 = WidgetServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + ces_v1_internal::WidgetServiceRetryTraits> + impl_; +}; + +/** + * The `WidgetServiceConnection` object for `WidgetServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `WidgetServiceClient`. This allows users to inject custom behavior + * (e.g., with a Google Mock object) when writing tests that use objects of type + * `WidgetServiceClient`. + * + * To create a concrete instance, see `MakeWidgetServiceConnection()`. + * + * For mocking, see `ces_v1_mocks::MockWidgetServiceConnection`. + */ +class WidgetServiceConnection { + public: + virtual ~WidgetServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StatusOr + GenerateChatToken( + google::cloud::ces::v1::GenerateChatTokenRequest const& request); + + 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 `WidgetServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of WidgetServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `WidgetServiceConnection`. Expected options are any of the types in + * the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::ces_v1::WidgetServicePolicyOptionList` + * + * @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 `WidgetServiceConnection` created by + * this function. + */ +std::shared_ptr MakeWidgetServiceConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_WIDGET_CONNECTION_H diff --git a/google/cloud/ces/v1/widget_connection_idempotency_policy.cc b/google/cloud/ces/v1/widget_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..834cdab91212a --- /dev/null +++ b/google/cloud/ces/v1/widget_connection_idempotency_policy.cc @@ -0,0 +1,80 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#include "google/cloud/ces/v1/widget_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +WidgetServiceConnectionIdempotencyPolicy:: + ~WidgetServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +WidgetServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency WidgetServiceConnectionIdempotencyPolicy::GenerateChatToken( + google::cloud::ces::v1::GenerateChatTokenRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WidgetServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WidgetServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WidgetServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WidgetServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WidgetServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WidgetServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultWidgetServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/ces/v1/widget_connection_idempotency_policy.h b/google/cloud/ces/v1/widget_connection_idempotency_policy.h new file mode 100644 index 0000000000000..1ea699776382e --- /dev/null +++ b/google/cloud/ces/v1/widget_connection_idempotency_policy.h @@ -0,0 +1,72 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_WIDGET_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_WIDGET_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/ces/v1/widget_service.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WidgetServiceConnectionIdempotencyPolicy { + public: + virtual ~WidgetServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() + const; + + virtual google::cloud::Idempotency GenerateChatToken( + google::cloud::ces::v1::GenerateChatTokenRequest 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 +MakeDefaultWidgetServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_WIDGET_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/ces/v1/widget_options.h b/google/cloud/ces/v1/widget_options.h new file mode 100644 index 0000000000000..9c329d70250fa --- /dev/null +++ b/google/cloud/ces/v1/widget_options.h @@ -0,0 +1,75 @@ +// Copyright 2026 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/ces/v1/widget_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_WIDGET_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_WIDGET_OPTIONS_H + +#include "google/cloud/ces/v1/widget_connection.h" +#include "google/cloud/ces/v1/widget_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 ces_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-ces-options + */ +struct WidgetServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-ces-options + */ +struct WidgetServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-ces-options + */ +struct WidgetServiceConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to WidgetService. + * + * @ingroup google-cloud-ces-options + */ +using WidgetServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace ces_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CES_V1_WIDGET_OPTIONS_H diff --git a/google/cloud/channel/quickstart/.bazelversion b/google/cloud/channel/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/channel/quickstart/.bazelversion +++ b/google/cloud/channel/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/channel/quickstart/WORKSPACE.bazel b/google/cloud/channel/quickstart/WORKSPACE.bazel index 22e4a1d218e8e..3018b4eaf6736 100644 --- a/google/cloud/channel/quickstart/WORKSPACE.bazel +++ b/google/cloud/channel/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/channel/v1/cloud_channel_client.h b/google/cloud/channel/v1/cloud_channel_client.h index b02a5bd304bbc..4c47a2118b348 100644 --- a/google/cloud/channel/v1/cloud_channel_client.h +++ b/google/cloud/channel/v1/cloud_channel_client.h @@ -4160,7 +4160,7 @@ class CloudChannelServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -4199,7 +4199,7 @@ class CloudChannelServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/chronicle/quickstart/WORKSPACE.bazel b/google/cloud/chronicle/quickstart/WORKSPACE.bazel index a21b97087f888..c51763abe3d1a 100644 --- a/google/cloud/chronicle/quickstart/WORKSPACE.bazel +++ b/google/cloud/chronicle/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/chronicle/v1/data_access_control_client.h b/google/cloud/chronicle/v1/data_access_control_client.h index 04e44b47a5f06..bcdf251ea2326 100644 --- a/google/cloud/chronicle/v1/data_access_control_client.h +++ b/google/cloud/chronicle/v1/data_access_control_client.h @@ -962,7 +962,7 @@ class DataAccessControlServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1001,7 +1001,7 @@ class DataAccessControlServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/chronicle/v1/entity_client.h b/google/cloud/chronicle/v1/entity_client.h index 7af51c38ee676..97531ecfb0f68 100644 --- a/google/cloud/chronicle/v1/entity_client.h +++ b/google/cloud/chronicle/v1/entity_client.h @@ -623,7 +623,7 @@ class EntityServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -662,7 +662,7 @@ class EntityServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/chronicle/v1/instance_client.h b/google/cloud/chronicle/v1/instance_client.h index 67848d1c8ba88..db36726938d93 100644 --- a/google/cloud/chronicle/v1/instance_client.h +++ b/google/cloud/chronicle/v1/instance_client.h @@ -363,7 +363,7 @@ class InstanceServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -402,7 +402,7 @@ class InstanceServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/chronicle/v1/reference_list_client.h b/google/cloud/chronicle/v1/reference_list_client.h index 13c2ab8301a86..77201632c4faa 100644 --- a/google/cloud/chronicle/v1/reference_list_client.h +++ b/google/cloud/chronicle/v1/reference_list_client.h @@ -572,7 +572,7 @@ class ReferenceListServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -611,7 +611,7 @@ class ReferenceListServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/chronicle/v1/rule_client.h b/google/cloud/chronicle/v1/rule_client.h index bad9d11c0307d..d48f810aeb083 100644 --- a/google/cloud/chronicle/v1/rule_client.h +++ b/google/cloud/chronicle/v1/rule_client.h @@ -1149,7 +1149,7 @@ class RuleServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1188,7 +1188,7 @@ class RuleServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/cloudbuild/quickstart/.bazelversion b/google/cloud/cloudbuild/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/cloudbuild/quickstart/.bazelversion +++ b/google/cloud/cloudbuild/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/cloudbuild/quickstart/WORKSPACE.bazel b/google/cloud/cloudbuild/quickstart/WORKSPACE.bazel index d5b4d964e48cf..445a7335fed79 100644 --- a/google/cloud/cloudbuild/quickstart/WORKSPACE.bazel +++ b/google/cloud/cloudbuild/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/cloudbuild/v2/repository_manager_client.h b/google/cloud/cloudbuild/v2/repository_manager_client.h index cc4d523806d0b..2b1436fc0735e 100644 --- a/google/cloud/cloudbuild/v2/repository_manager_client.h +++ b/google/cloud/cloudbuild/v2/repository_manager_client.h @@ -1493,7 +1493,7 @@ class RepositoryManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1532,7 +1532,7 @@ class RepositoryManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/cloudcontrolspartner/quickstart/.bazelversion b/google/cloud/cloudcontrolspartner/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/cloudcontrolspartner/quickstart/.bazelversion +++ b/google/cloud/cloudcontrolspartner/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/cloudcontrolspartner/quickstart/WORKSPACE.bazel b/google/cloud/cloudcontrolspartner/quickstart/WORKSPACE.bazel index 5ca314e6ddc9b..b49c94e4a4daf 100644 --- a/google/cloud/cloudcontrolspartner/quickstart/WORKSPACE.bazel +++ b/google/cloud/cloudcontrolspartner/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/cloudquotas/quickstart/.bazelversion b/google/cloud/cloudquotas/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/cloudquotas/quickstart/.bazelversion +++ b/google/cloud/cloudquotas/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/cloudquotas/quickstart/WORKSPACE.bazel b/google/cloud/cloudquotas/quickstart/WORKSPACE.bazel index 2497e53fcf906..4b0968e5bbaf6 100644 --- a/google/cloud/cloudquotas/quickstart/WORKSPACE.bazel +++ b/google/cloud/cloudquotas/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/cloudsecuritycompliance/quickstart/WORKSPACE.bazel b/google/cloud/cloudsecuritycompliance/quickstart/WORKSPACE.bazel index a96ed706b5b32..50909d82b5700 100644 --- a/google/cloud/cloudsecuritycompliance/quickstart/WORKSPACE.bazel +++ b/google/cloud/cloudsecuritycompliance/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/cloudsecuritycompliance/v1/config_client.h b/google/cloud/cloudsecuritycompliance/v1/config_client.h index 846d0c3ab6eab..6c51935fba7da 100644 --- a/google/cloud/cloudsecuritycompliance/v1/config_client.h +++ b/google/cloud/cloudsecuritycompliance/v1/config_client.h @@ -1136,7 +1136,7 @@ class ConfigClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1175,7 +1175,7 @@ class ConfigClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/cloudsecuritycompliance/v1/deployment_client.h b/google/cloud/cloudsecuritycompliance/v1/deployment_client.h index 7c3c2ca173650..68c32c938d0dc 100644 --- a/google/cloud/cloudsecuritycompliance/v1/deployment_client.h +++ b/google/cloud/cloudsecuritycompliance/v1/deployment_client.h @@ -909,7 +909,7 @@ class DeploymentClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -948,7 +948,7 @@ class DeploymentClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/commerce/quickstart/.bazelversion b/google/cloud/commerce/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/commerce/quickstart/.bazelversion +++ b/google/cloud/commerce/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/commerce/quickstart/WORKSPACE.bazel b/google/cloud/commerce/quickstart/WORKSPACE.bazel index 8ad6dee2f1c4b..9de68c1e8e6d7 100644 --- a/google/cloud/commerce/quickstart/WORKSPACE.bazel +++ b/google/cloud/commerce/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/composer/quickstart/.bazelversion b/google/cloud/composer/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/composer/quickstart/.bazelversion +++ b/google/cloud/composer/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/composer/quickstart/WORKSPACE.bazel b/google/cloud/composer/quickstart/WORKSPACE.bazel index 7e99d1817881c..8cd21ecaae893 100644 --- a/google/cloud/composer/quickstart/WORKSPACE.bazel +++ b/google/cloud/composer/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/compute/quickstart/.bazelversion b/google/cloud/compute/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/compute/quickstart/.bazelversion +++ b/google/cloud/compute/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/compute/quickstart/WORKSPACE.bazel b/google/cloud/compute/quickstart/WORKSPACE.bazel index 7bf60f65d2761..b3361a1a98f91 100644 --- a/google/cloud/compute/quickstart/WORKSPACE.bazel +++ b/google/cloud/compute/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/confidentialcomputing/quickstart/.bazelversion b/google/cloud/confidentialcomputing/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/confidentialcomputing/quickstart/.bazelversion +++ b/google/cloud/confidentialcomputing/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/confidentialcomputing/quickstart/WORKSPACE.bazel b/google/cloud/confidentialcomputing/quickstart/WORKSPACE.bazel index fa783548f2736..7bddfd7d4304a 100644 --- a/google/cloud/confidentialcomputing/quickstart/WORKSPACE.bazel +++ b/google/cloud/confidentialcomputing/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/config/quickstart/.bazelversion b/google/cloud/config/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/config/quickstart/.bazelversion +++ b/google/cloud/config/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/config/quickstart/WORKSPACE.bazel b/google/cloud/config/quickstart/WORKSPACE.bazel index 660bc0c1cb59a..8083ef04ddc25 100644 --- a/google/cloud/config/quickstart/WORKSPACE.bazel +++ b/google/cloud/config/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/config/v1/config_client.h b/google/cloud/config/v1/config_client.h index 251471c9d923e..6d6e75e02d945 100644 --- a/google/cloud/config/v1/config_client.h +++ b/google/cloud/config/v1/config_client.h @@ -2685,7 +2685,7 @@ class ConfigClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2724,7 +2724,7 @@ class ConfigClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/configdelivery/quickstart/WORKSPACE.bazel b/google/cloud/configdelivery/quickstart/WORKSPACE.bazel index 826d8433ef73a..b31822d1c2f63 100644 --- a/google/cloud/configdelivery/quickstart/WORKSPACE.bazel +++ b/google/cloud/configdelivery/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/configdelivery/v1/config_delivery_client.h b/google/cloud/configdelivery/v1/config_delivery_client.h index c1d232b434266..ad4870718ef56 100644 --- a/google/cloud/configdelivery/v1/config_delivery_client.h +++ b/google/cloud/configdelivery/v1/config_delivery_client.h @@ -2807,7 +2807,7 @@ class ConfigDeliveryClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2846,7 +2846,7 @@ class ConfigDeliveryClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/connectors/quickstart/.bazelversion b/google/cloud/connectors/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/connectors/quickstart/.bazelversion +++ b/google/cloud/connectors/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/connectors/quickstart/WORKSPACE.bazel b/google/cloud/connectors/quickstart/WORKSPACE.bazel index fe2eab1bc69d6..fd1898f9f68d9 100644 --- a/google/cloud/connectors/quickstart/WORKSPACE.bazel +++ b/google/cloud/connectors/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/connectors/v1/connectors_client.h b/google/cloud/connectors/v1/connectors_client.h index 0c7af10338d37..e307a3dcecaa4 100644 --- a/google/cloud/connectors/v1/connectors_client.h +++ b/google/cloud/connectors/v1/connectors_client.h @@ -1829,7 +1829,7 @@ class ConnectorsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1868,7 +1868,7 @@ class ConnectorsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/contactcenterinsights/quickstart/.bazelversion b/google/cloud/contactcenterinsights/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/contactcenterinsights/quickstart/.bazelversion +++ b/google/cloud/contactcenterinsights/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/contactcenterinsights/quickstart/WORKSPACE.bazel b/google/cloud/contactcenterinsights/quickstart/WORKSPACE.bazel index 7428d282b7a83..665feb98f7ff8 100644 --- a/google/cloud/contactcenterinsights/quickstart/WORKSPACE.bazel +++ b/google/cloud/contactcenterinsights/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/contactcenterinsights/v1/contact_center_insights_client.h b/google/cloud/contactcenterinsights/v1/contact_center_insights_client.h index bd3ad11ea277e..ce4ea973251a8 100644 --- a/google/cloud/contactcenterinsights/v1/contact_center_insights_client.h +++ b/google/cloud/contactcenterinsights/v1/contact_center_insights_client.h @@ -5693,7 +5693,7 @@ class ContactCenterInsightsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -5732,7 +5732,7 @@ class ContactCenterInsightsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/container/quickstart/.bazelversion b/google/cloud/container/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/container/quickstart/.bazelversion +++ b/google/cloud/container/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/container/quickstart/WORKSPACE.bazel b/google/cloud/container/quickstart/WORKSPACE.bazel index 4cb2b405e2fc1..85147c14f4d85 100644 --- a/google/cloud/container/quickstart/WORKSPACE.bazel +++ b/google/cloud/container/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/containeranalysis/quickstart/.bazelversion b/google/cloud/containeranalysis/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/containeranalysis/quickstart/.bazelversion +++ b/google/cloud/containeranalysis/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/containeranalysis/quickstart/WORKSPACE.bazel b/google/cloud/containeranalysis/quickstart/WORKSPACE.bazel index 99b845f09b1ac..026fb08751f2f 100644 --- a/google/cloud/containeranalysis/quickstart/WORKSPACE.bazel +++ b/google/cloud/containeranalysis/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/contentwarehouse/quickstart/.bazelversion b/google/cloud/contentwarehouse/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/contentwarehouse/quickstart/.bazelversion +++ b/google/cloud/contentwarehouse/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/contentwarehouse/quickstart/WORKSPACE.bazel b/google/cloud/contentwarehouse/quickstart/WORKSPACE.bazel index 2f1afdffe12a4..d543ffc215aa1 100644 --- a/google/cloud/contentwarehouse/quickstart/WORKSPACE.bazel +++ b/google/cloud/contentwarehouse/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/datacatalog/BUILD.bazel b/google/cloud/datacatalog/BUILD.bazel index 33b9439cb6b3d..10cd1d1e5138b 100644 --- a/google/cloud/datacatalog/BUILD.bazel +++ b/google/cloud/datacatalog/BUILD.bazel @@ -19,11 +19,13 @@ package(default_visibility = ["//visibility:private"]) licenses(["notice"]) # Apache 2.0 service_dirs = [ + "lineage/configmanagement/v1/", "lineage/v1/", "v1/", ] googleapis_deps = [ + "@googleapis//google/cloud/datacatalog/lineage/configmanagement/v1:configmanagement_cc_grpc", "@googleapis//google/cloud/datacatalog/lineage/v1:lineage_cc_grpc", "@googleapis//google/cloud/datacatalog/v1:datacatalog_cc_grpc", ] diff --git a/google/cloud/datacatalog/CMakeLists.txt b/google/cloud/datacatalog/CMakeLists.txt index bb913f2394157..324697bd195c9 100644 --- a/google/cloud/datacatalog/CMakeLists.txt +++ b/google/cloud/datacatalog/CMakeLists.txt @@ -16,8 +16,9 @@ include(GoogleCloudCppLibrary) -google_cloud_cpp_add_gapic_library(datacatalog "Google Cloud Data Catalog API" - SERVICE_DIRS "lineage/v1/" "v1/") +google_cloud_cpp_add_gapic_library( + datacatalog "Google Cloud Data Catalog API" + SERVICE_DIRS "lineage/configmanagement/v1/" "lineage/v1/" "v1/") if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(datacatalog_quickstart "quickstart/quickstart.cc") diff --git a/google/cloud/datacatalog/doc/environment-variables.dox b/google/cloud/datacatalog/doc/environment-variables.dox index 983ee273118d0..f3a8039ec5e69 100644 --- a/google/cloud/datacatalog/doc/environment-variables.dox +++ b/google/cloud/datacatalog/doc/environment-variables.dox @@ -9,6 +9,10 @@ environment variables are convenient when troubleshooting problems. +- `GOOGLE_CLOUD_CPP_CONFIG_MANAGEMENT_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "datalineage.googleapis.com") + used by `MakeConfigManagementServiceConnection()`. + - `GOOGLE_CLOUD_CPP_DATA_CATALOG_ENDPOINT=...` overrides the `EndpointOption` (which defaults to "datacatalog.googleapis.com") used by `MakeDataCatalogConnection()`. diff --git a/google/cloud/datacatalog/doc/main.dox b/google/cloud/datacatalog/doc/main.dox index 5967e5f99c355..2846331da10ee 100644 --- a/google/cloud/datacatalog/doc/main.dox +++ b/google/cloud/datacatalog/doc/main.dox @@ -30,6 +30,7 @@ The library also has other classes that provide helpers, configuration parameters, and infrastructure to mock the `*Client` classes when testing your application. +- [\c datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient](@ref google::cloud::datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient) - [\c datacatalog_lineage_v1::LineageClient](@ref google::cloud::datacatalog_lineage_v1::LineageClient) - [\c datacatalog_v1::DataCatalogClient](@ref google::cloud::datacatalog_v1::DataCatalogClient) - [\c datacatalog_v1::PolicyTagManagerClient](@ref google::cloud::datacatalog_v1::PolicyTagManagerClient) diff --git a/google/cloud/datacatalog/doc/override-authentication.dox b/google/cloud/datacatalog/doc/override-authentication.dox index d12cc31e5c5ea..a72b45e109551 100644 --- a/google/cloud/datacatalog/doc/override-authentication.dox +++ b/google/cloud/datacatalog/doc/override-authentication.dox @@ -9,10 +9,11 @@ this default. You can do so by providing the The following example shows how to explicitly load a service account key file: -@snippet lineage_client_samples.cc with-service-account +@snippet config_management_client_samples.cc with-service-account Follow these links to find examples for other \c *Client classes: +- [\c datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient](@ref datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient-service-account-snippet) - [\c datacatalog_lineage_v1::LineageClient](@ref datacatalog_lineage_v1::LineageClient-service-account-snippet) - [\c datacatalog_v1::DataCatalogClient](@ref datacatalog_v1::DataCatalogClient-service-account-snippet) - [\c datacatalog_v1::PolicyTagManagerClient](@ref datacatalog_v1::PolicyTagManagerClient-service-account-snippet) @@ -34,6 +35,12 @@ guide for more details. // +/*! @page datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient-service-account-snippet Override datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient Authentication Defaults + +@snippet google/cloud/datacatalog/lineage/configmanagement/v1/samples/config_management_client_samples.cc with-service-account + +*/ + /*! @page datacatalog_lineage_v1::LineageClient-service-account-snippet Override datacatalog_lineage_v1::LineageClient Authentication Defaults @snippet google/cloud/datacatalog/lineage/v1/samples/lineage_client_samples.cc with-service-account diff --git a/google/cloud/datacatalog/doc/override-endpoint.dox b/google/cloud/datacatalog/doc/override-endpoint.dox index a525548e6f516..6545fc0e7c27f 100644 --- a/google/cloud/datacatalog/doc/override-endpoint.dox +++ b/google/cloud/datacatalog/doc/override-endpoint.dox @@ -7,12 +7,13 @@ library. Use the client library to change this default. -For example, this will override the default endpoint for `datacatalog_lineage_v1::LineageClient`: +For example, this will override the default endpoint for `datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient`: -@snippet lineage_client_samples.cc set-client-endpoint +@snippet config_management_client_samples.cc set-client-endpoint Follow these links to find examples for other \c *Client classes: +- [\c datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient](@ref datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient-endpoint-snippet) - [\c datacatalog_lineage_v1::LineageClient](@ref datacatalog_lineage_v1::LineageClient-endpoint-snippet) - [\c datacatalog_v1::DataCatalogClient](@ref datacatalog_v1::DataCatalogClient-endpoint-snippet) - [\c datacatalog_v1::PolicyTagManagerClient](@ref datacatalog_v1::PolicyTagManagerClient-endpoint-snippet) @@ -24,6 +25,12 @@ Follow these links to find examples for other \c *Client classes: // +/*! @page datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient-endpoint-snippet Override datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient Endpoint Configuration + +@snippet google/cloud/datacatalog/lineage/configmanagement/v1/samples/config_management_client_samples.cc set-client-endpoint + +*/ + /*! @page datacatalog_lineage_v1::LineageClient-endpoint-snippet Override datacatalog_lineage_v1::LineageClient Endpoint Configuration @snippet google/cloud/datacatalog/lineage/v1/samples/lineage_client_samples.cc set-client-endpoint diff --git a/google/cloud/datacatalog/doc/override-retry-policies.dox b/google/cloud/datacatalog/doc/override-retry-policies.dox index 55e3577996ebb..f6c2d390357cb 100644 --- a/google/cloud/datacatalog/doc/override-retry-policies.dox +++ b/google/cloud/datacatalog/doc/override-retry-policies.dox @@ -67,21 +67,18 @@ will use `FooBarIdempotencyPolicy`. This policy is very conservative. @section datacatalog-override-retry-example Example -For example, this will override the retry policies for `datacatalog_lineage_v1::LineageClient`: +For example, this will override the retry policies for `datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient`: -@snippet lineage_client_samples.cc set-retry-policy +@snippet config_management_client_samples.cc set-retry-policy This assumes you have created a custom idempotency policy. Such as: -@snippet lineage_client_samples.cc custom-idempotency-policy - -This will override the polling policies for `datacatalog_lineage_v1::LineageClient` - -@snippet lineage_client_samples.cc set-polling-policy +@snippet config_management_client_samples.cc custom-idempotency-policy Follow these links to find examples for other \c *Client classes: +- [\c datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient](@ref datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient-retry-snippet) - [\c datacatalog_lineage_v1::LineageClient](@ref datacatalog_lineage_v1::LineageClient-retry-snippet) - [\c datacatalog_v1::DataCatalogClient](@ref datacatalog_v1::DataCatalogClient-retry-snippet) - [\c datacatalog_v1::PolicyTagManagerClient](@ref datacatalog_v1::PolicyTagManagerClient-retry-snippet) @@ -101,6 +98,18 @@ Follow these links to find examples for other \c *Client classes: // +/*! @page datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient-retry-snippet Override datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient Retry Policies + +This shows how to override the retry policies for datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient: + +@snippet google/cloud/datacatalog/lineage/configmanagement/v1/samples/config_management_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/datacatalog/lineage/configmanagement/v1/samples/config_management_client_samples.cc custom-idempotency-policy + +*/ + /*! @page datacatalog_lineage_v1::LineageClient-retry-snippet Override datacatalog_lineage_v1::LineageClient Retry Policies This shows how to override the retry policies for datacatalog_lineage_v1::LineageClient: diff --git a/google/cloud/datacatalog/doc/override-universe-domain.dox b/google/cloud/datacatalog/doc/override-universe-domain.dox index f4559c0d40996..f70a7e89f9130 100644 --- a/google/cloud/datacatalog/doc/override-universe-domain.dox +++ b/google/cloud/datacatalog/doc/override-universe-domain.dox @@ -6,12 +6,13 @@ client library. Use `AddUniverseDomainOption` when initializing the client library to change this default. -For example, this will override the default universe domain for `datacatalog_lineage_v1::LineageClient`: +For example, this will override the default universe domain for `datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient`: -@snippet lineage_client_samples.cc set-client-universe-domain +@snippet config_management_client_samples.cc set-client-universe-domain Follow these links to find examples for other \c *Client classes: +- [\c datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient](@ref datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient-universe-domain-snippet) - [\c datacatalog_lineage_v1::LineageClient](@ref datacatalog_lineage_v1::LineageClient-universe-domain-snippet) - [\c datacatalog_v1::DataCatalogClient](@ref datacatalog_v1::DataCatalogClient-universe-domain-snippet) - [\c datacatalog_v1::PolicyTagManagerClient](@ref datacatalog_v1::PolicyTagManagerClient-universe-domain-snippet) @@ -23,6 +24,12 @@ Follow these links to find examples for other \c *Client classes: // +/*! @page datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient-universe-domain-snippet Override datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient Universe Domain + +@snippet google/cloud/datacatalog/lineage/configmanagement/v1/samples/config_management_client_samples.cc set-client-universe-domain + +*/ + /*! @page datacatalog_lineage_v1::LineageClient-universe-domain-snippet Override datacatalog_lineage_v1::LineageClient Universe Domain @snippet google/cloud/datacatalog/lineage/v1/samples/lineage_client_samples.cc set-client-universe-domain diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/.repo-metadata.json b/google/cloud/datacatalog/lineage/configmanagement/v1/.repo-metadata.json new file mode 100644 index 0000000000000..00fda96e09562 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "api_id": "datalineage.googleapis.com", + "api_shortname": "datalineage", + "client_documentation": "https://cloud.google.com/cpp/docs/reference/datacatalog/latest", + "distribution_name": "google-cloud-cpp", + "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:1530027%20status=open", + "language": "cpp", + "library_type": "GAPIC_AUTO", + "name_pretty": "Data Lineage API", + "product_documentation": "https://cloud.google.com/dataplex/docs/about-data-lineage", + "release_level": "stable", + "repo": "googleapis/google-cloud-cpp", + "requires_billing": true +} diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_client.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_client.cc new file mode 100644 index 0000000000000..8942eeea70708 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_client.cc @@ -0,0 +1,141 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigManagementServiceClient::ConfigManagementServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +ConfigManagementServiceClient::~ConfigManagementServiceClient() = default; + +StatusOr +ConfigManagementServiceClient::GetConfig(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::datacatalog::lineage::configmanagement::v1::GetConfigRequest + request; + request.set_name(name); + return connection_->GetConfig(request); +} + +StatusOr +ConfigManagementServiceClient::GetConfig( + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetConfig(request); +} + +StatusOr +ConfigManagementServiceClient::UpdateConfig( + google::cloud::datacatalog::lineage::configmanagement::v1::Config const& + config, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::datacatalog::lineage::configmanagement::v1::UpdateConfigRequest + request; + *request.mutable_config() = config; + return connection_->UpdateConfig(request); +} + +StatusOr +ConfigManagementServiceClient::UpdateConfig( + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateConfig(request); +} + +StreamRange +ConfigManagementServiceClient::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 +ConfigManagementServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr +ConfigManagementServiceClient::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 +ConfigManagementServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status ConfigManagementServiceClient::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 ConfigManagementServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status ConfigManagementServiceClient::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 ConfigManagementServiceClient::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 datacatalog_lineage_configmanagement_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_client.h b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_client.h new file mode 100644 index 0000000000000..2dbb270c814d3 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_client.h @@ -0,0 +1,494 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_CONFIG_MANAGEMENT_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_CONFIG_MANAGEMENT_CLIENT_H + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.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/version.h" +#include +#include + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// Lineage Config Management service. Config Management service is used to +/// manage the configuration for Data Lineage. These Configs define different +/// configuration options for Lineage customers to control behaviour of lineage +/// systems. +/// +/// @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 ConfigManagementServiceClient { + public: + explicit ConfigManagementServiceClient( + std::shared_ptr connection, + Options opts = {}); + ~ConfigManagementServiceClient(); + + ///@{ + /// @name Copy and move support + ConfigManagementServiceClient(ConfigManagementServiceClient const&) = default; + ConfigManagementServiceClient& operator=( + ConfigManagementServiceClient const&) = default; + ConfigManagementServiceClient(ConfigManagementServiceClient&&) = default; + ConfigManagementServiceClient& operator=(ConfigManagementServiceClient&&) = + default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(ConfigManagementServiceClient const& a, + ConfigManagementServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(ConfigManagementServiceClient const& a, + ConfigManagementServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Get the Config for a given resource. + /// + /// @param name Required. REQUIRED: The resource name of the config to be fetched. + /// Format: + /// `organizations/{organization_id}/locations/global/config` + /// `folders/{folder_id}/locations/global/config` + /// `projects/{project_id}/locations/global/config` + /// `projects/{project_number}/locations/global/config` + /// @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.datacatalog.lineage.configmanagement.v1.Config]) + /// 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.datacatalog.lineage.configmanagement.v1.Config]: @googleapis_reference_link{google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.proto#L96} + /// [google.cloud.datacatalog.lineage.configmanagement.v1.GetConfigRequest]: @googleapis_reference_link{google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.proto#L72} + /// + // clang-format on + StatusOr + GetConfig(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Get the Config for a given resource. + /// + /// @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.datacatalog.lineage.configmanagement.v1.GetConfigRequest]. + /// 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.datacatalog.lineage.configmanagement.v1.Config]) + /// 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.datacatalog.lineage.configmanagement.v1.Config]: @googleapis_reference_link{google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.proto#L96} + /// [google.cloud.datacatalog.lineage.configmanagement.v1.GetConfigRequest]: @googleapis_reference_link{google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.proto#L72} + /// + // clang-format on + StatusOr + GetConfig(google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Update the Config for a given resource. + /// + /// @param config Required. REQUIRED: The config to be applied to the resource and all its + /// descendants. + /// @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.datacatalog.lineage.configmanagement.v1.Config]) + /// 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.datacatalog.lineage.configmanagement.v1.Config]: @googleapis_reference_link{google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.proto#L96} + /// [google.cloud.datacatalog.lineage.configmanagement.v1.UpdateConfigRequest]: @googleapis_reference_link{google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.proto#L88} + /// + // clang-format on + StatusOr + UpdateConfig( + google::cloud::datacatalog::lineage::configmanagement::v1::Config const& + config, + Options opts = {}); + + // clang-format off + /// + /// Update the Config for a given resource. + /// + /// @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.datacatalog.lineage.configmanagement.v1.UpdateConfigRequest]. + /// 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.datacatalog.lineage.configmanagement.v1.Config]) + /// 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.datacatalog.lineage.configmanagement.v1.Config]: @googleapis_reference_link{google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.proto#L96} + /// [google.cloud.datacatalog.lineage.configmanagement.v1.UpdateConfigRequest]: @googleapis_reference_link{google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.proto#L88} + /// + // clang-format on + StatusOr + UpdateConfig(google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 datacatalog_lineage_configmanagement_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_CONFIG_MANAGEMENT_CLIENT_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.cc new file mode 100644 index 0000000000000..fa1c31fb738ac --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.cc @@ -0,0 +1,103 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_options.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_connection_impl.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_option_defaults.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub_factory.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_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 datacatalog_lineage_configmanagement_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigManagementServiceConnection::~ConfigManagementServiceConnection() = + default; + +StatusOr +ConfigManagementServiceConnection::GetConfig( + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +ConfigManagementServiceConnection::UpdateConfig( + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +ConfigManagementServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +ConfigManagementServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status ConfigManagementServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status ConfigManagementServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr +MakeConfigManagementServiceConnection(Options options) { + internal::CheckExpectedOptions( + options, __func__); + options = datacatalog_lineage_configmanagement_v1_internal:: + ConfigManagementServiceDefaultOptions(std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = datacatalog_lineage_configmanagement_v1_internal:: + CreateDefaultConfigManagementServiceStub(std::move(auth), options); + return datacatalog_lineage_configmanagement_v1_internal:: + MakeConfigManagementServiceTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.h b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.h new file mode 100644 index 0000000000000..ac4a123a5d095 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.h @@ -0,0 +1,251 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_CONFIG_MANAGEMENT_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_CONFIG_MANAGEMENT_CONNECTION_H + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection_idempotency_policy.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.pb.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_retry_traits.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/internal/retry_policy_impl.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `ConfigManagementServiceConnection`. +class ConfigManagementServiceRetryPolicy : 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 `ConfigManagementServiceConnection` 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 ConfigManagementServiceLimitedErrorCountRetryPolicy + : public ConfigManagementServiceRetryPolicy { + 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 ConfigManagementServiceLimitedErrorCountRetryPolicy( + int maximum_failures) + : impl_(maximum_failures) {} + + ConfigManagementServiceLimitedErrorCountRetryPolicy( + ConfigManagementServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : ConfigManagementServiceLimitedErrorCountRetryPolicy( + rhs.maximum_failures()) {} + ConfigManagementServiceLimitedErrorCountRetryPolicy( + ConfigManagementServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : ConfigManagementServiceLimitedErrorCountRetryPolicy( + 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< + ConfigManagementServiceLimitedErrorCountRetryPolicy>( + maximum_failures()); + } + + // This is provided only for backwards compatibility. + using BaseType = ConfigManagementServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + datacatalog_lineage_configmanagement_v1_internal:: + ConfigManagementServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `ConfigManagementServiceConnection` 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 ConfigManagementServiceLimitedTimeRetryPolicy + : public ConfigManagementServiceRetryPolicy { + 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 ConfigManagementServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + ConfigManagementServiceLimitedTimeRetryPolicy( + ConfigManagementServiceLimitedTimeRetryPolicy&& rhs) noexcept + : ConfigManagementServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + ConfigManagementServiceLimitedTimeRetryPolicy( + ConfigManagementServiceLimitedTimeRetryPolicy const& rhs) noexcept + : ConfigManagementServiceLimitedTimeRetryPolicy(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 = ConfigManagementServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + datacatalog_lineage_configmanagement_v1_internal:: + ConfigManagementServiceRetryTraits> + impl_; +}; + +/** + * The `ConfigManagementServiceConnection` object for + * `ConfigManagementServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `ConfigManagementServiceClient`. This allows users to inject custom + * behavior (e.g., with a Google Mock object) when writing tests that use + * objects of type `ConfigManagementServiceClient`. + * + * To create a concrete instance, see `MakeConfigManagementServiceConnection()`. + * + * For mocking, see + * `datacatalog_lineage_configmanagement_v1_mocks::MockConfigManagementServiceConnection`. + */ +class ConfigManagementServiceConnection { + public: + virtual ~ConfigManagementServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StatusOr< + google::cloud::datacatalog::lineage::configmanagement::v1::Config> + GetConfig(google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request); + + virtual StatusOr< + google::cloud::datacatalog::lineage::configmanagement::v1::Config> + UpdateConfig(google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest 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 + * `ConfigManagementServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of + * ConfigManagementServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `ConfigManagementServiceConnection`. Expected options are any of the + * types in the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - + * `google::cloud::datacatalog_lineage_configmanagement_v1::ConfigManagementServicePolicyOptionList` + * + * @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 `ConfigManagementServiceConnection` + * created by this function. + */ +std::shared_ptr +MakeConfigManagementServiceConnection(Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_CONFIG_MANAGEMENT_CONNECTION_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection_idempotency_policy.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..6a34d7ccbe543 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection_idempotency_policy.cc @@ -0,0 +1,79 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +ConfigManagementServiceConnectionIdempotencyPolicy:: + ~ConfigManagementServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +ConfigManagementServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique( + *this); +} + +Idempotency ConfigManagementServiceConnectionIdempotencyPolicy::GetConfig( + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency ConfigManagementServiceConnectionIdempotencyPolicy::UpdateConfig( + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigManagementServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency ConfigManagementServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency ConfigManagementServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigManagementServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultConfigManagementServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection_idempotency_policy.h b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection_idempotency_policy.h new file mode 100644 index 0000000000000..9562ea7fd6ab9 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection_idempotency_policy.h @@ -0,0 +1,71 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_CONFIG_MANAGEMENT_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_CONFIG_MANAGEMENT_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigManagementServiceConnectionIdempotencyPolicy { + public: + virtual ~ConfigManagementServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr + clone() const; + + virtual google::cloud::Idempotency GetConfig( + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request); + + virtual google::cloud::Idempotency UpdateConfig( + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest 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 +MakeDefaultConfigManagementServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_CONFIG_MANAGEMENT_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_options.h b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_options.h new file mode 100644 index 0000000000000..408ab0fcae5fd --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/config_management_options.h @@ -0,0 +1,78 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_CONFIG_MANAGEMENT_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_CONFIG_MANAGEMENT_OPTIONS_H + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_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 datacatalog_lineage_configmanagement_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-datacatalog-options + */ +struct ConfigManagementServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-datacatalog-options + */ +struct ConfigManagementServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-datacatalog-options + */ +struct ConfigManagementServiceConnectionIdempotencyPolicyOption { + using Type = + std::shared_ptr; +}; + +/** + * The options applicable to ConfigManagementService. + * + * @ingroup google-cloud-datacatalog-options + */ +using ConfigManagementServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_CONFIG_MANAGEMENT_OPTIONS_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_auth_decorator.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_auth_decorator.cc new file mode 100644 index 0000000000000..33d243689a2d1 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_auth_decorator.cc @@ -0,0 +1,97 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_auth_decorator.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigManagementServiceAuth::ConfigManagementServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +ConfigManagementServiceAuth::GetConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetConfig(context, options, request); +} + +StatusOr +ConfigManagementServiceAuth::UpdateConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateConfig(context, options, request); +} + +StatusOr +ConfigManagementServiceAuth::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 +ConfigManagementServiceAuth::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 ConfigManagementServiceAuth::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 ConfigManagementServiceAuth::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); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_auth_decorator.h b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_auth_decorator.h new file mode 100644 index 0000000000000..9a0c3494241e4 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_auth_decorator.h @@ -0,0 +1,83 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_AUTH_DECORATOR_H + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigManagementServiceAuth : public ConfigManagementServiceStub { + public: + ~ConfigManagementServiceAuth() override = default; + ConfigManagementServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr + GetConfig(grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) override; + + StatusOr + UpdateConfig(grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest 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; + + private: + std::shared_ptr auth_; + std::shared_ptr child_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_AUTH_DECORATOR_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_connection_impl.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_connection_impl.cc new file mode 100644 index 0000000000000..b8a4c542954c9 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_connection_impl.cc @@ -0,0 +1,183 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_connection_impl.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_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/pagination_range.h" +#include "google/cloud/internal/retry_loop.h" +#include +#include + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { + +std::unique_ptr< + datacatalog_lineage_configmanagement_v1::ConfigManagementServiceRetryPolicy> +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(); +} + +} // namespace + +ConfigManagementServiceConnectionImpl::ConfigManagementServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr + stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions( + std::move(options), ConfigManagementServiceConnection::options())) {} + +StatusOr +ConfigManagementServiceConnectionImpl::GetConfig( + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) { + return stub_->GetConfig(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +ConfigManagementServiceConnectionImpl::UpdateConfig( + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest const& request) { + return stub_->UpdateConfig(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +ConfigManagementServiceConnectionImpl::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 +ConfigManagementServiceConnectionImpl::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 ConfigManagementServiceConnectionImpl::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 ConfigManagementServiceConnectionImpl::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 datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_connection_impl.h b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_connection_impl.h new file mode 100644 index 0000000000000..00f453402e3eb --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_connection_impl.h @@ -0,0 +1,89 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_CONNECTION_IMPL_H + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection_idempotency_policy.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_options.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_retry_traits.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.h" +#include "google/cloud/background_threads.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigManagementServiceConnectionImpl + : public datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceConnection { + public: + ~ConfigManagementServiceConnectionImpl() override = default; + + ConfigManagementServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr + stub, + Options options); + + Options options() override { return options_; } + + StatusOr + GetConfig(google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) override; + + StatusOr + UpdateConfig(google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest 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 datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_CONNECTION_IMPL_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_logging_decorator.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_logging_decorator.cc new file mode 100644 index 0000000000000..3e3a72d827545 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_logging_decorator.cc @@ -0,0 +1,121 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_logging_decorator.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigManagementServiceLogging::ConfigManagementServiceLogging( + std::shared_ptr child, + TracingOptions tracing_options, std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +ConfigManagementServiceLogging::GetConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) { + return child_->GetConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ConfigManagementServiceLogging::UpdateConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest const& request) { + return child_->UpdateConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ConfigManagementServiceLogging::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 +ConfigManagementServiceLogging::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 ConfigManagementServiceLogging::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 ConfigManagementServiceLogging::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_); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_logging_decorator.h b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_logging_decorator.h new file mode 100644 index 0000000000000..9a2b56b668fb2 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_logging_decorator.h @@ -0,0 +1,83 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_LOGGING_DECORATOR_H + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigManagementServiceLogging : public ConfigManagementServiceStub { + public: + ~ConfigManagementServiceLogging() override = default; + ConfigManagementServiceLogging( + std::shared_ptr child, + TracingOptions tracing_options, std::set const& components); + + StatusOr + GetConfig(grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) override; + + StatusOr + UpdateConfig(grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest 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; + + private: + std::shared_ptr child_; + TracingOptions tracing_options_; +}; // ConfigManagementServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_LOGGING_DECORATOR_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_metadata_decorator.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_metadata_decorator.cc new file mode 100644 index 0000000000000..9ca5def2d0fde --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_metadata_decorator.cc @@ -0,0 +1,125 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_metadata_decorator.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigManagementServiceMetadata::ConfigManagementServiceMetadata( + 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 +ConfigManagementServiceMetadata::GetConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetConfig(context, options, request); +} + +StatusOr +ConfigManagementServiceMetadata::UpdateConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest const& request) { + SetMetadata(context, options, + absl::StrCat("config.name=", + internal::UrlEncode(request.config().name()))); + return child_->UpdateConfig(context, options, request); +} + +StatusOr +ConfigManagementServiceMetadata::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 +ConfigManagementServiceMetadata::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 ConfigManagementServiceMetadata::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 ConfigManagementServiceMetadata::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); +} + +void ConfigManagementServiceMetadata::SetMetadata( + grpc::ClientContext& context, Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void ConfigManagementServiceMetadata::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 datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_metadata_decorator.h b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_metadata_decorator.h new file mode 100644 index 0000000000000..1ef36b7648c8e --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_metadata_decorator.h @@ -0,0 +1,89 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_METADATA_DECORATOR_H + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigManagementServiceMetadata : public ConfigManagementServiceStub { + public: + ~ConfigManagementServiceMetadata() override = default; + ConfigManagementServiceMetadata( + std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr + GetConfig(grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) override; + + StatusOr + UpdateConfig(grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest 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; + + 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 datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_METADATA_DECORATOR_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_option_defaults.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_option_defaults.cc new file mode 100644 index 0000000000000..af84d157d7c90 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_option_defaults.cc @@ -0,0 +1,76 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_option_defaults.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_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 datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options ConfigManagementServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_CONFIG_MANAGEMENT_SERVICE_ENDPOINT", + "", "GOOGLE_CLOUD_CPP_CONFIG_MANAGEMENT_SERVICE_AUTHORITY", + "datalineage.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceLimitedTimeRetryPolicy( + std::chrono::minutes(10)) + .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< + datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceConnectionIdempotencyPolicyOption>()) { + options.set( + datacatalog_lineage_configmanagement_v1:: + MakeDefaultConfigManagementServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_option_defaults.h b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_option_defaults.h new file mode 100644 index 0000000000000..385c4335f0848 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_option_defaults.h @@ -0,0 +1,38 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options ConfigManagementServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_OPTION_DEFAULTS_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_retry_traits.h b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_retry_traits.h new file mode 100644 index 0000000000000..31acb10c870ff --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_retry_traits.h @@ -0,0 +1,44 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct ConfigManagementServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_RETRY_TRAITS_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_sources.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_sources.cc new file mode 100644 index 0000000000000..f75da8ba3f494 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_sources.cc @@ -0,0 +1,33 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_client.cc" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.cc" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection_idempotency_policy.cc" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_auth_decorator.cc" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_connection_impl.cc" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_logging_decorator.cc" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_metadata_decorator.cc" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_option_defaults.cc" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.cc" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub_factory.cc" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_connection.cc" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_stub.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.cc new file mode 100644 index 0000000000000..c68ba78482f64 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.cc @@ -0,0 +1,114 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigManagementServiceStub::~ConfigManagementServiceStub() = default; + +StatusOr +DefaultConfigManagementServiceStub::GetConfig( + grpc::ClientContext& context, Options const&, + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) { + google::cloud::datacatalog::lineage::configmanagement::v1::Config response; + auto status = grpc_stub_->GetConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigManagementServiceStub::UpdateConfig( + grpc::ClientContext& context, Options const&, + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest const& request) { + google::cloud::datacatalog::lineage::configmanagement::v1::Config response; + auto status = grpc_stub_->UpdateConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigManagementServiceStub::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 +DefaultConfigManagementServiceStub::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 DefaultConfigManagementServiceStub::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 DefaultConfigManagementServiceStub::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(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.h b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.h new file mode 100644 index 0000000000000..20693ee49b451 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.h @@ -0,0 +1,124 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_STUB_H + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.grpc.pb.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigManagementServiceStub { + public: + virtual ~ConfigManagementServiceStub() = 0; + + virtual StatusOr< + google::cloud::datacatalog::lineage::configmanagement::v1::Config> + GetConfig(grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) = 0; + + virtual StatusOr< + google::cloud::datacatalog::lineage::configmanagement::v1::Config> + UpdateConfig(grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest 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; +}; + +class DefaultConfigManagementServiceStub : public ConfigManagementServiceStub { + public: + explicit DefaultConfigManagementServiceStub( + std::unique_ptr + grpc_stub, + std::unique_ptr + operations_stub) + : grpc_stub_(std::move(grpc_stub)), + operations_stub_(std::move(operations_stub)) {} + + StatusOr + GetConfig(grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) override; + + StatusOr + UpdateConfig(grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest 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; + + private: + std::unique_ptr + grpc_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_STUB_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub_factory.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub_factory.cc new file mode 100644 index 0000000000000..8394ad35ea6cd --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub_factory.cc @@ -0,0 +1,82 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub_factory.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/configmanagement.grpc.pb.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_auth_decorator.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_logging_decorator.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_metadata_decorator.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr +CreateDefaultConfigManagementServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = google::cloud::datacatalog::lineage:: + configmanagement::v1::ConfigManagementService::NewStub(channel); + auto service_operations_stub = + google::longrunning::Operations::NewStub(channel); + std::shared_ptr stub = + std::make_shared( + std::move(service_grpc_stub), std::move(service_operations_stub)); + + 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 = MakeConfigManagementServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub_factory.h b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub_factory.h new file mode 100644 index 0000000000000..f2edb0fd6daae --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub_factory.h @@ -0,0 +1,49 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_STUB_FACTORY_H + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr +CreateDefaultConfigManagementServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_STUB_FACTORY_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_connection.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_connection.cc new file mode 100644 index 0000000000000..141175e74acaa --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_connection.cc @@ -0,0 +1,116 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigManagementServiceTracingConnection:: + ConfigManagementServiceTracingConnection( + std::shared_ptr + child) + : child_(std::move(child)) {} + +StatusOr +ConfigManagementServiceTracingConnection::GetConfig( + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) { + auto span = internal::MakeSpan( + "datacatalog_lineage_configmanagement_v1::" + "ConfigManagementServiceConnection::GetConfig"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetConfig(request)); +} + +StatusOr +ConfigManagementServiceTracingConnection::UpdateConfig( + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest const& request) { + auto span = internal::MakeSpan( + "datacatalog_lineage_configmanagement_v1::" + "ConfigManagementServiceConnection::UpdateConfig"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateConfig(request)); +} + +StreamRange +ConfigManagementServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = internal::MakeSpan( + "datacatalog_lineage_configmanagement_v1::" + "ConfigManagementServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +ConfigManagementServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpan( + "datacatalog_lineage_configmanagement_v1::" + "ConfigManagementServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status ConfigManagementServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "datacatalog_lineage_configmanagement_v1::" + "ConfigManagementServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status ConfigManagementServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "datacatalog_lineage_configmanagement_v1::" + "ConfigManagementServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr< + datacatalog_lineage_configmanagement_v1::ConfigManagementServiceConnection> +MakeConfigManagementServiceTracingConnection( + std::shared_ptr + conn) { + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared( + std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_connection.h b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_connection.h new file mode 100644 index 0000000000000..fd2d4eaab863d --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_connection.h @@ -0,0 +1,89 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_TRACING_CONNECTION_H + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigManagementServiceTracingConnection + : public datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceConnection { + public: + ~ConfigManagementServiceTracingConnection() override = default; + + explicit ConfigManagementServiceTracingConnection( + std::shared_ptr + child); + + Options options() override { return child_->options(); } + + StatusOr + GetConfig(google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) override; + + StatusOr + UpdateConfig(google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest 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_; +}; + +/** + * 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< + datacatalog_lineage_configmanagement_v1::ConfigManagementServiceConnection> +MakeConfigManagementServiceTracingConnection( + std::shared_ptr + conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_TRACING_CONNECTION_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_stub.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_stub.cc new file mode 100644 index 0000000000000..d7540885e76b4 --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_stub.cc @@ -0,0 +1,132 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigManagementServiceTracingStub::ConfigManagementServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +ConfigManagementServiceTracingStub::GetConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.datacatalog.lineage.configmanagement.v1." + "ConfigManagementService", + "GetConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetConfig(context, options, request)); +} + +StatusOr +ConfigManagementServiceTracingStub::UpdateConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.datacatalog.lineage.configmanagement.v1." + "ConfigManagementService", + "UpdateConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateConfig(context, options, request)); +} + +StatusOr +ConfigManagementServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.datacatalog.lineage.configmanagement.v1." + "ConfigManagementService", + "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +ConfigManagementServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.datacatalog.lineage.configmanagement.v1." + "ConfigManagementService", + "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status ConfigManagementServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.datacatalog.lineage.configmanagement.v1." + "ConfigManagementService", + "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status ConfigManagementServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.datacatalog.lineage.configmanagement.v1." + "ConfigManagementService", + "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +std::shared_ptr +MakeConfigManagementServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_stub.h b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_stub.h new file mode 100644 index 0000000000000..2fa7a6190e48d --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_tracing_stub.h @@ -0,0 +1,93 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_TRACING_STUB_H + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/internal/config_management_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigManagementServiceTracingStub : public ConfigManagementServiceStub { + public: + ~ConfigManagementServiceTracingStub() override = default; + + explicit ConfigManagementServiceTracingStub( + std::shared_ptr child); + + StatusOr + GetConfig(grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request) override; + + StatusOr + UpdateConfig(grpc::ClientContext& context, Options const& options, + google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest 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; + + private: + std::shared_ptr child_; + std::shared_ptr + propagator_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr +MakeConfigManagementServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace datacatalog_lineage_configmanagement_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_INTERNAL_CONFIG_MANAGEMENT_TRACING_STUB_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/mocks/mock_config_management_connection.h b/google/cloud/datacatalog/lineage/configmanagement/v1/mocks/mock_config_management_connection.h new file mode 100644 index 0000000000000..12dccf059a47b --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/mocks/mock_config_management_connection.h @@ -0,0 +1,89 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_MOCKS_MOCK_CONFIG_MANAGEMENT_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_MOCKS_MOCK_CONFIG_MANAGEMENT_CONNECTION_H + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection.h" +#include + +namespace google { +namespace cloud { +namespace datacatalog_lineage_configmanagement_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `ConfigManagementServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `ConfigManagementServiceClient`. To + * do so, construct an object of type `ConfigManagementServiceClient` 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 MockConfigManagementServiceConnection + : public datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD( + StatusOr< + google::cloud::datacatalog::lineage::configmanagement::v1::Config>, + GetConfig, + (google::cloud::datacatalog::lineage::configmanagement::v1:: + GetConfigRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr< + google::cloud::datacatalog::lineage::configmanagement::v1::Config>, + UpdateConfig, + (google::cloud::datacatalog::lineage::configmanagement::v1:: + UpdateConfigRequest 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 datacatalog_lineage_configmanagement_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATACATALOG_LINEAGE_CONFIGMANAGEMENT_V1_MOCKS_MOCK_CONFIG_MANAGEMENT_CONNECTION_H diff --git a/google/cloud/datacatalog/lineage/configmanagement/v1/samples/config_management_client_samples.cc b/google/cloud/datacatalog/lineage/configmanagement/v1/samples/config_management_client_samples.cc new file mode 100644 index 0000000000000..c55167e99315d --- /dev/null +++ b/google/cloud/datacatalog/lineage/configmanagement/v1/samples/config_management_client_samples.cc @@ -0,0 +1,195 @@ +// Copyright 2026 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/datacatalog/lineage/configmanagement/v1/configmanagement.proto + +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_client.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_connection_idempotency_policy.h" +#include "google/cloud/datacatalog/lineage/configmanagement/v1/config_management_options.h" +#include "google/cloud/common_options.h" +#include "google/cloud/credentials.h" +#include "google/cloud/internal/getenv.h" +#include "google/cloud/testing_util/example_driver.h" +#include "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: datacatalog_lineage_configmanagement_v1::ConfigManagementServiceClient +// 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::datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceClient( + google::cloud::datacatalog_lineage_configmanagement_v1:: + MakeConfigManagementServiceConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceClient( + google::cloud::datacatalog_lineage_configmanagement_v1:: + MakeConfigManagementServiceConnection(*ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceConnectionIdempotencyPolicy { + 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::datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceLimitedErrorCountRetryPolicy(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::datacatalog_lineage_configmanagement_v1:: + MakeConfigManagementServiceConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceClient(connection); + auto c2 = google::cloud::datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceClient(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::datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceClient( + connection, + google::cloud::Options{} + .set( + google::cloud::datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::datacatalog_lineage_configmanagement_v1::ConfigManagementServiceLimitedErrorCountRetryPolicy(10).clone())); + //! [set-retry-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::datacatalog_lineage_configmanagement_v1:: + ConfigManagementServiceClient( + google::cloud::datacatalog_lineage_configmanagement_v1:: + MakeConfigManagementServiceConnection(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 WithServiceAccount() example" << std::endl; + WithServiceAccount({keyfile}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"with-service-account", WithServiceAccount}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/datacatalog/lineage/v1/lineage_client.h b/google/cloud/datacatalog/lineage/v1/lineage_client.h index ad0811d09d744..bb1a12b16551e 100644 --- a/google/cloud/datacatalog/lineage/v1/lineage_client.h +++ b/google/cloud/datacatalog/lineage/v1/lineage_client.h @@ -1477,7 +1477,7 @@ class LineageClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1516,7 +1516,7 @@ class LineageClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/datacatalog/quickstart/.bazelversion b/google/cloud/datacatalog/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/datacatalog/quickstart/.bazelversion +++ b/google/cloud/datacatalog/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/datacatalog/quickstart/WORKSPACE.bazel b/google/cloud/datacatalog/quickstart/WORKSPACE.bazel index 4c45be2a3b081..f046249b15c93 100644 --- a/google/cloud/datacatalog/quickstart/WORKSPACE.bazel +++ b/google/cloud/datacatalog/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/datacatalog/v1/data_catalog_client.h b/google/cloud/datacatalog/v1/data_catalog_client.h index 7edcba8771fc6..020f7c2e81c6a 100644 --- a/google/cloud/datacatalog/v1/data_catalog_client.h +++ b/google/cloud/datacatalog/v1/data_catalog_client.h @@ -3282,7 +3282,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -3321,7 +3321,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/datacatalog/v1/policy_tag_manager_client.h b/google/cloud/datacatalog/v1/policy_tag_manager_client.h index edc3f470a777e..a1e1eedd500c8 100644 --- a/google/cloud/datacatalog/v1/policy_tag_manager_client.h +++ b/google/cloud/datacatalog/v1/policy_tag_manager_client.h @@ -1023,7 +1023,7 @@ class PolicyTagManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1062,7 +1062,7 @@ class PolicyTagManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/datacatalog/v1/policy_tag_manager_serialization_client.h b/google/cloud/datacatalog/v1/policy_tag_manager_serialization_client.h index 378a31fa0901c..d713027f0d207 100644 --- a/google/cloud/datacatalog/v1/policy_tag_manager_serialization_client.h +++ b/google/cloud/datacatalog/v1/policy_tag_manager_serialization_client.h @@ -432,7 +432,7 @@ class PolicyTagManagerSerializationClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -471,7 +471,7 @@ class PolicyTagManagerSerializationClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataform/doc/override-retry-policies.dox b/google/cloud/dataform/doc/override-retry-policies.dox index 8ef2ddddf8e69..16c9fa21244dc 100644 --- a/google/cloud/dataform/doc/override-retry-policies.dox +++ b/google/cloud/dataform/doc/override-retry-policies.dox @@ -75,6 +75,10 @@ This assumes you have created a custom idempotency policy. Such as: @snippet dataform_client_samples.cc custom-idempotency-policy +This will override the polling policies for `dataform_v1::DataformClient` + +@snippet dataform_client_samples.cc set-polling-policy + diff --git a/google/cloud/dataform/quickstart/WORKSPACE.bazel b/google/cloud/dataform/quickstart/WORKSPACE.bazel index 35ac501a0608d..93c34a4cfe605 100644 --- a/google/cloud/dataform/quickstart/WORKSPACE.bazel +++ b/google/cloud/dataform/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/dataform/v1/dataform_client.cc b/google/cloud/dataform/v1/dataform_client.cc index fb2d92631b835..3fd0d9b2c6fc3 100644 --- a/google/cloud/dataform/v1/dataform_client.cc +++ b/google/cloud/dataform/v1/dataform_client.cc @@ -32,6 +32,328 @@ DataformClient::DataformClient(std::shared_ptr connection, internal::MergeOptions(std::move(opts), connection_->options())) {} DataformClient::~DataformClient() = default; +StatusOr DataformClient::GetTeamFolder( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::GetTeamFolderRequest request; + request.set_name(name); + return connection_->GetTeamFolder(request); +} + +StatusOr DataformClient::GetTeamFolder( + google::cloud::dataform::v1::GetTeamFolderRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetTeamFolder(request); +} + +StatusOr +DataformClient::CreateTeamFolder( + std::string const& parent, + google::cloud::dataform::v1::TeamFolder const& team_folder, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::CreateTeamFolderRequest request; + request.set_parent(parent); + *request.mutable_team_folder() = team_folder; + return connection_->CreateTeamFolder(request); +} + +StatusOr +DataformClient::CreateTeamFolder( + google::cloud::dataform::v1::CreateTeamFolderRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateTeamFolder(request); +} + +StatusOr +DataformClient::UpdateTeamFolder( + google::cloud::dataform::v1::TeamFolder const& team_folder, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::UpdateTeamFolderRequest request; + *request.mutable_team_folder() = team_folder; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateTeamFolder(request); +} + +StatusOr +DataformClient::UpdateTeamFolder( + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateTeamFolder(request); +} + +Status DataformClient::DeleteTeamFolder(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::DeleteTeamFolderRequest request; + request.set_name(name); + return connection_->DeleteTeamFolder(request); +} + +Status DataformClient::DeleteTeamFolder( + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteTeamFolder(request); +} + +future> +DataformClient::DeleteTeamFolderTree(std::string const& name, bool force, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest request; + request.set_name(name); + request.set_force(force); + return connection_->DeleteTeamFolderTree(request); +} + +StatusOr DataformClient::DeleteTeamFolderTree( + NoAwaitTag, std::string const& name, bool force, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest request; + request.set_name(name); + request.set_force(force); + return connection_->DeleteTeamFolderTree(NoAwaitTag{}, request); +} + +future> +DataformClient::DeleteTeamFolderTree( + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteTeamFolderTree(request); +} + +StatusOr DataformClient::DeleteTeamFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteTeamFolderTree(NoAwaitTag{}, request); +} + +future> +DataformClient::DeleteTeamFolderTree( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteTeamFolderTree(operation); +} + +StreamRange +DataformClient::QueryTeamFolderContents(std::string const& team_folder, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::QueryTeamFolderContentsRequest request; + request.set_team_folder(team_folder); + return connection_->QueryTeamFolderContents(request); +} + +StreamRange +DataformClient::QueryTeamFolderContents( + google::cloud::dataform::v1::QueryTeamFolderContentsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->QueryTeamFolderContents(std::move(request)); +} + +StreamRange +DataformClient::SearchTeamFolders( + google::cloud::dataform::v1::SearchTeamFoldersRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->SearchTeamFolders(std::move(request)); +} + +StatusOr DataformClient::GetFolder( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::GetFolderRequest request; + request.set_name(name); + return connection_->GetFolder(request); +} + +StatusOr DataformClient::GetFolder( + google::cloud::dataform::v1::GetFolderRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetFolder(request); +} + +StatusOr DataformClient::CreateFolder( + std::string const& parent, + google::cloud::dataform::v1::Folder const& folder, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::CreateFolderRequest request; + request.set_parent(parent); + *request.mutable_folder() = folder; + return connection_->CreateFolder(request); +} + +StatusOr DataformClient::CreateFolder( + google::cloud::dataform::v1::CreateFolderRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateFolder(request); +} + +StatusOr DataformClient::UpdateFolder( + google::cloud::dataform::v1::Folder const& folder, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::UpdateFolderRequest request; + *request.mutable_folder() = folder; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateFolder(request); +} + +StatusOr DataformClient::UpdateFolder( + google::cloud::dataform::v1::UpdateFolderRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateFolder(request); +} + +Status DataformClient::DeleteFolder(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::DeleteFolderRequest request; + request.set_name(name); + return connection_->DeleteFolder(request); +} + +Status DataformClient::DeleteFolder( + google::cloud::dataform::v1::DeleteFolderRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteFolder(request); +} + +future> +DataformClient::DeleteFolderTree(std::string const& name, bool force, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::DeleteFolderTreeRequest request; + request.set_name(name); + request.set_force(force); + return connection_->DeleteFolderTree(request); +} + +StatusOr DataformClient::DeleteFolderTree( + NoAwaitTag, std::string const& name, bool force, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::DeleteFolderTreeRequest request; + request.set_name(name); + request.set_force(force); + return connection_->DeleteFolderTree(NoAwaitTag{}, request); +} + +future> +DataformClient::DeleteFolderTree( + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteFolderTree(request); +} + +StatusOr DataformClient::DeleteFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteFolderTree(NoAwaitTag{}, request); +} + +future> +DataformClient::DeleteFolderTree( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteFolderTree(operation); +} + +StreamRange +DataformClient::QueryFolderContents(std::string const& folder, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::QueryFolderContentsRequest request; + request.set_folder(folder); + return connection_->QueryFolderContents(request); +} + +StreamRange +DataformClient::QueryFolderContents( + google::cloud::dataform::v1::QueryFolderContentsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->QueryFolderContents(std::move(request)); +} + +StreamRange +DataformClient::QueryUserRootContents(std::string const& location, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::QueryUserRootContentsRequest request; + request.set_location(location); + return connection_->QueryUserRootContents(request); +} + +StreamRange +DataformClient::QueryUserRootContents( + google::cloud::dataform::v1::QueryUserRootContentsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->QueryUserRootContents(std::move(request)); +} + +future> +DataformClient::MoveFolder(std::string const& name, + std::string const& destination_containing_folder, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::MoveFolderRequest request; + request.set_name(name); + request.set_destination_containing_folder(destination_containing_folder); + return connection_->MoveFolder(request); +} + +StatusOr DataformClient::MoveFolder( + NoAwaitTag, std::string const& name, + std::string const& destination_containing_folder, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::MoveFolderRequest request; + request.set_name(name); + request.set_destination_containing_folder(destination_containing_folder); + return connection_->MoveFolder(NoAwaitTag{}, request); +} + +future> +DataformClient::MoveFolder( + google::cloud::dataform::v1::MoveFolderRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->MoveFolder(request); +} + +StatusOr DataformClient::MoveFolder( + NoAwaitTag, google::cloud::dataform::v1::MoveFolderRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->MoveFolder(NoAwaitTag{}, request); +} + +future> +DataformClient::MoveFolder(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->MoveFolder(operation); +} + StreamRange DataformClient::ListRepositories(std::string const& parent, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); @@ -117,6 +439,50 @@ Status DataformClient::DeleteRepository( return connection_->DeleteRepository(request); } +future> +DataformClient::MoveRepository(std::string const& name, + std::string const& destination_containing_folder, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::MoveRepositoryRequest request; + request.set_name(name); + request.set_destination_containing_folder(destination_containing_folder); + return connection_->MoveRepository(request); +} + +StatusOr DataformClient::MoveRepository( + NoAwaitTag, std::string const& name, + std::string const& destination_containing_folder, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataform::v1::MoveRepositoryRequest request; + request.set_name(name); + request.set_destination_containing_folder(destination_containing_folder); + return connection_->MoveRepository(NoAwaitTag{}, request); +} + +future> +DataformClient::MoveRepository( + google::cloud::dataform::v1::MoveRepositoryRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->MoveRepository(request); +} + +StatusOr DataformClient::MoveRepository( + NoAwaitTag, + google::cloud::dataform::v1::MoveRepositoryRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->MoveRepository(NoAwaitTag{}, request); +} + +future> +DataformClient::MoveRepository(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->MoveRepository(operation); +} + StatusOr DataformClient::CommitRepositoryChanges( google::cloud::dataform::v1::CommitRepositoryChangesRequest const& request, @@ -717,6 +1083,33 @@ StatusOr DataformClient::UpdateConfig( return connection_->UpdateConfig(request); } +StatusOr DataformClient::GetIamPolicy( + std::string const& resource, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::iam::v1::GetIamPolicyRequest request; + request.set_resource(resource); + return connection_->GetIamPolicy(request); +} + +StatusOr DataformClient::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetIamPolicy(request); +} + +StatusOr DataformClient::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->SetIamPolicy(request); +} + +StatusOr +DataformClient::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->TestIamPermissions(request); +} + StreamRange DataformClient::ListLocations( google::cloud::location::ListLocationsRequest request, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); @@ -729,23 +1122,59 @@ StatusOr DataformClient::GetLocation( return connection_->GetLocation(request); } -StatusOr DataformClient::SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request, Options opts) { +StreamRange DataformClient::ListOperations( + std::string const& name, std::string const& filter, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->SetIamPolicy(request); + google::longrunning::ListOperationsRequest request; + request.set_name(name); + request.set_filter(filter); + return connection_->ListOperations(request); } -StatusOr DataformClient::GetIamPolicy( - google::iam::v1::GetIamPolicyRequest const& request, Options opts) { +StreamRange DataformClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->GetIamPolicy(request); + return connection_->ListOperations(std::move(request)); } -StatusOr -DataformClient::TestIamPermissions( - google::iam::v1::TestIamPermissionsRequest const& request, Options opts) { +StatusOr DataformClient::GetOperation( + std::string const& name, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->TestIamPermissions(request); + google::longrunning::GetOperationRequest request; + request.set_name(name); + return connection_->GetOperation(request); +} + +StatusOr DataformClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status DataformClient::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 DataformClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status DataformClient::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 DataformClient::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 diff --git a/google/cloud/dataform/v1/dataform_client.h b/google/cloud/dataform/v1/dataform_client.h index 9e51eb56eb485..b6e85f2fc61ae 100644 --- a/google/cloud/dataform/v1/dataform_client.h +++ b/google/cloud/dataform/v1/dataform_client.h @@ -21,10 +21,12 @@ #include "google/cloud/dataform/v1/dataform_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 "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -87,28 +89,15 @@ class DataformClient { // clang-format off /// - /// Lists Repositories in a given project and location. - /// - /// **Note:** *This method can return repositories not shown in the [Dataform - /// UI](https://console.cloud.google.com/bigquery/dataform)*. + /// Fetches a single TeamFolder. /// - /// @param parent Required. The location in which to list repositories. Must be in the format - /// `projects/*/locations/*`. + /// @param name Required. The TeamFolder's name. /// @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.dataform.v1.Repository], or rather, - /// the C++ class generated by Protobuf from that type. Please consult the - /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// @return the result of the RPC. The response message type + /// ([google.cloud.dataform.v1.TeamFolder]) + /// 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 @@ -116,41 +105,29 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ListRepositoriesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L718} - /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L566} + /// [google.cloud.dataform.v1.GetTeamFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3778} + /// [google.cloud.dataform.v1.TeamFolder]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3729} /// // clang-format on - StreamRange ListRepositories( - std::string const& parent, Options opts = {}); + StatusOr GetTeamFolder( + std::string const& name, Options opts = {}); // clang-format off /// - /// Lists Repositories in a given project and location. - /// - /// **Note:** *This method can return repositories not shown in the [Dataform - /// UI](https://console.cloud.google.com/bigquery/dataform)*. + /// Fetches a single TeamFolder. /// /// @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.dataform.v1.ListRepositoriesRequest]. + /// [google.cloud.dataform.v1.GetTeamFolderRequest]. /// 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.dataform.v1.Repository], or rather, - /// the C++ class generated by Protobuf from that type. Please consult the - /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// @return the result of the RPC. The response message type + /// ([google.cloud.dataform.v1.TeamFolder]) + /// 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 @@ -158,23 +135,25 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ListRepositoriesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L718} - /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L566} + /// [google.cloud.dataform.v1.GetTeamFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3778} + /// [google.cloud.dataform.v1.TeamFolder]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3729} /// // clang-format on - StreamRange ListRepositories( - google::cloud::dataform::v1::ListRepositoriesRequest request, + StatusOr GetTeamFolder( + google::cloud::dataform::v1::GetTeamFolderRequest const& request, Options opts = {}); // clang-format off /// - /// Fetches a single Repository. + /// Creates a new TeamFolder in a given project and location. /// - /// @param name Required. The repository's name. + /// @param parent Required. The location in which to create the TeamFolder. Must be in the + /// format `projects/*/locations/*`. + /// @param team_folder Required. The TeamFolder to create. /// @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.dataform.v1.Repository]) + /// ([google.cloud.dataform.v1.TeamFolder]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -184,27 +163,29 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.GetRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L764} - /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L566} + /// [google.cloud.dataform.v1.CreateTeamFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3763} + /// [google.cloud.dataform.v1.TeamFolder]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3729} /// // clang-format on - StatusOr GetRepository( - std::string const& name, Options opts = {}); + StatusOr CreateTeamFolder( + std::string const& parent, + google::cloud::dataform::v1::TeamFolder const& team_folder, + Options opts = {}); // clang-format off /// - /// Fetches a single Repository. + /// Creates a new TeamFolder 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.dataform.v1.GetRepositoryRequest]. + /// [google.cloud.dataform.v1.CreateTeamFolderRequest]. /// 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.dataform.v1.Repository]) + /// ([google.cloud.dataform.v1.TeamFolder]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -214,27 +195,25 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.GetRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L764} - /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L566} + /// [google.cloud.dataform.v1.CreateTeamFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3763} + /// [google.cloud.dataform.v1.TeamFolder]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3729} /// // clang-format on - StatusOr GetRepository( - google::cloud::dataform::v1::GetRepositoryRequest const& request, + StatusOr CreateTeamFolder( + google::cloud::dataform::v1::CreateTeamFolderRequest const& request, Options opts = {}); // clang-format off /// - /// Creates a new Repository in a given project and location. + /// Updates a single TeamFolder. /// - /// @param parent Required. The location in which to create the repository. Must be in the - /// format `projects/*/locations/*`. - /// @param repository Required. The repository to create. - /// @param repository_id Required. The ID to use for the repository, which will become the final - /// component of the repository's resource name. + /// @param team_folder Required. The updated TeamFolder. + /// @param update_mask Optional. Specifies the fields to be updated in the Folder. If left unset, + /// all fields will be updated. /// @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.dataform.v1.Repository]) + /// ([google.cloud.dataform.v1.TeamFolder]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -244,29 +223,28 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CreateRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L775} - /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L566} + /// [google.cloud.dataform.v1.TeamFolder]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3729} + /// [google.cloud.dataform.v1.UpdateTeamFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3789} /// // clang-format on - StatusOr CreateRepository( - std::string const& parent, - google::cloud::dataform::v1::Repository const& repository, - std::string const& repository_id, Options opts = {}); + StatusOr UpdateTeamFolder( + google::cloud::dataform::v1::TeamFolder const& team_folder, + google::protobuf::FieldMask const& update_mask, Options opts = {}); // clang-format off /// - /// Creates a new Repository in a given project and location. + /// Updates a single TeamFolder. /// /// @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.dataform.v1.CreateRepositoryRequest]. + /// [google.cloud.dataform.v1.UpdateTeamFolderRequest]. /// 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.dataform.v1.Repository]) + /// ([google.cloud.dataform.v1.TeamFolder]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -276,32 +254,23 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CreateRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L775} - /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L566} + /// [google.cloud.dataform.v1.TeamFolder]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3729} + /// [google.cloud.dataform.v1.UpdateTeamFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3789} /// // clang-format on - StatusOr CreateRepository( - google::cloud::dataform::v1::CreateRepositoryRequest const& request, + StatusOr UpdateTeamFolder( + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request, Options opts = {}); // clang-format off /// - /// Updates a single Repository. - /// - /// **Note:** *This method does not fully implement - /// [AIP/134](https://google.aip.dev/134). The wildcard entry (\*) is treated - /// as a bad request, and when the `field_mask` is omitted, the request is - /// treated as a full update on all modifiable fields.* + /// Deletes a single TeamFolder. /// - /// @param repository Required. The repository to update. - /// @param update_mask Optional. Specifies the fields to be updated in the repository. If left - /// unset, all fields will be updated. + /// @param name Required. The TeamFolder's name. /// @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.dataform.v1.Repository]) - /// is mapped to a C++ class using the [Protobuf mapping rules]. - /// If the request fails, the [`StatusOr`] contains the error details. + /// @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 @@ -309,35 +278,25 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L566} - /// [google.cloud.dataform.v1.UpdateRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L794} + /// [google.cloud.dataform.v1.DeleteTeamFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3800} /// // clang-format on - StatusOr UpdateRepository( - google::cloud::dataform::v1::Repository const& repository, - google::protobuf::FieldMask const& update_mask, Options opts = {}); + Status DeleteTeamFolder(std::string const& name, Options opts = {}); // clang-format off /// - /// Updates a single Repository. - /// - /// **Note:** *This method does not fully implement - /// [AIP/134](https://google.aip.dev/134). The wildcard entry (\*) is treated - /// as a bad request, and when the `field_mask` is omitted, the request is - /// treated as a full update on all modifiable fields.* + /// Deletes a single TeamFolder. /// /// @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.dataform.v1.UpdateRepositoryRequest]. + /// [google.cloud.dataform.v1.DeleteTeamFolderRequest]. /// 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.dataform.v1.Repository]) - /// is mapped to a C++ class using the [Protobuf mapping rules]. - /// If the request fails, the [`StatusOr`] contains the error details. + /// @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 @@ -345,114 +304,158 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L566} - /// [google.cloud.dataform.v1.UpdateRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L794} + /// [google.cloud.dataform.v1.DeleteTeamFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3800} /// // clang-format on - StatusOr UpdateRepository( - google::cloud::dataform::v1::UpdateRepositoryRequest const& request, + Status DeleteTeamFolder( + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request, Options opts = {}); // clang-format off /// - /// Deletes a single Repository. - /// - /// @param name Required. The repository's name. + /// Deletes a TeamFolder with its contents (Folders, Repositories, Workspaces, + /// ReleaseConfigs, and WorkflowConfigs). + /// + /// @param name Required. The TeamFolder's name. + /// Format: projects/{project}/locations/{location}/teamFolders/{team_folder} + /// @param force Optional. If `false` (default): The operation will fail if any + /// Repository within the folder hierarchy has associated Release Configs or + /// Workflow Configs. + /// @n + /// If `true`: The operation will attempt to delete everything, including any + /// Release Configs and Workflow Configs linked to Repositories within the + /// folder hierarchy. This permanently removes schedules and resources. /// @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. + /// @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.dataform.v1.DeleteFolderTreeMetadata] 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.dataform.v1.DeleteRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L805} + /// [google.cloud.dataform.v1.DeleteFolderTreeMetadata]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3563} + /// [google.cloud.dataform.v1.DeleteTeamFolderTreeRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3541} /// // clang-format on - Status DeleteRepository(std::string const& name, Options opts = {}); + future> + DeleteTeamFolderTree(std::string const& name, bool force, Options opts = {}); // clang-format off /// - /// Deletes a single Repository. + /// @copybrief DeleteTeamFolderTree + /// + /// 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 DeleteTeamFolderTree( + NoAwaitTag, std::string const& name, bool force, Options opts = {}); + + // clang-format off + /// + /// Deletes a TeamFolder with its contents (Folders, Repositories, Workspaces, + /// ReleaseConfigs, and WorkflowConfigs). /// /// @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.dataform.v1.DeleteRepositoryRequest]. + /// [google.cloud.dataform.v1.DeleteTeamFolderTreeRequest]. /// 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. + /// @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.dataform.v1.DeleteFolderTreeMetadata] 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.dataform.v1.DeleteRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L805} + /// [google.cloud.dataform.v1.DeleteFolderTreeMetadata]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3563} + /// [google.cloud.dataform.v1.DeleteTeamFolderTreeRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3541} /// // clang-format on - Status DeleteRepository( - google::cloud::dataform::v1::DeleteRepositoryRequest const& request, + future> + DeleteTeamFolderTree( + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request, Options opts = {}); // clang-format off /// - /// Applies a Git commit to a Repository. The Repository must not have a value - /// for `git_remote_settings.url`. + /// @copybrief DeleteTeamFolderTree /// - /// @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.dataform.v1.CommitRepositoryChangesRequest]. - /// 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.dataform.v1.CommitRepositoryChangesResponse]) - /// is mapped to a C++ class using the [Protobuf mapping rules]. - /// If the request fails, the [`StatusOr`] contains the error details. + /// 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. /// - /// [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.dataform.v1.CommitRepositoryChangesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L821} - /// [google.cloud.dataform.v1.CommitRepositoryChangesResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L866} + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr - CommitRepositoryChanges( - google::cloud::dataform::v1::CommitRepositoryChangesRequest const& - request, + StatusOr DeleteTeamFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request, Options opts = {}); // clang-format off /// - /// Returns the contents of a file (inside a Repository). The Repository - /// must not have a value for `git_remote_settings.url`. + /// @copybrief DeleteTeamFolderTree /// - /// @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.dataform.v1.ReadRepositoryFileRequest]. - /// Proto messages are converted to C++ classes by Protobuf, using the - /// [Protobuf mapping rules]. + /// 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> + DeleteTeamFolderTree(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Returns the contents of a given TeamFolder. + /// + /// @param team_folder Required. Name of the team_folder whose contents to list. + /// Format: `projects/*/locations/*/teamFolders/*`. /// @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.dataform.v1.ReadRepositoryFileResponse]) - /// is mapped to a C++ class using the [Protobuf mapping rules]. - /// If the request fails, the [`StatusOr`] contains the error details. + /// @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.dataform.v1.QueryTeamFolderContentsResponse.TeamFolderContentsEntry], 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 @@ -460,24 +463,22 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ReadRepositoryFileRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L872} - /// [google.cloud.dataform.v1.ReadRepositoryFileResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L890} + /// [google.cloud.dataform.v1.QueryTeamFolderContentsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3811} + /// [google.cloud.dataform.v1.QueryTeamFolderContentsResponse.TeamFolderContentsEntry]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3854} /// // clang-format on - StatusOr - ReadRepositoryFile( - google::cloud::dataform::v1::ReadRepositoryFileRequest const& request, - Options opts = {}); + StreamRange + QueryTeamFolderContents(std::string const& team_folder, Options opts = {}); // clang-format off /// - /// Returns the contents of a given Repository directory. The Repository must - /// not have a value for `git_remote_settings.url`. + /// Returns the contents of a given TeamFolder. /// /// @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.dataform.v1.QueryRepositoryDirectoryContentsRequest]. + /// [google.cloud.dataform.v1.QueryTeamFolderContentsRequest]. /// 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 @@ -492,7 +493,7 @@ class DataformClient { /// 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.dataform.v1.DirectoryEntry], or rather, + /// [google.cloud.dataform.v1.QueryTeamFolderContentsResponse.TeamFolderContentsEntry], or rather, /// the C++ class generated by Protobuf from that type. Please consult the /// Protobuf documentation for details on the [Protobuf mapping rules]. /// @@ -502,25 +503,25 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.DirectoryEntry]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1386} - /// [google.cloud.dataform.v1.QueryRepositoryDirectoryContentsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L896} + /// [google.cloud.dataform.v1.QueryTeamFolderContentsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3811} + /// [google.cloud.dataform.v1.QueryTeamFolderContentsResponse.TeamFolderContentsEntry]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3854} /// // clang-format on - StreamRange - QueryRepositoryDirectoryContents( - google::cloud::dataform::v1::QueryRepositoryDirectoryContentsRequest - request, + StreamRange + QueryTeamFolderContents( + google::cloud::dataform::v1::QueryTeamFolderContentsRequest request, Options opts = {}); // clang-format off /// - /// Fetches a Repository's history of commits. The Repository must not have a - /// value for `git_remote_settings.url`. + /// Returns all TeamFolders in a given location that the caller has access to + /// and match the provided filter. /// /// @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.dataform.v1.FetchRepositoryHistoryRequest]. + /// [google.cloud.dataform.v1.SearchTeamFoldersRequest]. /// 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 @@ -535,7 +536,7 @@ class DataformClient { /// 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.dataform.v1.CommitLogEntry], or rather, + /// [google.cloud.dataform.v1.SearchTeamFoldersResponse.TeamFolderSearchResult], or rather, /// the C++ class generated by Protobuf from that type. Please consult the /// Protobuf documentation for details on the [Protobuf mapping rules]. /// @@ -545,29 +546,25 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CommitLogEntry]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L973} - /// [google.cloud.dataform.v1.FetchRepositoryHistoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L939} + /// [google.cloud.dataform.v1.SearchTeamFoldersRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3874} + /// [google.cloud.dataform.v1.SearchTeamFoldersResponse.TeamFolderSearchResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3915} /// // clang-format on - StreamRange - FetchRepositoryHistory( - google::cloud::dataform::v1::FetchRepositoryHistoryRequest request, + StreamRange + SearchTeamFolders( + google::cloud::dataform::v1::SearchTeamFoldersRequest request, Options opts = {}); // clang-format off /// - /// Computes a Repository's Git access token status. + /// Fetches a single Folder. /// - /// @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.dataform.v1.ComputeRepositoryAccessTokenStatusRequest]. - /// Proto messages are converted to C++ classes by Protobuf, using the - /// [Protobuf mapping rules]. + /// @param name Required. The Folder's name. /// @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.dataform.v1.ComputeRepositoryAccessTokenStatusResponse]) + /// ([google.cloud.dataform.v1.Folder]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -577,31 +574,27 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L997} - /// [google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1008} + /// [google.cloud.dataform.v1.Folder]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3413} + /// [google.cloud.dataform.v1.GetFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3491} /// // clang-format on - StatusOr< - google::cloud::dataform::v1::ComputeRepositoryAccessTokenStatusResponse> - ComputeRepositoryAccessTokenStatus( - google::cloud::dataform::v1:: - ComputeRepositoryAccessTokenStatusRequest const& request, - Options opts = {}); + StatusOr GetFolder( + std::string const& name, Options opts = {}); // clang-format off /// - /// Fetches a Repository's remote branches. + /// Fetches a single Folder. /// /// @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.dataform.v1.FetchRemoteBranchesRequest]. + /// [google.cloud.dataform.v1.GetFolderRequest]. /// 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.dataform.v1.FetchRemoteBranchesResponse]) + /// ([google.cloud.dataform.v1.Folder]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -611,36 +604,27 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.FetchRemoteBranchesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1030} - /// [google.cloud.dataform.v1.FetchRemoteBranchesResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1041} + /// [google.cloud.dataform.v1.Folder]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3413} + /// [google.cloud.dataform.v1.GetFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3491} /// // clang-format on - StatusOr - FetchRemoteBranches( - google::cloud::dataform::v1::FetchRemoteBranchesRequest const& request, + StatusOr GetFolder( + google::cloud::dataform::v1::GetFolderRequest const& request, Options opts = {}); // clang-format off /// - /// Lists Workspaces in a given Repository. + /// Creates a new Folder in a given project and location. /// - /// @param parent Required. The repository in which to list workspaces. Must be in the - /// format `projects/*/locations/*/repositories/*`. + /// @param parent Required. The location in which to create the Folder. Must be in the format + /// `projects/*/locations/*`. + /// @param folder Required. The Folder to create. /// @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.dataform.v1.Workspace], or rather, - /// the C++ class generated by Protobuf from that type. Please consult the - /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// @return the result of the RPC. The response message type + /// ([google.cloud.dataform.v1.Folder]) + /// 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 @@ -648,32 +632,1265 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ListWorkspacesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1075} - /// [google.cloud.dataform.v1.Workspace]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1047} + /// [google.cloud.dataform.v1.CreateFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3461} + /// [google.cloud.dataform.v1.Folder]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3413} /// // clang-format on - StreamRange ListWorkspaces( - std::string const& parent, Options opts = {}); + StatusOr CreateFolder( + std::string const& parent, + google::cloud::dataform::v1::Folder const& folder, Options opts = {}); // clang-format off /// - /// Lists Workspaces in a given Repository. + /// Creates a new Folder 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.dataform.v1.ListWorkspacesRequest]. + /// [google.cloud.dataform.v1.CreateFolderRequest]. /// 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. + /// @return the result of the RPC. The response message type + /// ([google.cloud.dataform.v1.Folder]) + /// 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.dataform.v1.CreateFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3461} + /// [google.cloud.dataform.v1.Folder]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3413} + /// + // clang-format on + StatusOr CreateFolder( + google::cloud::dataform::v1::CreateFolderRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates a single Folder. + /// + /// @param folder Required. The updated Folder. + /// @param update_mask Optional. Specifies the fields to be updated in the Folder. If left unset, + /// all fields that can be updated, will be updated. A few fields cannot be + /// updated and will be ignored if specified in the update_mask (e.g. + /// parent_name, team_folder_name). + /// @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.dataform.v1.Folder]) + /// 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.dataform.v1.Folder]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3413} + /// [google.cloud.dataform.v1.UpdateFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3500} + /// + // clang-format on + StatusOr UpdateFolder( + google::cloud::dataform::v1::Folder const& folder, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a single Folder. + /// + /// @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.dataform.v1.UpdateFolderRequest]. + /// 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.dataform.v1.Folder]) + /// 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.dataform.v1.Folder]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3413} + /// [google.cloud.dataform.v1.UpdateFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3500} + /// + // clang-format on + StatusOr UpdateFolder( + google::cloud::dataform::v1::UpdateFolderRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single Folder. + /// + /// @param name Required. The Folder's name. + /// @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.cloud.dataform.v1.DeleteFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3513} + /// + // clang-format on + Status DeleteFolder(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Folder. + /// + /// @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.dataform.v1.DeleteFolderRequest]. + /// 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.cloud.dataform.v1.DeleteFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3513} + /// + // clang-format on + Status DeleteFolder( + google::cloud::dataform::v1::DeleteFolderRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes a Folder with its contents (Folders, Repositories, Workspaces, + /// ReleaseConfigs, and WorkflowConfigs). + /// + /// @param name Required. The Folder's name. + /// Format: projects/{project}/locations/{location}/folders/{folder} + /// @param force Optional. If `false` (default): The operation will fail if any + /// Repository within the folder hierarchy has associated Release Configs or + /// Workflow Configs. + /// @n + /// If `true`: The operation will attempt to delete everything, including any + /// Release Configs and Workflow Configs linked to Repositories within the + /// folder hierarchy. This permanently removes schedules and resources. + /// @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.dataform.v1.DeleteFolderTreeMetadata] 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.dataform.v1.DeleteFolderTreeMetadata]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3563} + /// [google.cloud.dataform.v1.DeleteFolderTreeRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3522} + /// + // clang-format on + future> + DeleteFolderTree(std::string const& name, bool force, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteFolderTree + /// + /// 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 DeleteFolderTree( + NoAwaitTag, std::string const& name, bool force, Options opts = {}); + + // clang-format off + /// + /// Deletes a Folder with its contents (Folders, Repositories, Workspaces, + /// ReleaseConfigs, and WorkflowConfigs). + /// + /// @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.dataform.v1.DeleteFolderTreeRequest]. + /// 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.dataform.v1.DeleteFolderTreeMetadata] 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.dataform.v1.DeleteFolderTreeMetadata]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3563} + /// [google.cloud.dataform.v1.DeleteFolderTreeRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3522} + /// + // clang-format on + future> + DeleteFolderTree( + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteFolderTree + /// + /// 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 DeleteFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteFolderTree + /// + /// 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> + DeleteFolderTree(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Returns the contents of a given Folder. + /// + /// @param folder Required. Name of the folder whose contents to list. + /// Format: projects/*/locations/*/folders/* + /// @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.dataform.v1.QueryFolderContentsResponse.FolderContentsEntry], 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.dataform.v1.QueryFolderContentsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3604} + /// [google.cloud.dataform.v1.QueryFolderContentsResponse.FolderContentsEntry]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3645} + /// + // clang-format on + StreamRange + QueryFolderContents(std::string const& folder, Options opts = {}); + + // clang-format off + /// + /// Returns the contents of a given Folder. + /// + /// @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.dataform.v1.QueryFolderContentsRequest]. + /// 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.dataform.v1.QueryFolderContentsResponse.FolderContentsEntry], 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.dataform.v1.QueryFolderContentsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3604} + /// [google.cloud.dataform.v1.QueryFolderContentsResponse.FolderContentsEntry]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3645} + /// + // clang-format on + StreamRange + QueryFolderContents( + google::cloud::dataform::v1::QueryFolderContentsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Returns the contents of a caller's root folder in a given location. + /// The root folder contains all resources that are created by the user and not + /// contained in any other folder. + /// + /// @param location Required. Location of the user root folder whose contents to list. + /// Format: projects/*/locations/* + /// @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.dataform.v1.QueryUserRootContentsResponse.RootContentsEntry], 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.dataform.v1.QueryUserRootContentsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3665} + /// [google.cloud.dataform.v1.QueryUserRootContentsResponse.RootContentsEntry]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3707} + /// + // clang-format on + StreamRange + QueryUserRootContents(std::string const& location, Options opts = {}); + + // clang-format off + /// + /// Returns the contents of a caller's root folder in a given location. + /// The root folder contains all resources that are created by the user and not + /// contained in any other folder. + /// + /// @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.dataform.v1.QueryUserRootContentsRequest]. + /// 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.dataform.v1.QueryUserRootContentsResponse.RootContentsEntry], 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.dataform.v1.QueryUserRootContentsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3665} + /// [google.cloud.dataform.v1.QueryUserRootContentsResponse.RootContentsEntry]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3707} + /// + // clang-format on + StreamRange + QueryUserRootContents( + google::cloud::dataform::v1::QueryUserRootContentsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Moves a Folder to a new Folder, TeamFolder, or the root location. + /// + /// @param name Required. The full resource name of the Folder to move. + /// @param destination_containing_folder Optional. The name of the Folder, TeamFolder, or root location to move the + /// Folder to. Can be in the format of: "" to move into the root User folder, + /// `projects/*/locations/*/folders/*`, `projects/*/locations/*/teamFolders/*` + /// @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.dataform.v1.MoveFolderMetadata] 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.dataform.v1.MoveFolderMetadata]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3933} + /// [google.cloud.dataform.v1.MoveFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3476} + /// + // clang-format on + future> MoveFolder( + std::string const& name, std::string const& destination_containing_folder, + Options opts = {}); + + // clang-format off + /// + /// @copybrief MoveFolder + /// + /// 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 MoveFolder( + NoAwaitTag, std::string const& name, + std::string const& destination_containing_folder, Options opts = {}); + + // clang-format off + /// + /// Moves a Folder to a new Folder, TeamFolder, or the root 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.dataform.v1.MoveFolderRequest]. + /// 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.dataform.v1.MoveFolderMetadata] 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.dataform.v1.MoveFolderMetadata]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3933} + /// [google.cloud.dataform.v1.MoveFolderRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3476} + /// + // clang-format on + future> MoveFolder( + google::cloud::dataform::v1::MoveFolderRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief MoveFolder + /// + /// 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 MoveFolder( + NoAwaitTag, google::cloud::dataform::v1::MoveFolderRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief MoveFolder + /// + /// 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> MoveFolder( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Lists Repositories in a given project and location. + /// + /// **Note:** *This method can return repositories not shown in the [Dataform + /// UI](https://console.cloud.google.com/bigquery/dataform)*. + /// + /// @param parent Required. The location in which to list repositories. Must be in the format + /// `projects/*/locations/*`. + /// @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.dataform.v1.Repository], 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.dataform.v1.ListRepositoriesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L991} + /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L817} + /// + // clang-format on + StreamRange ListRepositories( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Repositories in a given project and location. + /// + /// **Note:** *This method can return repositories not shown in the [Dataform + /// UI](https://console.cloud.google.com/bigquery/dataform)*. + /// + /// @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.dataform.v1.ListRepositoriesRequest]. + /// 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.dataform.v1.Repository], 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.dataform.v1.ListRepositoriesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L991} + /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L817} + /// + // clang-format on + StreamRange ListRepositories( + google::cloud::dataform::v1::ListRepositoriesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Fetches a single Repository. + /// + /// @param name Required. The repository's name. + /// @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.dataform.v1.Repository]) + /// 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.dataform.v1.GetRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1055} + /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L817} + /// + // clang-format on + StatusOr GetRepository( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Fetches a single Repository. + /// + /// @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.dataform.v1.GetRepositoryRequest]. + /// 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.dataform.v1.Repository]) + /// 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.dataform.v1.GetRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1055} + /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L817} + /// + // clang-format on + StatusOr GetRepository( + google::cloud::dataform::v1::GetRepositoryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Repository in a given project and location. + /// + /// @param parent Required. The location in which to create the repository. Must be in the + /// format `projects/*/locations/*`. + /// @param repository Required. The repository to create. + /// @param repository_id Required. The ID to use for the repository, which will become the final + /// component of the repository's resource name. + /// @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.dataform.v1.Repository]) + /// 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.dataform.v1.CreateRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1066} + /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L817} + /// + // clang-format on + StatusOr CreateRepository( + std::string const& parent, + google::cloud::dataform::v1::Repository const& repository, + std::string const& repository_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Repository 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.dataform.v1.CreateRepositoryRequest]. + /// 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.dataform.v1.Repository]) + /// 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.dataform.v1.CreateRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1066} + /// [google.cloud.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L817} + /// + // clang-format on + StatusOr CreateRepository( + google::cloud::dataform::v1::CreateRepositoryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates a single Repository. + /// + /// **Note:** *This method does not fully implement + /// [AIP/134](https://google.aip.dev/134). The wildcard entry (\*) is treated + /// as a bad request, and when the `field_mask` is omitted, the request is + /// treated as a full update on all modifiable fields.* + /// + /// @param repository Required. The repository to update. + /// @param update_mask Optional. Specifies the fields to be updated in the repository. If left + /// unset, all fields will be updated. + /// @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.dataform.v1.Repository]) + /// 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.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L817} + /// [google.cloud.dataform.v1.UpdateRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1085} + /// + // clang-format on + StatusOr UpdateRepository( + google::cloud::dataform::v1::Repository const& repository, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a single Repository. + /// + /// **Note:** *This method does not fully implement + /// [AIP/134](https://google.aip.dev/134). The wildcard entry (\*) is treated + /// as a bad request, and when the `field_mask` is omitted, the request is + /// treated as a full update on all modifiable fields.* + /// + /// @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.dataform.v1.UpdateRepositoryRequest]. + /// 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.dataform.v1.Repository]) + /// 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.dataform.v1.Repository]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L817} + /// [google.cloud.dataform.v1.UpdateRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1085} + /// + // clang-format on + StatusOr UpdateRepository( + google::cloud::dataform::v1::UpdateRepositoryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single Repository. + /// + /// @param name Required. The repository's name. + /// @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.cloud.dataform.v1.DeleteRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1096} + /// + // clang-format on + Status DeleteRepository(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Repository. + /// + /// @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.dataform.v1.DeleteRepositoryRequest]. + /// 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.cloud.dataform.v1.DeleteRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1096} + /// + // clang-format on + Status DeleteRepository( + google::cloud::dataform::v1::DeleteRepositoryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Moves a Repository to a new location. + /// + /// @param name Required. The full resource name of the repository to move. + /// @param destination_containing_folder Optional. The name of the Folder, TeamFolder, or root location to move the + /// repository to. Can be in the format of: "" to move into the root User + /// folder, `projects/*/locations/*/folders/*`, + /// `projects/*/locations/*/teamFolders/*` + /// @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.dataform.v1.MoveRepositoryMetadata] 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.dataform.v1.MoveRepositoryMetadata]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3972} + /// [google.cloud.dataform.v1.MoveRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1037} + /// + // clang-format on + future> + MoveRepository(std::string const& name, + std::string const& destination_containing_folder, + Options opts = {}); + + // clang-format off + /// + /// @copybrief MoveRepository + /// + /// 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 MoveRepository( + NoAwaitTag, std::string const& name, + std::string const& destination_containing_folder, Options opts = {}); + + // clang-format off + /// + /// Moves a Repository to a new 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.dataform.v1.MoveRepositoryRequest]. + /// 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.dataform.v1.MoveRepositoryMetadata] 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.dataform.v1.MoveRepositoryMetadata]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3972} + /// [google.cloud.dataform.v1.MoveRepositoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1037} + /// + // clang-format on + future> + MoveRepository( + google::cloud::dataform::v1::MoveRepositoryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief MoveRepository + /// + /// 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 MoveRepository( + NoAwaitTag, + google::cloud::dataform::v1::MoveRepositoryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief MoveRepository + /// + /// 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> + MoveRepository(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Applies a Git commit to a Repository. The Repository must not have a value + /// for `git_remote_settings.url`. + /// + /// @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.dataform.v1.CommitRepositoryChangesRequest]. + /// 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.dataform.v1.CommitRepositoryChangesResponse]) + /// 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.dataform.v1.CommitRepositoryChangesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1116} + /// [google.cloud.dataform.v1.CommitRepositoryChangesResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1161} + /// + // clang-format on + StatusOr + CommitRepositoryChanges( + google::cloud::dataform::v1::CommitRepositoryChangesRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Returns the contents of a file (inside a Repository). The Repository + /// must not have a value for `git_remote_settings.url`. + /// + /// @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.dataform.v1.ReadRepositoryFileRequest]. + /// 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.dataform.v1.ReadRepositoryFileResponse]) + /// 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.dataform.v1.ReadRepositoryFileRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1167} + /// [google.cloud.dataform.v1.ReadRepositoryFileResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1185} + /// + // clang-format on + StatusOr + ReadRepositoryFile( + google::cloud::dataform::v1::ReadRepositoryFileRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Returns the contents of a given Repository directory. The Repository must + /// not have a value for `git_remote_settings.url`. + /// + /// @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.dataform.v1.QueryRepositoryDirectoryContentsRequest]. + /// 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.dataform.v1.DirectoryEntry], 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.dataform.v1.DirectoryEntry]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1699} + /// [google.cloud.dataform.v1.QueryRepositoryDirectoryContentsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1191} + /// + // clang-format on + StreamRange + QueryRepositoryDirectoryContents( + google::cloud::dataform::v1::QueryRepositoryDirectoryContentsRequest + request, + Options opts = {}); + + // clang-format off + /// + /// Fetches a Repository's history of commits. The Repository must not have a + /// value for `git_remote_settings.url`. + /// + /// @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.dataform.v1.FetchRepositoryHistoryRequest]. + /// 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.dataform.v1.CommitLogEntry], 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.dataform.v1.CommitLogEntry]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1268} + /// [google.cloud.dataform.v1.FetchRepositoryHistoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1234} + /// + // clang-format on + StreamRange + FetchRepositoryHistory( + google::cloud::dataform::v1::FetchRepositoryHistoryRequest request, + Options opts = {}); + + // clang-format off + /// + /// Computes a Repository's Git access token status. + /// + /// @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.dataform.v1.ComputeRepositoryAccessTokenStatusRequest]. + /// 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.dataform.v1.ComputeRepositoryAccessTokenStatusResponse]) + /// 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.dataform.v1.ComputeRepositoryAccessTokenStatusRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1292} + /// [google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1303} + /// + // clang-format on + StatusOr< + google::cloud::dataform::v1::ComputeRepositoryAccessTokenStatusResponse> + ComputeRepositoryAccessTokenStatus( + google::cloud::dataform::v1:: + ComputeRepositoryAccessTokenStatusRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Fetches a Repository's remote branches. + /// + /// @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.dataform.v1.FetchRemoteBranchesRequest]. + /// 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.dataform.v1.FetchRemoteBranchesResponse]) + /// 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.dataform.v1.FetchRemoteBranchesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1328} + /// [google.cloud.dataform.v1.FetchRemoteBranchesResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1339} + /// + // clang-format on + StatusOr + FetchRemoteBranches( + google::cloud::dataform::v1::FetchRemoteBranchesRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists Workspaces in a given Repository. + /// + /// @param parent Required. The repository in which to list workspaces. Must be in the + /// format `projects/*/locations/*/repositories/*`. + /// @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.dataform.v1.Workspace], 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.dataform.v1.ListWorkspacesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1382} + /// [google.cloud.dataform.v1.Workspace]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1345} + /// + // clang-format on + StreamRange ListWorkspaces( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Workspaces in a given Repository. + /// + /// @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.dataform.v1.ListWorkspacesRequest]. + /// 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 @@ -687,8 +1904,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ListWorkspacesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1075} - /// [google.cloud.dataform.v1.Workspace]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1047} + /// [google.cloud.dataform.v1.ListWorkspacesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1382} + /// [google.cloud.dataform.v1.Workspace]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1345} /// // clang-format on StreamRange ListWorkspaces( @@ -713,8 +1930,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.GetWorkspaceRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1121} - /// [google.cloud.dataform.v1.Workspace]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1047} + /// [google.cloud.dataform.v1.GetWorkspaceRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1428} + /// [google.cloud.dataform.v1.Workspace]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1345} /// // clang-format on StatusOr GetWorkspace( @@ -743,8 +1960,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.GetWorkspaceRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1121} - /// [google.cloud.dataform.v1.Workspace]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1047} + /// [google.cloud.dataform.v1.GetWorkspaceRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1428} + /// [google.cloud.dataform.v1.Workspace]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1345} /// // clang-format on StatusOr GetWorkspace( @@ -773,8 +1990,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CreateWorkspaceRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1132} - /// [google.cloud.dataform.v1.Workspace]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1047} + /// [google.cloud.dataform.v1.CreateWorkspaceRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1439} + /// [google.cloud.dataform.v1.Workspace]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1345} /// // clang-format on StatusOr CreateWorkspace( @@ -805,8 +2022,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CreateWorkspaceRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1132} - /// [google.cloud.dataform.v1.Workspace]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1047} + /// [google.cloud.dataform.v1.CreateWorkspaceRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1439} + /// [google.cloud.dataform.v1.Workspace]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1345} /// // clang-format on StatusOr CreateWorkspace( @@ -829,7 +2046,7 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.DeleteWorkspaceRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1151} + /// [google.cloud.dataform.v1.DeleteWorkspaceRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1458} /// // clang-format on Status DeleteWorkspace(std::string const& name, Options opts = {}); @@ -855,7 +2072,7 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.DeleteWorkspaceRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1151} + /// [google.cloud.dataform.v1.DeleteWorkspaceRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1458} /// // clang-format on Status DeleteWorkspace( @@ -885,8 +2102,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.InstallNpmPackagesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1604} - /// [google.cloud.dataform.v1.InstallNpmPackagesResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1615} + /// [google.cloud.dataform.v1.InstallNpmPackagesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1931} + /// [google.cloud.dataform.v1.InstallNpmPackagesResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1942} /// // clang-format on StatusOr @@ -917,8 +2134,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.PullGitCommitsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1171} - /// [google.cloud.dataform.v1.PullGitCommitsResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1190} + /// [google.cloud.dataform.v1.PullGitCommitsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1478} + /// [google.cloud.dataform.v1.PullGitCommitsResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1497} /// // clang-format on StatusOr PullGitCommits( @@ -948,8 +2165,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.PushGitCommitsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1193} - /// [google.cloud.dataform.v1.PushGitCommitsResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1209} + /// [google.cloud.dataform.v1.PushGitCommitsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1500} + /// [google.cloud.dataform.v1.PushGitCommitsResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1516} /// // clang-format on StatusOr PushGitCommits( @@ -979,8 +2196,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.FetchFileGitStatusesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1212} - /// [google.cloud.dataform.v1.FetchFileGitStatusesResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1223} + /// [google.cloud.dataform.v1.FetchFileGitStatusesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1519} + /// [google.cloud.dataform.v1.FetchFileGitStatusesResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1530} /// // clang-format on StatusOr @@ -1011,8 +2228,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.FetchGitAheadBehindRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1257} - /// [google.cloud.dataform.v1.FetchGitAheadBehindResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1273} + /// [google.cloud.dataform.v1.FetchGitAheadBehindRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1564} + /// [google.cloud.dataform.v1.FetchGitAheadBehindResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1580} /// // clang-format on StatusOr @@ -1043,8 +2260,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CommitWorkspaceChangesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1282} - /// [google.cloud.dataform.v1.CommitWorkspaceChangesResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1303} + /// [google.cloud.dataform.v1.CommitWorkspaceChangesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1589} + /// [google.cloud.dataform.v1.CommitWorkspaceChangesResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1610} /// // clang-format on StatusOr @@ -1075,8 +2292,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ResetWorkspaceChangesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1306} - /// [google.cloud.dataform.v1.ResetWorkspaceChangesResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1324} + /// [google.cloud.dataform.v1.ResetWorkspaceChangesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1613} + /// [google.cloud.dataform.v1.ResetWorkspaceChangesResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1631} /// // clang-format on StatusOr @@ -1107,8 +2324,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.FetchFileDiffRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1327} - /// [google.cloud.dataform.v1.FetchFileDiffResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1342} + /// [google.cloud.dataform.v1.FetchFileDiffRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1634} + /// [google.cloud.dataform.v1.FetchFileDiffResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1649} /// // clang-format on StatusOr FetchFileDiff( @@ -1147,8 +2364,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.DirectoryEntry]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1386} - /// [google.cloud.dataform.v1.QueryDirectoryContentsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1348} + /// [google.cloud.dataform.v1.DirectoryEntry]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1699} + /// [google.cloud.dataform.v1.QueryDirectoryContentsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1655} /// // clang-format on StreamRange @@ -1188,8 +2405,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.SearchFilesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1398} - /// [google.cloud.dataform.v1.SearchResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1437} + /// [google.cloud.dataform.v1.SearchFilesRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1725} + /// [google.cloud.dataform.v1.SearchResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1764} /// // clang-format on StreamRange SearchFiles( @@ -1219,8 +2436,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.MakeDirectoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1461} - /// [google.cloud.dataform.v1.MakeDirectoryResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1476} + /// [google.cloud.dataform.v1.MakeDirectoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1788} + /// [google.cloud.dataform.v1.MakeDirectoryResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1803} /// // clang-format on StatusOr MakeDirectory( @@ -1250,8 +2467,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.RemoveDirectoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1479} - /// [google.cloud.dataform.v1.RemoveDirectoryResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1494} + /// [google.cloud.dataform.v1.RemoveDirectoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1806} + /// [google.cloud.dataform.v1.RemoveDirectoryResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1821} /// // clang-format on StatusOr @@ -1283,8 +2500,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.MoveDirectoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1497} - /// [google.cloud.dataform.v1.MoveDirectoryResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1516} + /// [google.cloud.dataform.v1.MoveDirectoryRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1824} + /// [google.cloud.dataform.v1.MoveDirectoryResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1843} /// // clang-format on StatusOr MoveDirectory( @@ -1314,8 +2531,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ReadFileRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1519} - /// [google.cloud.dataform.v1.ReadFileResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1538} + /// [google.cloud.dataform.v1.ReadFileRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1846} + /// [google.cloud.dataform.v1.ReadFileResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1865} /// // clang-format on StatusOr ReadFile( @@ -1345,8 +2562,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.RemoveFileRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1544} - /// [google.cloud.dataform.v1.RemoveFileResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1559} + /// [google.cloud.dataform.v1.RemoveFileRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1871} + /// [google.cloud.dataform.v1.RemoveFileResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1886} /// // clang-format on StatusOr RemoveFile( @@ -1376,8 +2593,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.MoveFileRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1562} - /// [google.cloud.dataform.v1.MoveFileResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1581} + /// [google.cloud.dataform.v1.MoveFileRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1889} + /// [google.cloud.dataform.v1.MoveFileResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1908} /// // clang-format on StatusOr MoveFile( @@ -1407,8 +2624,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.WriteFileRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1584} - /// [google.cloud.dataform.v1.WriteFileResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1601} + /// [google.cloud.dataform.v1.WriteFileRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1911} + /// [google.cloud.dataform.v1.WriteFileResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1928} /// // clang-format on StatusOr WriteFile( @@ -1443,8 +2660,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ListReleaseConfigsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1704} - /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1618} + /// [google.cloud.dataform.v1.ListReleaseConfigsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2031} + /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1945} /// // clang-format on StreamRange ListReleaseConfigs( @@ -1482,8 +2699,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ListReleaseConfigsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1704} - /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1618} + /// [google.cloud.dataform.v1.ListReleaseConfigsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2031} + /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1945} /// // clang-format on StreamRange ListReleaseConfigs( @@ -1508,8 +2725,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.GetReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1742} - /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1618} + /// [google.cloud.dataform.v1.GetReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2069} + /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1945} /// // clang-format on StatusOr GetReleaseConfig( @@ -1538,8 +2755,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.GetReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1742} - /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1618} + /// [google.cloud.dataform.v1.GetReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2069} + /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1945} /// // clang-format on StatusOr GetReleaseConfig( @@ -1568,8 +2785,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CreateReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1753} - /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1618} + /// [google.cloud.dataform.v1.CreateReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2080} + /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1945} /// // clang-format on StatusOr CreateReleaseConfig( @@ -1600,8 +2817,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CreateReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1753} - /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1618} + /// [google.cloud.dataform.v1.CreateReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2080} + /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1945} /// // clang-format on StatusOr CreateReleaseConfig( @@ -1633,8 +2850,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1618} - /// [google.cloud.dataform.v1.UpdateReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1772} + /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1945} + /// [google.cloud.dataform.v1.UpdateReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2099} /// // clang-format on StatusOr UpdateReleaseConfig( @@ -1669,8 +2886,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1618} - /// [google.cloud.dataform.v1.UpdateReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1772} + /// [google.cloud.dataform.v1.ReleaseConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1945} + /// [google.cloud.dataform.v1.UpdateReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2099} /// // clang-format on StatusOr UpdateReleaseConfig( @@ -1693,7 +2910,7 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.DeleteReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1783} + /// [google.cloud.dataform.v1.DeleteReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2110} /// // clang-format on Status DeleteReleaseConfig(std::string const& name, Options opts = {}); @@ -1719,7 +2936,7 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.DeleteReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1783} + /// [google.cloud.dataform.v1.DeleteReleaseConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2110} /// // clang-format on Status DeleteReleaseConfig( @@ -1754,8 +2971,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CompilationResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1794} - /// [google.cloud.dataform.v1.ListCompilationResultsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1944} + /// [google.cloud.dataform.v1.CompilationResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2121} + /// [google.cloud.dataform.v1.ListCompilationResultsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2277} /// // clang-format on StreamRange @@ -1793,8 +3010,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CompilationResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1794} - /// [google.cloud.dataform.v1.ListCompilationResultsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1944} + /// [google.cloud.dataform.v1.CompilationResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2121} + /// [google.cloud.dataform.v1.ListCompilationResultsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2277} /// // clang-format on StreamRange @@ -1820,8 +3037,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CompilationResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1794} - /// [google.cloud.dataform.v1.GetCompilationResultRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1990} + /// [google.cloud.dataform.v1.CompilationResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2121} + /// [google.cloud.dataform.v1.GetCompilationResultRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2323} /// // clang-format on StatusOr GetCompilationResult( @@ -1850,8 +3067,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CompilationResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1794} - /// [google.cloud.dataform.v1.GetCompilationResultRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1990} + /// [google.cloud.dataform.v1.CompilationResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2121} + /// [google.cloud.dataform.v1.GetCompilationResultRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2323} /// // clang-format on StatusOr GetCompilationResult( @@ -1878,8 +3095,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CompilationResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1794} - /// [google.cloud.dataform.v1.CreateCompilationResultRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2001} + /// [google.cloud.dataform.v1.CompilationResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2121} + /// [google.cloud.dataform.v1.CreateCompilationResultRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2334} /// // clang-format on StatusOr @@ -1911,8 +3128,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CompilationResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L1794} - /// [google.cloud.dataform.v1.CreateCompilationResultRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2001} + /// [google.cloud.dataform.v1.CompilationResult]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2121} + /// [google.cloud.dataform.v1.CreateCompilationResultRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2334} /// // clang-format on StatusOr @@ -1953,8 +3170,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CompilationResultAction]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2055} - /// [google.cloud.dataform.v1.QueryCompilationResultActionsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2339} + /// [google.cloud.dataform.v1.CompilationResultAction]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2388} + /// [google.cloud.dataform.v1.QueryCompilationResultActionsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2708} /// // clang-format on StreamRange @@ -1990,8 +3207,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ListWorkflowConfigsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2488} - /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2378} + /// [google.cloud.dataform.v1.ListWorkflowConfigsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2879} + /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2747} /// // clang-format on StreamRange ListWorkflowConfigs( @@ -2029,8 +3246,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ListWorkflowConfigsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2488} - /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2378} + /// [google.cloud.dataform.v1.ListWorkflowConfigsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2879} + /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2747} /// // clang-format on StreamRange ListWorkflowConfigs( @@ -2055,8 +3272,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.GetWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2526} - /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2378} + /// [google.cloud.dataform.v1.GetWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2917} + /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2747} /// // clang-format on StatusOr GetWorkflowConfig( @@ -2085,8 +3302,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.GetWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2526} - /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2378} + /// [google.cloud.dataform.v1.GetWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2917} + /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2747} /// // clang-format on StatusOr GetWorkflowConfig( @@ -2115,8 +3332,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CreateWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2537} - /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2378} + /// [google.cloud.dataform.v1.CreateWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2928} + /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2747} /// // clang-format on StatusOr CreateWorkflowConfig( @@ -2147,8 +3364,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CreateWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2537} - /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2378} + /// [google.cloud.dataform.v1.CreateWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2928} + /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2747} /// // clang-format on StatusOr CreateWorkflowConfig( @@ -2180,8 +3397,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.UpdateWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2556} - /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2378} + /// [google.cloud.dataform.v1.UpdateWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2947} + /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2747} /// // clang-format on StatusOr UpdateWorkflowConfig( @@ -2216,8 +3433,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.UpdateWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2556} - /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2378} + /// [google.cloud.dataform.v1.UpdateWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2947} + /// [google.cloud.dataform.v1.WorkflowConfig]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2747} /// // clang-format on StatusOr UpdateWorkflowConfig( @@ -2240,7 +3457,7 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.DeleteWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2567} + /// [google.cloud.dataform.v1.DeleteWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2958} /// // clang-format on Status DeleteWorkflowConfig(std::string const& name, Options opts = {}); @@ -2266,7 +3483,7 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.DeleteWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2567} + /// [google.cloud.dataform.v1.DeleteWorkflowConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2958} /// // clang-format on Status DeleteWorkflowConfig( @@ -2301,8 +3518,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ListWorkflowInvocationsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2666} - /// [google.cloud.dataform.v1.WorkflowInvocation]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2578} + /// [google.cloud.dataform.v1.ListWorkflowInvocationsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3063} + /// [google.cloud.dataform.v1.WorkflowInvocation]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2969} /// // clang-format on StreamRange @@ -2340,8 +3557,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.ListWorkflowInvocationsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2666} - /// [google.cloud.dataform.v1.WorkflowInvocation]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2578} + /// [google.cloud.dataform.v1.ListWorkflowInvocationsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3063} + /// [google.cloud.dataform.v1.WorkflowInvocation]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2969} /// // clang-format on StreamRange @@ -2367,8 +3584,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.GetWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2712} - /// [google.cloud.dataform.v1.WorkflowInvocation]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2578} + /// [google.cloud.dataform.v1.GetWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3109} + /// [google.cloud.dataform.v1.WorkflowInvocation]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2969} /// // clang-format on StatusOr @@ -2397,8 +3614,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.GetWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2712} - /// [google.cloud.dataform.v1.WorkflowInvocation]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2578} + /// [google.cloud.dataform.v1.GetWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3109} + /// [google.cloud.dataform.v1.WorkflowInvocation]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2969} /// // clang-format on StatusOr @@ -2426,8 +3643,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CreateWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2723} - /// [google.cloud.dataform.v1.WorkflowInvocation]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2578} + /// [google.cloud.dataform.v1.CreateWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3120} + /// [google.cloud.dataform.v1.WorkflowInvocation]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2969} /// // clang-format on StatusOr @@ -2460,8 +3677,8 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CreateWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2723} - /// [google.cloud.dataform.v1.WorkflowInvocation]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2578} + /// [google.cloud.dataform.v1.CreateWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3120} + /// [google.cloud.dataform.v1.WorkflowInvocation]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2969} /// // clang-format on StatusOr @@ -2486,7 +3703,7 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.DeleteWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2739} + /// [google.cloud.dataform.v1.DeleteWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3136} /// // clang-format on Status DeleteWorkflowInvocation(std::string const& name, Options opts = {}); @@ -2512,7 +3729,7 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.DeleteWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2739} + /// [google.cloud.dataform.v1.DeleteWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3136} /// // clang-format on Status DeleteWorkflowInvocation( @@ -2543,41 +3760,167 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.CancelWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2750} - /// [google.cloud.dataform.v1.CancelWorkflowInvocationResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2761} + /// [google.cloud.dataform.v1.CancelWorkflowInvocationRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3147} + /// [google.cloud.dataform.v1.CancelWorkflowInvocationResponse]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3158} + /// + // clang-format on + StatusOr + CancelWorkflowInvocation( + google::cloud::dataform::v1::CancelWorkflowInvocationRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Returns WorkflowInvocationActions in a given WorkflowInvocation. + /// + /// @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.dataform.v1.QueryWorkflowInvocationActionsRequest]. + /// 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.dataform.v1.WorkflowInvocationAction], 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.dataform.v1.QueryWorkflowInvocationActionsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3330} + /// [google.cloud.dataform.v1.WorkflowInvocationAction]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3161} + /// + // clang-format on + StreamRange + QueryWorkflowInvocationActions( + google::cloud::dataform::v1::QueryWorkflowInvocationActionsRequest + request, + Options opts = {}); + + // clang-format off + /// + /// Get default config for a given project and location. + /// + /// @param name Required. The config name. + /// @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.dataform.v1.Config]) + /// 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.dataform.v1.Config]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3365} + /// [google.cloud.dataform.v1.GetConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3393} + /// + // clang-format on + StatusOr GetConfig( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Get default config for 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.dataform.v1.GetConfigRequest]. + /// 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.dataform.v1.Config]) + /// 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.dataform.v1.Config]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3365} + /// [google.cloud.dataform.v1.GetConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3393} + /// + // clang-format on + StatusOr GetConfig( + google::cloud::dataform::v1::GetConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Update default config for a given project and location. + /// + /// **Note:** *This method does not fully implement + /// [AIP/134](https://google.aip.dev/134). The wildcard entry (\*) is treated + /// as a bad request, and when the `field_mask` is omitted, the request is + /// treated as a full update on all modifiable fields.* + /// + /// @param config Required. The config to update. + /// @param update_mask Optional. Specifies the fields to be updated in the config. + /// @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.dataform.v1.Config]) + /// 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.dataform.v1.Config]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3365} + /// [google.cloud.dataform.v1.UpdateConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3402} /// // clang-format on - StatusOr - CancelWorkflowInvocation( - google::cloud::dataform::v1::CancelWorkflowInvocationRequest const& - request, - Options opts = {}); + StatusOr UpdateConfig( + google::cloud::dataform::v1::Config const& config, + google::protobuf::FieldMask const& update_mask, Options opts = {}); // clang-format off /// - /// Returns WorkflowInvocationActions in a given WorkflowInvocation. + /// Update default config for a given project and location. + /// + /// **Note:** *This method does not fully implement + /// [AIP/134](https://google.aip.dev/134). The wildcard entry (\*) is treated + /// as a bad request, and when the `field_mask` is omitted, the request is + /// treated as a full update on all modifiable fields.* /// /// @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.dataform.v1.QueryWorkflowInvocationActionsRequest]. + /// [google.cloud.dataform.v1.UpdateConfigRequest]. /// 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.dataform.v1.WorkflowInvocationAction], or rather, - /// the C++ class generated by Protobuf from that type. Please consult the - /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// @return the result of the RPC. The response message type + /// ([google.cloud.dataform.v1.Config]) + /// 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 @@ -2585,25 +3928,26 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.QueryWorkflowInvocationActionsRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2933} - /// [google.cloud.dataform.v1.WorkflowInvocationAction]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2764} + /// [google.cloud.dataform.v1.Config]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3365} + /// [google.cloud.dataform.v1.UpdateConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L3402} /// // clang-format on - StreamRange - QueryWorkflowInvocationActions( - google::cloud::dataform::v1::QueryWorkflowInvocationActionsRequest - request, + StatusOr UpdateConfig( + google::cloud::dataform::v1::UpdateConfigRequest const& request, Options opts = {}); // clang-format off /// - /// Get default config for a given project and location. + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. /// - /// @param name Required. The config name. + /// @param resource REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. /// @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.dataform.v1.Config]) + /// ([google.iam.v1.Policy]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -2613,27 +3957,29 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.Config]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2968} - /// [google.cloud.dataform.v1.GetConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2990} + /// [google.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123} + /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L102} /// // clang-format on - StatusOr GetConfig( - std::string const& name, Options opts = {}); + StatusOr GetIamPolicy(std::string const& resource, + Options opts = {}); // clang-format off /// - /// Get default config for a given project and location. + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. /// /// @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.dataform.v1.GetConfigRequest]. + /// [google.iam.v1.GetIamPolicyRequest]. /// 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.dataform.v1.Config]) + /// ([google.iam.v1.Policy]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -2643,29 +3989,30 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.Config]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2968} - /// [google.cloud.dataform.v1.GetConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2990} + /// [google.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123} + /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L102} /// // clang-format on - StatusOr GetConfig( - google::cloud::dataform::v1::GetConfigRequest const& request, - Options opts = {}); + StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// Update default config for a given project and location. + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. /// - /// **Note:** *This method does not fully implement - /// [AIP/134](https://google.aip.dev/134). The wildcard entry (\*) is treated - /// as a bad request, and when the `field_mask` is omitted, the request is - /// treated as a full update on all modifiable fields.* + /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. /// - /// @param config Required. The config to update. - /// @param update_mask Optional. Specifies the fields to be updated in the config. + /// @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.iam.v1.SetIamPolicyRequest]. + /// 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.dataform.v1.Config]) + /// ([google.iam.v1.Policy]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -2675,33 +4022,33 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.Config]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2968} - /// [google.cloud.dataform.v1.UpdateConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2999} + /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L102} + /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L100} /// // clang-format on - StatusOr UpdateConfig( - google::cloud::dataform::v1::Config const& config, - google::protobuf::FieldMask const& update_mask, Options opts = {}); + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// Update default config for a given project and location. + /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. /// - /// **Note:** *This method does not fully implement - /// [AIP/134](https://google.aip.dev/134). The wildcard entry (\*) is treated - /// as a bad request, and when the `field_mask` is omitted, the request is - /// treated as a full update on all modifiable fields.* + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. /// /// @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.dataform.v1.UpdateConfigRequest]. + /// [google.iam.v1.TestIamPermissionsRequest]. /// 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.dataform.v1.Config]) + /// ([google.iam.v1.TestIamPermissionsResponse]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -2711,12 +4058,12 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataform.v1.Config]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2968} - /// [google.cloud.dataform.v1.UpdateConfigRequest]: @googleapis_reference_link{google/cloud/dataform/v1/dataform.proto#L2999} + /// [google.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L137} + /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L153} /// // clang-format on - StatusOr UpdateConfig( - google::cloud::dataform::v1::UpdateConfigRequest const& request, + StatusOr TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request, Options opts = {}); // clang-format off @@ -2791,21 +4138,91 @@ class DataformClient { // clang-format off /// - /// Sets the access control policy on the specified resource. Replaces any - /// existing policy. + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. /// - /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + /// @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.iam.v1.SetIamPolicyRequest]. + /// [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.iam.v1.Policy]) + /// ([google.longrunning.Operation]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -2815,29 +4232,29 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L102} - /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L100} + /// [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 SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request, Options opts = {}); + StatusOr GetOperation(std::string const& name, + Options opts = {}); // clang-format off /// - /// Gets the access control policy for a resource. - /// Returns an empty policy if the resource exists and does not have a policy - /// set. + /// 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.iam.v1.GetIamPolicyRequest]. + /// [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.iam.v1.Policy]) + /// ([google.longrunning.Operation]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -2847,35 +4264,55 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123} - /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L102} + /// [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 GetIamPolicy( - google::iam::v1::GetIamPolicyRequest const& request, Options opts = {}); + StatusOr GetOperation( + google::longrunning::GetOperationRequest const& request, + Options opts = {}); // clang-format off /// - /// Returns permissions that a caller has on the specified resource. - /// If the resource does not exist, this will return an empty set of - /// permissions, not a `NOT_FOUND` error. + /// 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`. /// - /// Note: This operation is designed to be used for building permission-aware - /// UIs and command-line tools, not for authorization checking. This operation - /// may "fail open" without warning. + /// @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#L219} + /// + // 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.iam.v1.TestIamPermissionsRequest]. + /// [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 the result of the RPC. The response message type - /// ([google.iam.v1.TestIamPermissionsResponse]) - /// is mapped to a C++ class using the [Protobuf mapping rules]. - /// If the request fails, the [`StatusOr`] contains the error details. + /// @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 @@ -2883,12 +4320,86 @@ class DataformClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L137} - /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L153} + /// [google.longrunning.DeleteOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L219} /// // clang-format on - StatusOr TestIamPermissions( - google::iam::v1::TestIamPermissionsRequest const& request, + 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // clang-format on + Status CancelOperation( + google::longrunning::CancelOperationRequest const& request, Options opts = {}); private: diff --git a/google/cloud/dataform/v1/dataform_connection.cc b/google/cloud/dataform/v1/dataform_connection.cc index f6299f2ae3ebf..205716f0e023a 100644 --- a/google/cloud/dataform/v1/dataform_connection.cc +++ b/google/cloud/dataform/v1/dataform_connection.cc @@ -38,6 +38,155 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN DataformConnection::~DataformConnection() = default; +StatusOr +DataformConnection::GetTeamFolder( + google::cloud::dataform::v1::GetTeamFolderRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +DataformConnection::CreateTeamFolder( + google::cloud::dataform::v1::CreateTeamFolderRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +DataformConnection::UpdateTeamFolder( + google::cloud::dataform::v1::UpdateTeamFolderRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status DataformConnection::DeleteTeamFolder( + google::cloud::dataform::v1::DeleteTeamFolderRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +DataformConnection::DeleteTeamFolderTree( + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +DataformConnection::DeleteTeamFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataformConnection::DeleteTeamFolderTree( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +DataformConnection::QueryTeamFolderContents( + google::cloud::dataform::v1:: + QueryTeamFolderContentsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StreamRange +DataformConnection::SearchTeamFolders( + google::cloud::dataform::v1:: + SearchTeamFoldersRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr DataformConnection::GetFolder( + google::cloud::dataform::v1::GetFolderRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr DataformConnection::CreateFolder( + google::cloud::dataform::v1::CreateFolderRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr DataformConnection::UpdateFolder( + google::cloud::dataform::v1::UpdateFolderRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status DataformConnection::DeleteFolder( + google::cloud::dataform::v1::DeleteFolderRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +DataformConnection::DeleteFolderTree( + google::cloud::dataform::v1::DeleteFolderTreeRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr DataformConnection::DeleteFolderTree( + NoAwaitTag, google::cloud::dataform::v1::DeleteFolderTreeRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataformConnection::DeleteFolderTree(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +DataformConnection::QueryFolderContents( + google::cloud::dataform::v1:: + QueryFolderContentsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StreamRange +DataformConnection::QueryUserRootContents( + google::cloud::dataform::v1:: + QueryUserRootContentsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +future> +DataformConnection::MoveFolder( + google::cloud::dataform::v1::MoveFolderRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr DataformConnection::MoveFolder( + NoAwaitTag, google::cloud::dataform::v1::MoveFolderRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataformConnection::MoveFolder(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + StreamRange DataformConnection::ListRepositories( google::cloud::dataform::v1:: @@ -69,6 +218,27 @@ Status DataformConnection::DeleteRepository( return Status(StatusCode::kUnimplemented, "not implemented"); } +future> +DataformConnection::MoveRepository( + google::cloud::dataform::v1::MoveRepositoryRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr DataformConnection::MoveRepository( + NoAwaitTag, google::cloud::dataform::v1::MoveRepositoryRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataformConnection::MoveRepository(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + StatusOr DataformConnection::CommitRepositoryChanges( google::cloud::dataform::v1::CommitRepositoryChangesRequest const&) { @@ -381,6 +551,22 @@ StatusOr DataformConnection::UpdateConfig( return Status(StatusCode::kUnimplemented, "not implemented"); } +StatusOr DataformConnection::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr DataformConnection::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +DataformConnection::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + StreamRange DataformConnection::ListLocations( google::cloud::location:: @@ -394,19 +580,25 @@ StatusOr DataformConnection::GetLocation( return Status(StatusCode::kUnimplemented, "not implemented"); } -StatusOr DataformConnection::SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const&) { +StreamRange DataformConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr DataformConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { return Status(StatusCode::kUnimplemented, "not implemented"); } -StatusOr DataformConnection::GetIamPolicy( - google::iam::v1::GetIamPolicyRequest const&) { +Status DataformConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { return Status(StatusCode::kUnimplemented, "not implemented"); } -StatusOr -DataformConnection::TestIamPermissions( - google::iam::v1::TestIamPermissionsRequest const&) { +Status DataformConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { return Status(StatusCode::kUnimplemented, "not implemented"); } diff --git a/google/cloud/dataform/v1/dataform_connection.h b/google/cloud/dataform/v1/dataform_connection.h index d78d54adcf8a8..f8e4cd3daec9a 100644 --- a/google/cloud/dataform/v1/dataform_connection.h +++ b/google/cloud/dataform/v1/dataform_connection.h @@ -23,11 +23,15 @@ #include "google/cloud/dataform/v1/dataform_connection_idempotency_policy.h" #include "google/cloud/dataform/v1/internal/dataform_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 "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -179,6 +183,87 @@ class DataformConnection { virtual Options options() { return Options{}; } + virtual StatusOr GetTeamFolder( + google::cloud::dataform::v1::GetTeamFolderRequest const& request); + + virtual StatusOr CreateTeamFolder( + google::cloud::dataform::v1::CreateTeamFolderRequest const& request); + + virtual StatusOr UpdateTeamFolder( + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request); + + virtual Status DeleteTeamFolder( + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request); + + virtual future< + StatusOr> + DeleteTeamFolderTree( + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request); + + virtual StatusOr DeleteTeamFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request); + + virtual future< + StatusOr> + DeleteTeamFolderTree(google::longrunning::Operation const& operation); + + virtual StreamRange< + google::cloud::dataform::v1::QueryTeamFolderContentsResponse:: + TeamFolderContentsEntry> + QueryTeamFolderContents( + google::cloud::dataform::v1::QueryTeamFolderContentsRequest request); + + virtual StreamRange + SearchTeamFolders( + google::cloud::dataform::v1::SearchTeamFoldersRequest request); + + virtual StatusOr GetFolder( + google::cloud::dataform::v1::GetFolderRequest const& request); + + virtual StatusOr CreateFolder( + google::cloud::dataform::v1::CreateFolderRequest const& request); + + virtual StatusOr UpdateFolder( + google::cloud::dataform::v1::UpdateFolderRequest const& request); + + virtual Status DeleteFolder( + google::cloud::dataform::v1::DeleteFolderRequest const& request); + + virtual future< + StatusOr> + DeleteFolderTree( + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request); + + virtual StatusOr DeleteFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request); + + virtual future< + StatusOr> + DeleteFolderTree(google::longrunning::Operation const& operation); + + virtual StreamRange + QueryFolderContents( + google::cloud::dataform::v1::QueryFolderContentsRequest request); + + virtual StreamRange + QueryUserRootContents( + google::cloud::dataform::v1::QueryUserRootContentsRequest request); + + virtual future> + MoveFolder(google::cloud::dataform::v1::MoveFolderRequest const& request); + + virtual StatusOr MoveFolder( + NoAwaitTag, + google::cloud::dataform::v1::MoveFolderRequest const& request); + + virtual future> + MoveFolder(google::longrunning::Operation const& operation); + virtual StreamRange ListRepositories( google::cloud::dataform::v1::ListRepositoriesRequest request); @@ -194,6 +279,17 @@ class DataformConnection { virtual Status DeleteRepository( google::cloud::dataform::v1::DeleteRepositoryRequest const& request); + virtual future> + MoveRepository( + google::cloud::dataform::v1::MoveRepositoryRequest const& request); + + virtual StatusOr MoveRepository( + NoAwaitTag, + google::cloud::dataform::v1::MoveRepositoryRequest const& request); + + virtual future> + MoveRepository(google::longrunning::Operation const& operation); + virtual StatusOr CommitRepositoryChanges( google::cloud::dataform::v1::CommitRepositoryChangesRequest const& @@ -387,20 +483,32 @@ class DataformConnection { virtual StatusOr UpdateConfig( google::cloud::dataform::v1::UpdateConfigRequest const& request); + virtual StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request); + + virtual StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request); + + virtual StatusOr + TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const& request); + virtual StreamRange ListLocations( google::cloud::location::ListLocationsRequest request); virtual StatusOr GetLocation( google::cloud::location::GetLocationRequest const& request); - virtual StatusOr SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request); + virtual StreamRange ListOperations( + google::longrunning::ListOperationsRequest request); - virtual StatusOr GetIamPolicy( - google::iam::v1::GetIamPolicyRequest const& request); + virtual StatusOr GetOperation( + google::longrunning::GetOperationRequest const& request); - virtual StatusOr - TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const& request); + virtual Status DeleteOperation( + google::longrunning::DeleteOperationRequest const& request); + + virtual Status CancelOperation( + google::longrunning::CancelOperationRequest const& request); }; /** diff --git a/google/cloud/dataform/v1/dataform_connection_idempotency_policy.cc b/google/cloud/dataform/v1/dataform_connection_idempotency_policy.cc index 313c39571f159..13f7a10dabfd4 100644 --- a/google/cloud/dataform/v1/dataform_connection_idempotency_policy.cc +++ b/google/cloud/dataform/v1/dataform_connection_idempotency_policy.cc @@ -34,6 +34,81 @@ DataformConnectionIdempotencyPolicy::clone() const { return std::make_unique(*this); } +Idempotency DataformConnectionIdempotencyPolicy::GetTeamFolder( + google::cloud::dataform::v1::GetTeamFolderRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::CreateTeamFolder( + google::cloud::dataform::v1::CreateTeamFolderRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::UpdateTeamFolder( + google::cloud::dataform::v1::UpdateTeamFolderRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::DeleteTeamFolder( + google::cloud::dataform::v1::DeleteTeamFolderRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::DeleteTeamFolderTree( + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::QueryTeamFolderContents( + google::cloud::dataform::v1::QueryTeamFolderContentsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::SearchTeamFolders( + google::cloud::dataform::v1::SearchTeamFoldersRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::GetFolder( + google::cloud::dataform::v1::GetFolderRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::CreateFolder( + google::cloud::dataform::v1::CreateFolderRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::UpdateFolder( + google::cloud::dataform::v1::UpdateFolderRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::DeleteFolder( + google::cloud::dataform::v1::DeleteFolderRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::DeleteFolderTree( + google::cloud::dataform::v1::DeleteFolderTreeRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::QueryFolderContents( + google::cloud::dataform::v1::QueryFolderContentsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::QueryUserRootContents( + google::cloud::dataform::v1::QueryUserRootContentsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::MoveFolder( + google::cloud::dataform::v1::MoveFolderRequest const&) { + return Idempotency::kNonIdempotent; +} + Idempotency DataformConnectionIdempotencyPolicy::ListRepositories( google::cloud::dataform::v1::ListRepositoriesRequest) { // NOLINT return Idempotency::kIdempotent; @@ -59,6 +134,11 @@ Idempotency DataformConnectionIdempotencyPolicy::DeleteRepository( return Idempotency::kNonIdempotent; } +Idempotency DataformConnectionIdempotencyPolicy::MoveRepository( + google::cloud::dataform::v1::MoveRepositoryRequest const&) { + return Idempotency::kNonIdempotent; +} + Idempotency DataformConnectionIdempotencyPolicy::CommitRepositoryChanges( google::cloud::dataform::v1::CommitRepositoryChangesRequest const&) { return Idempotency::kNonIdempotent; @@ -310,6 +390,22 @@ Idempotency DataformConnectionIdempotencyPolicy::UpdateConfig( return Idempotency::kNonIdempotent; } +Idempotency DataformConnectionIdempotencyPolicy::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { + return request.policy().etag().empty() ? Idempotency::kNonIdempotent + : Idempotency::kIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const&) { + return Idempotency::kIdempotent; +} + Idempotency DataformConnectionIdempotencyPolicy::ListLocations( google::cloud::location::ListLocationsRequest) { // NOLINT return Idempotency::kIdempotent; @@ -320,20 +416,24 @@ Idempotency DataformConnectionIdempotencyPolicy::GetLocation( return Idempotency::kIdempotent; } -Idempotency DataformConnectionIdempotencyPolicy::SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request) { - return request.policy().etag().empty() ? Idempotency::kNonIdempotent - : Idempotency::kIdempotent; +Idempotency DataformConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; } -Idempotency DataformConnectionIdempotencyPolicy::GetIamPolicy( - google::iam::v1::GetIamPolicyRequest const&) { +Idempotency DataformConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { return Idempotency::kIdempotent; } -Idempotency DataformConnectionIdempotencyPolicy::TestIamPermissions( - google::iam::v1::TestIamPermissionsRequest const&) { - return Idempotency::kIdempotent; +Idempotency DataformConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataformConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; } std::unique_ptr diff --git a/google/cloud/dataform/v1/dataform_connection_idempotency_policy.h b/google/cloud/dataform/v1/dataform_connection_idempotency_policy.h index 12612259e46de..b6b557cc99736 100644 --- a/google/cloud/dataform/v1/dataform_connection_idempotency_policy.h +++ b/google/cloud/dataform/v1/dataform_connection_idempotency_policy.h @@ -23,7 +23,7 @@ #include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" -#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -38,6 +38,51 @@ class DataformConnectionIdempotencyPolicy { /// Create a new copy of this object. virtual std::unique_ptr clone() const; + virtual google::cloud::Idempotency GetTeamFolder( + google::cloud::dataform::v1::GetTeamFolderRequest const& request); + + virtual google::cloud::Idempotency CreateTeamFolder( + google::cloud::dataform::v1::CreateTeamFolderRequest const& request); + + virtual google::cloud::Idempotency UpdateTeamFolder( + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request); + + virtual google::cloud::Idempotency DeleteTeamFolder( + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request); + + virtual google::cloud::Idempotency DeleteTeamFolderTree( + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request); + + virtual google::cloud::Idempotency QueryTeamFolderContents( + google::cloud::dataform::v1::QueryTeamFolderContentsRequest request); + + virtual google::cloud::Idempotency SearchTeamFolders( + google::cloud::dataform::v1::SearchTeamFoldersRequest request); + + virtual google::cloud::Idempotency GetFolder( + google::cloud::dataform::v1::GetFolderRequest const& request); + + virtual google::cloud::Idempotency CreateFolder( + google::cloud::dataform::v1::CreateFolderRequest const& request); + + virtual google::cloud::Idempotency UpdateFolder( + google::cloud::dataform::v1::UpdateFolderRequest const& request); + + virtual google::cloud::Idempotency DeleteFolder( + google::cloud::dataform::v1::DeleteFolderRequest const& request); + + virtual google::cloud::Idempotency DeleteFolderTree( + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request); + + virtual google::cloud::Idempotency QueryFolderContents( + google::cloud::dataform::v1::QueryFolderContentsRequest request); + + virtual google::cloud::Idempotency QueryUserRootContents( + google::cloud::dataform::v1::QueryUserRootContentsRequest request); + + virtual google::cloud::Idempotency MoveFolder( + google::cloud::dataform::v1::MoveFolderRequest const& request); + virtual google::cloud::Idempotency ListRepositories( google::cloud::dataform::v1::ListRepositoriesRequest request); @@ -53,6 +98,9 @@ class DataformConnectionIdempotencyPolicy { virtual google::cloud::Idempotency DeleteRepository( google::cloud::dataform::v1::DeleteRepositoryRequest const& request); + virtual google::cloud::Idempotency MoveRepository( + google::cloud::dataform::v1::MoveRepositoryRequest const& request); + virtual google::cloud::Idempotency CommitRepositoryChanges( google::cloud::dataform::v1::CommitRepositoryChangesRequest const& request); @@ -210,20 +258,32 @@ class DataformConnectionIdempotencyPolicy { virtual google::cloud::Idempotency UpdateConfig( google::cloud::dataform::v1::UpdateConfigRequest const& request); + virtual google::cloud::Idempotency GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request); + + virtual google::cloud::Idempotency SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request); + + virtual google::cloud::Idempotency TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest 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 SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request); + virtual google::cloud::Idempotency ListOperations( + google::longrunning::ListOperationsRequest request); - virtual google::cloud::Idempotency GetIamPolicy( - google::iam::v1::GetIamPolicyRequest const& request); + virtual google::cloud::Idempotency GetOperation( + google::longrunning::GetOperationRequest const& request); - virtual google::cloud::Idempotency TestIamPermissions( - google::iam::v1::TestIamPermissionsRequest 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 diff --git a/google/cloud/dataform/v1/dataform_options.h b/google/cloud/dataform/v1/dataform_options.h index 2d2fc0f96106e..339cbd93c5d6f 100644 --- a/google/cloud/dataform/v1/dataform_options.h +++ b/google/cloud/dataform/v1/dataform_options.h @@ -58,6 +58,16 @@ struct DataformConnectionIdempotencyPolicyOption { using Type = std::shared_ptr; }; +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-dataform-options + */ +struct DataformPollingPolicyOption { + using Type = std::shared_ptr; +}; + /** * The options applicable to Dataform. * @@ -65,6 +75,7 @@ struct DataformConnectionIdempotencyPolicyOption { */ using DataformPolicyOptionList = OptionList; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/dataform/v1/internal/dataform_auth_decorator.cc b/google/cloud/dataform/v1/internal/dataform_auth_decorator.cc index 683a683bb4340..f37b53ff05815 100644 --- a/google/cloud/dataform/v1/internal/dataform_auth_decorator.cc +++ b/google/cloud/dataform/v1/internal/dataform_auth_decorator.cc @@ -34,6 +34,192 @@ DataformAuth::DataformAuth( std::shared_ptr child) : auth_(std::move(auth)), child_(std::move(child)) {} +StatusOr DataformAuth::GetTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetTeamFolderRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetTeamFolder(context, options, request); +} + +StatusOr +DataformAuth::CreateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateTeamFolder(context, options, request); +} + +StatusOr +DataformAuth::UpdateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateTeamFolder(context, options, request); +} + +Status DataformAuth::DeleteTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteTeamFolder(context, options, request); +} + +future> +DataformAuth::AsyncDeleteTeamFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest 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->AsyncDeleteTeamFolderTree(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr DataformAuth::DeleteTeamFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteTeamFolderTree(context, options, request); +} + +StatusOr +DataformAuth::QueryTeamFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryTeamFolderContentsRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->QueryTeamFolderContents(context, options, request); +} + +StatusOr +DataformAuth::SearchTeamFolders( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::SearchTeamFoldersRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->SearchTeamFolders(context, options, request); +} + +StatusOr DataformAuth::GetFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetFolderRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetFolder(context, options, request); +} + +StatusOr DataformAuth::CreateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateFolderRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateFolder(context, options, request); +} + +StatusOr DataformAuth::UpdateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateFolderRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateFolder(context, options, request); +} + +Status DataformAuth::DeleteFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteFolder(context, options, request); +} + +future> +DataformAuth::AsyncDeleteFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteFolderTreeRequest 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->AsyncDeleteFolderTree(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr DataformAuth::DeleteFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteFolderTree(context, options, request); +} + +StatusOr +DataformAuth::QueryFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryFolderContentsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->QueryFolderContents(context, options, request); +} + +StatusOr +DataformAuth::QueryUserRootContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryUserRootContentsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->QueryUserRootContents(context, options, request); +} + +future> DataformAuth::AsyncMoveFolder( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveFolderRequest 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->AsyncMoveFolder(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr DataformAuth::MoveFolder( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveFolderRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->MoveFolder(context, options, request); +} + StatusOr DataformAuth::ListRepositories( grpc::ClientContext& context, Options const& options, @@ -77,6 +263,34 @@ Status DataformAuth::DeleteRepository( return child_->DeleteRepository(context, options, request); } +future> +DataformAuth::AsyncMoveRepository( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveRepositoryRequest 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->AsyncMoveRepository(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr DataformAuth::MoveRepository( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->MoveRepository(context, options, request); +} + StatusOr DataformAuth::CommitRepositoryChanges( grpc::ClientContext& context, Options const& options, @@ -519,6 +733,31 @@ StatusOr DataformAuth::UpdateConfig( return child_->UpdateConfig(context, options, request); } +StatusOr DataformAuth::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetIamPolicy(context, options, request); +} + +StatusOr DataformAuth::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->SetIamPolicy(context, options, request); +} + +StatusOr +DataformAuth::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->TestIamPermissions(context, options, request); +} + StatusOr DataformAuth::ListLocations( grpc::ClientContext& context, Options const& options, @@ -536,29 +775,73 @@ StatusOr DataformAuth::GetLocation( return child_->GetLocation(context, options, request); } -StatusOr DataformAuth::SetIamPolicy( +StatusOr +DataformAuth::ListOperations( grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { + google::longrunning::ListOperationsRequest const& request) { auto status = auth_->ConfigureContext(context); if (!status.ok()) return status; - return child_->SetIamPolicy(context, options, request); + return child_->ListOperations(context, options, request); } -StatusOr DataformAuth::GetIamPolicy( +StatusOr DataformAuth::GetOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) { + google::longrunning::GetOperationRequest const& request) { auto status = auth_->ConfigureContext(context); if (!status.ok()) return status; - return child_->GetIamPolicy(context, options, request); + return child_->GetOperation(context, options, request); } -StatusOr -DataformAuth::TestIamPermissions( +Status DataformAuth::DeleteOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) { + google::longrunning::DeleteOperationRequest const& request) { auto status = auth_->ConfigureContext(context); if (!status.ok()) return status; - return child_->TestIamPermissions(context, options, request); + return child_->DeleteOperation(context, options, request); +} + +Status DataformAuth::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> +DataformAuth::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 DataformAuth::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 diff --git a/google/cloud/dataform/v1/internal/dataform_auth_decorator.h b/google/cloud/dataform/v1/internal/dataform_auth_decorator.h index de6a6f726531e..163e21427085c 100644 --- a/google/cloud/dataform/v1/internal/dataform_auth_decorator.h +++ b/google/cloud/dataform/v1/internal/dataform_auth_decorator.h @@ -22,6 +22,7 @@ #include "google/cloud/dataform/v1/internal/dataform_stub.h" #include "google/cloud/internal/unified_grpc_credentials.h" #include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -41,6 +42,99 @@ class DataformAuth : public DataformStub { std::shared_ptr auth, std::shared_ptr child); + StatusOr GetTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetTeamFolderRequest const& request) + override; + + StatusOr CreateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) + override; + + StatusOr UpdateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) + override; + + Status DeleteTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) + override; + + future> AsyncDeleteTeamFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + StatusOr DeleteTeamFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + StatusOr + QueryTeamFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryTeamFolderContentsRequest const& + request) override; + + StatusOr + SearchTeamFolders(grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::SearchTeamFoldersRequest const& + request) override; + + StatusOr GetFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetFolderRequest const& request) override; + + StatusOr CreateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateFolderRequest const& request) override; + + StatusOr UpdateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateFolderRequest const& request) override; + + Status DeleteFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderRequest const& request) override; + + future> AsyncDeleteFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) + override; + + StatusOr DeleteFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) + override; + + StatusOr + QueryFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryFolderContentsRequest const& request) + override; + + StatusOr + QueryUserRootContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryUserRootContentsRequest const& request) + override; + + future> AsyncMoveFolder( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveFolderRequest const& request) override; + + StatusOr MoveFolder( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveFolderRequest const& request) override; + StatusOr ListRepositories(grpc::ClientContext& context, Options const& options, google::cloud::dataform::v1::ListRepositoriesRequest const& @@ -66,6 +160,18 @@ class DataformAuth : public DataformStub { google::cloud::dataform::v1::DeleteRepositoryRequest const& request) override; + future> AsyncMoveRepository( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) + override; + + StatusOr MoveRepository( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) + override; + StatusOr CommitRepositoryChanges( grpc::ClientContext& context, Options const& options, @@ -327,6 +433,18 @@ class DataformAuth : public DataformStub { grpc::ClientContext& context, Options const& options, google::cloud::dataform::v1::UpdateConfigRequest const& request) override; + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -335,17 +453,33 @@ class DataformAuth : public DataformStub { grpc::ClientContext& context, Options const& options, google::cloud::location::GetLocationRequest const& request) override; - StatusOr SetIamPolicy( + StatusOr ListOperations( grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) override; + google::longrunning::ListOperationsRequest const& request) override; - StatusOr GetIamPolicy( + StatusOr GetOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) override; + google::longrunning::GetOperationRequest const& request) override; - StatusOr TestIamPermissions( + Status DeleteOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) override; + 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_; diff --git a/google/cloud/dataform/v1/internal/dataform_connection_impl.cc b/google/cloud/dataform/v1/internal/dataform_connection_impl.cc index b42711e8ff90a..607f8e5d405bd 100644 --- a/google/cloud/dataform/v1/internal/dataform_connection_impl.cc +++ b/google/cloud/dataform/v1/internal/dataform_connection_impl.cc @@ -21,6 +21,7 @@ #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 @@ -47,6 +48,10 @@ idempotency_policy(Options const& options) { ->clone(); } +std::unique_ptr polling_policy(Options const& options) { + return options.get()->clone(); +} + } // namespace DataformConnectionImpl::DataformConnectionImpl( @@ -57,6 +62,548 @@ DataformConnectionImpl::DataformConnectionImpl( options_(internal::MergeOptions(std::move(options), DataformConnection::options())) {} +StatusOr +DataformConnectionImpl::GetTeamFolder( + google::cloud::dataform::v1::GetTeamFolderRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetTeamFolder(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetTeamFolderRequest const& request) { + return stub_->GetTeamFolder(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +DataformConnectionImpl::CreateTeamFolder( + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateTeamFolder(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) { + return stub_->CreateTeamFolder(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +DataformConnectionImpl::UpdateTeamFolder( + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateTeamFolder(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) { + return stub_->UpdateTeamFolder(context, options, request); + }, + *current, request, __func__); +} + +Status DataformConnectionImpl::DeleteTeamFolder( + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteTeamFolder(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) { + return stub_->DeleteTeamFolder(context, options, request); + }, + *current, request, __func__); +} + +future> +DataformConnectionImpl::DeleteTeamFolderTree( + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteTeamFolderTree(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataform::v1::DeleteFolderTreeMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& + request) { + return stub->AsyncDeleteTeamFolderTree(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::dataform::v1::DeleteFolderTreeMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +DataformConnectionImpl::DeleteTeamFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteTeamFolderTree(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& + request) { + return stub_->DeleteTeamFolderTree(context, options, request); + }, + *current, request, __func__); +} + +future> +DataformConnectionImpl::DeleteTeamFolderTree( + 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 DeleteTeamFolderTree", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataform::v1::DeleteFolderTreeMetadata>( + 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::dataform::v1::DeleteFolderTreeMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +DataformConnectionImpl::QueryTeamFolderContents( + google::cloud::dataform::v1::QueryTeamFolderContentsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->QueryTeamFolderContents(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::dataform::v1::QueryTeamFolderContentsRequest const& + r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1:: + QueryTeamFolderContentsRequest const& request) { + return stub->QueryTeamFolderContents(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::dataform::v1::QueryTeamFolderContentsResponse r) { + std::vector< + google::cloud::dataform::v1::QueryTeamFolderContentsResponse:: + TeamFolderContentsEntry> + result(r.entries().size()); + auto& messages = *r.mutable_entries(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StreamRange +DataformConnectionImpl::SearchTeamFolders( + google::cloud::dataform::v1::SearchTeamFoldersRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->SearchTeamFolders(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::dataform::v1::SearchTeamFoldersRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::SearchTeamFoldersRequest const& + request) { + return stub->SearchTeamFolders(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::dataform::v1::SearchTeamFoldersResponse r) { + std::vector + result(r.results().size()); + auto& messages = *r.mutable_results(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr DataformConnectionImpl::GetFolder( + google::cloud::dataform::v1::GetFolderRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetFolder(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetFolderRequest const& request) { + return stub_->GetFolder(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +DataformConnectionImpl::CreateFolder( + google::cloud::dataform::v1::CreateFolderRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateFolder(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateFolderRequest const& request) { + return stub_->CreateFolder(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +DataformConnectionImpl::UpdateFolder( + google::cloud::dataform::v1::UpdateFolderRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateFolder(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateFolderRequest const& request) { + return stub_->UpdateFolder(context, options, request); + }, + *current, request, __func__); +} + +Status DataformConnectionImpl::DeleteFolder( + google::cloud::dataform::v1::DeleteFolderRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteFolder(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderRequest const& request) { + return stub_->DeleteFolder(context, options, request); + }, + *current, request, __func__); +} + +future> +DataformConnectionImpl::DeleteFolderTree( + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteFolderTree(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataform::v1::DeleteFolderTreeMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + return stub->AsyncDeleteFolderTree(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::dataform::v1::DeleteFolderTreeMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +DataformConnectionImpl::DeleteFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteFolderTree(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + return stub_->DeleteFolderTree(context, options, request); + }, + *current, request, __func__); +} + +future> +DataformConnectionImpl::DeleteFolderTree( + 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 DeleteFolderTree", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataform::v1::DeleteFolderTreeMetadata>( + 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::dataform::v1::DeleteFolderTreeMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +DataformConnectionImpl::QueryFolderContents( + google::cloud::dataform::v1::QueryFolderContentsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->QueryFolderContents(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::dataform::v1::QueryFolderContentsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryFolderContentsRequest const& + request) { + return stub->QueryFolderContents(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::dataform::v1::QueryFolderContentsResponse r) { + std::vector + result(r.entries().size()); + auto& messages = *r.mutable_entries(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StreamRange +DataformConnectionImpl::QueryUserRootContents( + google::cloud::dataform::v1::QueryUserRootContentsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->QueryUserRootContents(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::dataform::v1::QueryUserRootContentsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryUserRootContentsRequest const& + request) { + return stub->QueryUserRootContents(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::dataform::v1::QueryUserRootContentsResponse r) { + std::vector + result(r.entries().size()); + auto& messages = *r.mutable_entries(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +future> +DataformConnectionImpl::MoveFolder( + google::cloud::dataform::v1::MoveFolderRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->MoveFolder(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataform::v1::MoveFolderMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveFolderRequest const& request) { + return stub->AsyncMoveFolder(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::dataform::v1::MoveFolderMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr DataformConnectionImpl::MoveFolder( + NoAwaitTag, google::cloud::dataform::v1::MoveFolderRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->MoveFolder(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::MoveFolderRequest const& request) { + return stub_->MoveFolder(context, options, request); + }, + *current, request, __func__); +} + +future> +DataformConnectionImpl::MoveFolder( + 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 MoveFolder", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataform::v1::MoveFolderMetadata>( + 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::dataform::v1::MoveFolderMetadata>, + polling_policy(*current), __func__); +} + StreamRange DataformConnectionImpl::ListRepositories( google::cloud::dataform::v1::ListRepositoriesRequest request) { @@ -149,6 +696,98 @@ Status DataformConnectionImpl::DeleteRepository( *current, request, __func__); } +future> +DataformConnectionImpl::MoveRepository( + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->MoveRepository(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataform::v1::MoveRepositoryMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + return stub->AsyncMoveRepository(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::dataform::v1::MoveRepositoryMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr DataformConnectionImpl::MoveRepository( + NoAwaitTag, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->MoveRepository(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + return stub_->MoveRepository(context, options, request); + }, + *current, request, __func__); +} + +future> +DataformConnectionImpl::MoveRepository( + 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 MoveRepository", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataform::v1::MoveRepositoryMetadata>( + 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::dataform::v1::MoveRepositoryMetadata>, + polling_policy(*current), __func__); +} + StatusOr DataformConnectionImpl::CommitRepositoryChanges( google::cloud::dataform::v1::CommitRepositoryChangesRequest const& @@ -1105,6 +1744,46 @@ DataformConnectionImpl::UpdateConfig( *current, request, __func__); } +StatusOr DataformConnectionImpl::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetIamPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + return stub_->GetIamPolicy(context, options, request); + }, + *current, request, __func__); +} + +StatusOr DataformConnectionImpl::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->SetIamPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + return stub_->SetIamPolicy(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +DataformConnectionImpl::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->TestIamPermissions(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + return stub_->TestIamPermissions(context, options, request); + }, + *current, request, __func__); +} + StreamRange DataformConnectionImpl::ListLocations( google::cloud::location::ListLocationsRequest request) { @@ -1152,42 +1831,74 @@ StatusOr DataformConnectionImpl::GetLocation( *current, request, __func__); } -StatusOr DataformConnectionImpl::SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request) { +StreamRange +DataformConnectionImpl::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 DataformConnectionImpl::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)->SetIamPolicy(request), + idempotency_policy(*current)->GetOperation(request), [this](grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { - return stub_->SetIamPolicy(context, options, request); + google::longrunning::GetOperationRequest const& request) { + return stub_->GetOperation(context, options, request); }, *current, request, __func__); } -StatusOr DataformConnectionImpl::GetIamPolicy( - google::iam::v1::GetIamPolicyRequest const& request) { +Status DataformConnectionImpl::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)->GetIamPolicy(request), + idempotency_policy(*current)->DeleteOperation(request), [this](grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) { - return stub_->GetIamPolicy(context, options, request); + google::longrunning::DeleteOperationRequest const& request) { + return stub_->DeleteOperation(context, options, request); }, *current, request, __func__); } -StatusOr -DataformConnectionImpl::TestIamPermissions( - google::iam::v1::TestIamPermissionsRequest const& request) { +Status DataformConnectionImpl::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)->TestIamPermissions(request), + idempotency_policy(*current)->CancelOperation(request), [this](grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) { - return stub_->TestIamPermissions(context, options, request); + google::longrunning::CancelOperationRequest const& request) { + return stub_->CancelOperation(context, options, request); }, *current, request, __func__); } diff --git a/google/cloud/dataform/v1/internal/dataform_connection_impl.h b/google/cloud/dataform/v1/internal/dataform_connection_impl.h index 45fe0e6591a83..556618bee2345 100644 --- a/google/cloud/dataform/v1/internal/dataform_connection_impl.h +++ b/google/cloud/dataform/v1/internal/dataform_connection_impl.h @@ -26,10 +26,13 @@ #include "google/cloud/dataform/v1/internal/dataform_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 "google/longrunning/operations.grpc.pb.h" #include namespace google { @@ -48,6 +51,92 @@ class DataformConnectionImpl : public dataform_v1::DataformConnection { Options options() override { return options_; } + StatusOr GetTeamFolder( + google::cloud::dataform::v1::GetTeamFolderRequest const& request) + override; + + StatusOr CreateTeamFolder( + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) + override; + + StatusOr UpdateTeamFolder( + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) + override; + + Status DeleteTeamFolder( + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) + override; + + future> + DeleteTeamFolderTree( + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + StatusOr DeleteTeamFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + future> + DeleteTeamFolderTree( + google::longrunning::Operation const& operation) override; + + StreamRange + QueryTeamFolderContents( + google::cloud::dataform::v1::QueryTeamFolderContentsRequest request) + override; + + StreamRange + SearchTeamFolders( + google::cloud::dataform::v1::SearchTeamFoldersRequest request) override; + + StatusOr GetFolder( + google::cloud::dataform::v1::GetFolderRequest const& request) override; + + StatusOr CreateFolder( + google::cloud::dataform::v1::CreateFolderRequest const& request) override; + + StatusOr UpdateFolder( + google::cloud::dataform::v1::UpdateFolderRequest const& request) override; + + Status DeleteFolder( + google::cloud::dataform::v1::DeleteFolderRequest const& request) override; + + future> + DeleteFolderTree(google::cloud::dataform::v1::DeleteFolderTreeRequest const& + request) override; + + StatusOr DeleteFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) + override; + + future> + DeleteFolderTree(google::longrunning::Operation const& operation) override; + + StreamRange + QueryFolderContents( + google::cloud::dataform::v1::QueryFolderContentsRequest request) override; + + StreamRange + QueryUserRootContents( + google::cloud::dataform::v1::QueryUserRootContentsRequest request) + override; + + future> MoveFolder( + google::cloud::dataform::v1::MoveFolderRequest const& request) override; + + StatusOr MoveFolder( + NoAwaitTag, + google::cloud::dataform::v1::MoveFolderRequest const& request) override; + + future> MoveFolder( + google::longrunning::Operation const& operation) override; + StreamRange ListRepositories( google::cloud::dataform::v1::ListRepositoriesRequest request) override; @@ -67,6 +156,18 @@ class DataformConnectionImpl : public dataform_v1::DataformConnection { google::cloud::dataform::v1::DeleteRepositoryRequest const& request) override; + future> + MoveRepository(google::cloud::dataform::v1::MoveRepositoryRequest const& + request) override; + + StatusOr MoveRepository( + NoAwaitTag, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) + override; + + future> + MoveRepository(google::longrunning::Operation const& operation) override; + StatusOr CommitRepositoryChanges( google::cloud::dataform::v1::CommitRepositoryChangesRequest const& @@ -273,20 +374,32 @@ class DataformConnectionImpl : public dataform_v1::DataformConnection { StatusOr UpdateConfig( google::cloud::dataform::v1::UpdateConfigRequest const& request) override; + StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request) override; + StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; StatusOr GetLocation( google::cloud::location::GetLocationRequest const& request) override; - StatusOr SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request) override; + StreamRange ListOperations( + google::longrunning::ListOperationsRequest request) override; - StatusOr GetIamPolicy( - google::iam::v1::GetIamPolicyRequest const& request) override; + StatusOr GetOperation( + google::longrunning::GetOperationRequest const& request) override; - StatusOr TestIamPermissions( - google::iam::v1::TestIamPermissionsRequest const& request) override; + Status DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + google::longrunning::CancelOperationRequest const& request) override; private: std::unique_ptr background_; diff --git a/google/cloud/dataform/v1/internal/dataform_logging_decorator.cc b/google/cloud/dataform/v1/internal/dataform_logging_decorator.cc index e39a5c24ce3a0..733178c8f3274 100644 --- a/google/cloud/dataform/v1/internal/dataform_logging_decorator.cc +++ b/google/cloud/dataform/v1/internal/dataform_logging_decorator.cc @@ -38,6 +38,244 @@ DataformLogging::DataformLogging(std::shared_ptr child, std::set const&) : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} +StatusOr +DataformLogging::GetTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetTeamFolderRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetTeamFolderRequest const& request) { + return child_->GetTeamFolder(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataformLogging::CreateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) { + return child_->CreateTeamFolder(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataformLogging::UpdateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) { + return child_->UpdateTeamFolder(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status DataformLogging::DeleteTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) { + return child_->DeleteTeamFolder(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +DataformLogging::AsyncDeleteTeamFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& + request) { + return child_->AsyncDeleteTeamFolderTree(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr DataformLogging::DeleteTeamFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& + request) { + return child_->DeleteTeamFolderTree(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataformLogging::QueryTeamFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryTeamFolderContentsRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryTeamFolderContentsRequest const& + request) { + return child_->QueryTeamFolderContents(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataformLogging::SearchTeamFolders( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::SearchTeamFoldersRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::SearchTeamFoldersRequest const& + request) { + return child_->SearchTeamFolders(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr DataformLogging::GetFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetFolderRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetFolderRequest const& request) { + return child_->GetFolder(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr DataformLogging::CreateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateFolderRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateFolderRequest const& request) { + return child_->CreateFolder(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr DataformLogging::UpdateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateFolderRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateFolderRequest const& request) { + return child_->UpdateFolder(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status DataformLogging::DeleteFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderRequest const& request) { + return child_->DeleteFolder(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +DataformLogging::AsyncDeleteFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + return child_->AsyncDeleteFolderTree(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr DataformLogging::DeleteFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + return child_->DeleteFolderTree(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataformLogging::QueryFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryFolderContentsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryFolderContentsRequest const& + request) { + return child_->QueryFolderContents(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataformLogging::QueryUserRootContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryUserRootContentsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryUserRootContentsRequest const& + request) { + return child_->QueryUserRootContents(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +DataformLogging::AsyncMoveFolder( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveFolderRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveFolderRequest const& request) { + return child_->AsyncMoveFolder(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr DataformLogging::MoveFolder( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveFolderRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::MoveFolderRequest const& request) { + return child_->MoveFolder(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr DataformLogging::ListRepositories( grpc::ClientContext& context, Options const& options, @@ -101,6 +339,37 @@ Status DataformLogging::DeleteRepository( context, options, request, __func__, tracing_options_); } +future> +DataformLogging::AsyncMoveRepository( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + return child_->AsyncMoveRepository(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr DataformLogging::MoveRepository( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + return child_->MoveRepository(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr DataformLogging::CommitRepositoryChanges( grpc::ClientContext& context, Options const& options, @@ -734,6 +1003,40 @@ StatusOr DataformLogging::UpdateConfig( context, options, request, __func__, tracing_options_); } +StatusOr DataformLogging::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + return child_->GetIamPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr DataformLogging::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + return child_->SetIamPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataformLogging::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + return child_->TestIamPermissions(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr DataformLogging::ListLocations( grpc::ClientContext& context, Options const& options, @@ -757,40 +1060,86 @@ StatusOr DataformLogging::GetLocation( context, options, request, __func__, tracing_options_); } -StatusOr DataformLogging::SetIamPolicy( +StatusOr +DataformLogging::ListOperations( grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { + google::longrunning::ListOperationsRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { - return child_->SetIamPolicy(context, options, request); + google::longrunning::ListOperationsRequest const& request) { + return child_->ListOperations(context, options, request); }, context, options, request, __func__, tracing_options_); } -StatusOr DataformLogging::GetIamPolicy( +StatusOr DataformLogging::GetOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) { + google::longrunning::GetOperationRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) { - return child_->GetIamPolicy(context, options, request); + google::longrunning::GetOperationRequest const& request) { + return child_->GetOperation(context, options, request); }, context, options, request, __func__, tracing_options_); } -StatusOr -DataformLogging::TestIamPermissions( +Status DataformLogging::DeleteOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) { + google::longrunning::DeleteOperationRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) { - return child_->TestIamPermissions(context, options, request); + google::longrunning::DeleteOperationRequest const& request) { + return child_->DeleteOperation(context, options, request); }, context, options, request, __func__, tracing_options_); } +Status DataformLogging::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> +DataformLogging::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 DataformLogging::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 dataform_v1_internal } // namespace cloud diff --git a/google/cloud/dataform/v1/internal/dataform_logging_decorator.h b/google/cloud/dataform/v1/internal/dataform_logging_decorator.h index 8fc0ac484fda1..42ca59763a375 100644 --- a/google/cloud/dataform/v1/internal/dataform_logging_decorator.h +++ b/google/cloud/dataform/v1/internal/dataform_logging_decorator.h @@ -22,6 +22,7 @@ #include "google/cloud/dataform/v1/internal/dataform_stub.h" #include "google/cloud/tracing_options.h" #include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -41,6 +42,99 @@ class DataformLogging : public DataformStub { TracingOptions tracing_options, std::set const& components); + StatusOr GetTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetTeamFolderRequest const& request) + override; + + StatusOr CreateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) + override; + + StatusOr UpdateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) + override; + + Status DeleteTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) + override; + + future> AsyncDeleteTeamFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + StatusOr DeleteTeamFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + StatusOr + QueryTeamFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryTeamFolderContentsRequest const& + request) override; + + StatusOr + SearchTeamFolders(grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::SearchTeamFoldersRequest const& + request) override; + + StatusOr GetFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetFolderRequest const& request) override; + + StatusOr CreateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateFolderRequest const& request) override; + + StatusOr UpdateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateFolderRequest const& request) override; + + Status DeleteFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderRequest const& request) override; + + future> AsyncDeleteFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) + override; + + StatusOr DeleteFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) + override; + + StatusOr + QueryFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryFolderContentsRequest const& request) + override; + + StatusOr + QueryUserRootContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryUserRootContentsRequest const& request) + override; + + future> AsyncMoveFolder( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveFolderRequest const& request) override; + + StatusOr MoveFolder( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveFolderRequest const& request) override; + StatusOr ListRepositories(grpc::ClientContext& context, Options const& options, google::cloud::dataform::v1::ListRepositoriesRequest const& @@ -66,6 +160,18 @@ class DataformLogging : public DataformStub { google::cloud::dataform::v1::DeleteRepositoryRequest const& request) override; + future> AsyncMoveRepository( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) + override; + + StatusOr MoveRepository( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) + override; + StatusOr CommitRepositoryChanges( grpc::ClientContext& context, Options const& options, @@ -327,6 +433,18 @@ class DataformLogging : public DataformStub { grpc::ClientContext& context, Options const& options, google::cloud::dataform::v1::UpdateConfigRequest const& request) override; + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -335,17 +453,33 @@ class DataformLogging : public DataformStub { grpc::ClientContext& context, Options const& options, google::cloud::location::GetLocationRequest const& request) override; - StatusOr SetIamPolicy( + StatusOr ListOperations( grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) override; + google::longrunning::ListOperationsRequest const& request) override; - StatusOr GetIamPolicy( + StatusOr GetOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) override; + google::longrunning::GetOperationRequest const& request) override; - StatusOr TestIamPermissions( + Status DeleteOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) override; + 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_; diff --git a/google/cloud/dataform/v1/internal/dataform_metadata_decorator.cc b/google/cloud/dataform/v1/internal/dataform_metadata_decorator.cc index b81efbaa79ed7..c36cc314caa87 100644 --- a/google/cloud/dataform/v1/internal/dataform_metadata_decorator.cc +++ b/google/cloud/dataform/v1/internal/dataform_metadata_decorator.cc @@ -48,6 +48,175 @@ DataformMetadata::DataformMetadata( ? google::cloud::internal::GeneratedLibClientHeader() : std::move(api_client_header)) {} +StatusOr +DataformMetadata::GetTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetTeamFolderRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetTeamFolder(context, options, request); +} + +StatusOr +DataformMetadata::CreateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateTeamFolder(context, options, request); +} + +StatusOr +DataformMetadata::UpdateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) { + SetMetadata(context, options, + absl::StrCat("team_folder.name=", + internal::UrlEncode(request.team_folder().name()))); + return child_->UpdateTeamFolder(context, options, request); +} + +Status DataformMetadata::DeleteTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteTeamFolder(context, options, request); +} + +future> +DataformMetadata::AsyncDeleteTeamFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteTeamFolderTree(cq, std::move(context), + std::move(options), request); +} + +StatusOr DataformMetadata::DeleteTeamFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteTeamFolderTree(context, options, request); +} + +StatusOr +DataformMetadata::QueryTeamFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryTeamFolderContentsRequest const& + request) { + SetMetadata( + context, options, + absl::StrCat("team_folder=", internal::UrlEncode(request.team_folder()))); + return child_->QueryTeamFolderContents(context, options, request); +} + +StatusOr +DataformMetadata::SearchTeamFolders( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::SearchTeamFoldersRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("location=", internal::UrlEncode(request.location()))); + return child_->SearchTeamFolders(context, options, request); +} + +StatusOr DataformMetadata::GetFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetFolderRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetFolder(context, options, request); +} + +StatusOr DataformMetadata::CreateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateFolderRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateFolder(context, options, request); +} + +StatusOr DataformMetadata::UpdateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateFolderRequest const& request) { + SetMetadata(context, options, + absl::StrCat("folder.name=", + internal::UrlEncode(request.folder().name()))); + return child_->UpdateFolder(context, options, request); +} + +Status DataformMetadata::DeleteFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteFolder(context, options, request); +} + +future> +DataformMetadata::AsyncDeleteFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteFolderTree(cq, std::move(context), + std::move(options), request); +} + +StatusOr DataformMetadata::DeleteFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteFolderTree(context, options, request); +} + +StatusOr +DataformMetadata::QueryFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryFolderContentsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("folder=", internal::UrlEncode(request.folder()))); + return child_->QueryFolderContents(context, options, request); +} + +StatusOr +DataformMetadata::QueryUserRootContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryUserRootContentsRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("location=", internal::UrlEncode(request.location()))); + return child_->QueryUserRootContents(context, options, request); +} + +future> +DataformMetadata::AsyncMoveFolder( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveFolderRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncMoveFolder(cq, std::move(context), std::move(options), + request); +} + +StatusOr DataformMetadata::MoveFolder( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveFolderRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->MoveFolder(context, options, request); +} + StatusOr DataformMetadata::ListRepositories( grpc::ClientContext& context, Options const& options, @@ -93,6 +262,26 @@ Status DataformMetadata::DeleteRepository( return child_->DeleteRepository(context, options, request); } +future> +DataformMetadata::AsyncMoveRepository( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncMoveRepository(cq, std::move(context), std::move(options), + request); +} + +StatusOr DataformMetadata::MoveRepository( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->MoveRepository(context, options, request); +} + StatusOr DataformMetadata::CommitRepositoryChanges( grpc::ClientContext& context, Options const& options, @@ -554,6 +743,34 @@ StatusOr DataformMetadata::UpdateConfig( return child_->UpdateConfig(context, options, request); } +StatusOr DataformMetadata::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("resource=", internal::UrlEncode(request.resource()))); + return child_->GetIamPolicy(context, options, request); +} + +StatusOr DataformMetadata::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("resource=", internal::UrlEncode(request.resource()))); + return child_->SetIamPolicy(context, options, request); +} + +StatusOr +DataformMetadata::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("resource=", internal::UrlEncode(request.resource()))); + return child_->TestIamPermissions(context, options, request); +} + StatusOr DataformMetadata::ListLocations( grpc::ClientContext& context, Options const& options, @@ -571,32 +788,60 @@ StatusOr DataformMetadata::GetLocation( return child_->GetLocation(context, options, request); } -StatusOr DataformMetadata::SetIamPolicy( +StatusOr +DataformMetadata::ListOperations( grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { - SetMetadata( - context, options, - absl::StrCat("resource=", internal::UrlEncode(request.resource()))); - return child_->SetIamPolicy(context, options, request); + google::longrunning::ListOperationsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->ListOperations(context, options, request); } -StatusOr DataformMetadata::GetIamPolicy( +StatusOr DataformMetadata::GetOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) { - SetMetadata( - context, options, - absl::StrCat("resource=", internal::UrlEncode(request.resource()))); - return child_->GetIamPolicy(context, options, request); + google::longrunning::GetOperationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetOperation(context, options, request); } -StatusOr -DataformMetadata::TestIamPermissions( +Status DataformMetadata::DeleteOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) { - SetMetadata( - context, options, - absl::StrCat("resource=", internal::UrlEncode(request.resource()))); - return child_->TestIamPermissions(context, options, request); + google::longrunning::DeleteOperationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteOperation(context, options, request); +} + +Status DataformMetadata::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> +DataformMetadata::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 DataformMetadata::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 DataformMetadata::SetMetadata(grpc::ClientContext& context, diff --git a/google/cloud/dataform/v1/internal/dataform_metadata_decorator.h b/google/cloud/dataform/v1/internal/dataform_metadata_decorator.h index 9d14c0596375a..a860abff1462c 100644 --- a/google/cloud/dataform/v1/internal/dataform_metadata_decorator.h +++ b/google/cloud/dataform/v1/internal/dataform_metadata_decorator.h @@ -22,6 +22,7 @@ #include "google/cloud/dataform/v1/internal/dataform_stub.h" #include "google/cloud/options.h" #include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" #include #include #include @@ -41,6 +42,99 @@ class DataformMetadata : public DataformStub { std::multimap fixed_metadata, std::string api_client_header = ""); + StatusOr GetTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetTeamFolderRequest const& request) + override; + + StatusOr CreateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) + override; + + StatusOr UpdateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) + override; + + Status DeleteTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) + override; + + future> AsyncDeleteTeamFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + StatusOr DeleteTeamFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + StatusOr + QueryTeamFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryTeamFolderContentsRequest const& + request) override; + + StatusOr + SearchTeamFolders(grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::SearchTeamFoldersRequest const& + request) override; + + StatusOr GetFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetFolderRequest const& request) override; + + StatusOr CreateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateFolderRequest const& request) override; + + StatusOr UpdateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateFolderRequest const& request) override; + + Status DeleteFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderRequest const& request) override; + + future> AsyncDeleteFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) + override; + + StatusOr DeleteFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) + override; + + StatusOr + QueryFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryFolderContentsRequest const& request) + override; + + StatusOr + QueryUserRootContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryUserRootContentsRequest const& request) + override; + + future> AsyncMoveFolder( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveFolderRequest const& request) override; + + StatusOr MoveFolder( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveFolderRequest const& request) override; + StatusOr ListRepositories(grpc::ClientContext& context, Options const& options, google::cloud::dataform::v1::ListRepositoriesRequest const& @@ -66,6 +160,18 @@ class DataformMetadata : public DataformStub { google::cloud::dataform::v1::DeleteRepositoryRequest const& request) override; + future> AsyncMoveRepository( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) + override; + + StatusOr MoveRepository( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) + override; + StatusOr CommitRepositoryChanges( grpc::ClientContext& context, Options const& options, @@ -327,6 +433,18 @@ class DataformMetadata : public DataformStub { grpc::ClientContext& context, Options const& options, google::cloud::dataform::v1::UpdateConfigRequest const& request) override; + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -335,17 +453,33 @@ class DataformMetadata : public DataformStub { grpc::ClientContext& context, Options const& options, google::cloud::location::GetLocationRequest const& request) override; - StatusOr SetIamPolicy( + StatusOr ListOperations( grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) override; + google::longrunning::ListOperationsRequest const& request) override; - StatusOr GetIamPolicy( + StatusOr GetOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) override; + google::longrunning::GetOperationRequest const& request) override; - StatusOr TestIamPermissions( + Status DeleteOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) override; + 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, diff --git a/google/cloud/dataform/v1/internal/dataform_option_defaults.cc b/google/cloud/dataform/v1/internal/dataform_option_defaults.cc index db65d4f7bb608..d82d5ba6b5ab3 100644 --- a/google/cloud/dataform/v1/internal/dataform_option_defaults.cc +++ b/google/cloud/dataform/v1/internal/dataform_option_defaults.cc @@ -50,6 +50,16 @@ Options DataformDefaultOptions(Options options) { std::chrono::minutes(5), kBackoffScaling, kBackoffScaling) .clone()); } + if (!options.has()) { + options.set( + GenericPollingPolicy( + options.get()->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } if (!options.has()) { options.set( dataform_v1::MakeDefaultDataformConnectionIdempotencyPolicy()); diff --git a/google/cloud/dataform/v1/internal/dataform_stub.cc b/google/cloud/dataform/v1/internal/dataform_stub.cc index 062ab327efcdf..a1ad5763c42b6 100644 --- a/google/cloud/dataform/v1/internal/dataform_stub.cc +++ b/google/cloud/dataform/v1/internal/dataform_stub.cc @@ -20,6 +20,7 @@ #include "google/cloud/dataform/v1/dataform.grpc.pb.h" #include "google/cloud/grpc_error_delegate.h" #include "google/cloud/status_or.h" +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -33,6 +34,237 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN DataformStub::~DataformStub() = default; +StatusOr +DefaultDataformStub::GetTeamFolder( + grpc::ClientContext& context, Options const&, + google::cloud::dataform::v1::GetTeamFolderRequest const& request) { + google::cloud::dataform::v1::TeamFolder response; + auto status = grpc_stub_->GetTeamFolder(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataformStub::CreateTeamFolder( + grpc::ClientContext& context, Options const&, + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) { + google::cloud::dataform::v1::TeamFolder response; + auto status = grpc_stub_->CreateTeamFolder(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataformStub::UpdateTeamFolder( + grpc::ClientContext& context, Options const&, + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) { + google::cloud::dataform::v1::TeamFolder response; + auto status = grpc_stub_->UpdateTeamFolder(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultDataformStub::DeleteTeamFolder( + grpc::ClientContext& context, Options const&, + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteTeamFolder(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +future> +DefaultDataformStub::AsyncDeleteTeamFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteTeamFolderTree(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultDataformStub::DeleteTeamFolderTree( + grpc::ClientContext& context, Options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteTeamFolderTree(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataformStub::QueryTeamFolderContents( + grpc::ClientContext& context, Options const&, + google::cloud::dataform::v1::QueryTeamFolderContentsRequest const& + request) { + google::cloud::dataform::v1::QueryTeamFolderContentsResponse response; + auto status = + grpc_stub_->QueryTeamFolderContents(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataformStub::SearchTeamFolders( + grpc::ClientContext& context, Options const&, + google::cloud::dataform::v1::SearchTeamFoldersRequest const& request) { + google::cloud::dataform::v1::SearchTeamFoldersResponse response; + auto status = grpc_stub_->SearchTeamFolders(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultDataformStub::GetFolder( + grpc::ClientContext& context, Options const&, + google::cloud::dataform::v1::GetFolderRequest const& request) { + google::cloud::dataform::v1::Folder response; + auto status = grpc_stub_->GetFolder(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultDataformStub::CreateFolder( + grpc::ClientContext& context, Options const&, + google::cloud::dataform::v1::CreateFolderRequest const& request) { + google::cloud::dataform::v1::Folder response; + auto status = grpc_stub_->CreateFolder(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultDataformStub::UpdateFolder( + grpc::ClientContext& context, Options const&, + google::cloud::dataform::v1::UpdateFolderRequest const& request) { + google::cloud::dataform::v1::Folder response; + auto status = grpc_stub_->UpdateFolder(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultDataformStub::DeleteFolder( + grpc::ClientContext& context, Options const&, + google::cloud::dataform::v1::DeleteFolderRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteFolder(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +future> +DefaultDataformStub::AsyncDeleteFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataform::v1::DeleteFolderTreeRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteFolderTree(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultDataformStub::DeleteFolderTree( + grpc::ClientContext& context, Options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteFolderTree(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataformStub::QueryFolderContents( + grpc::ClientContext& context, Options const&, + google::cloud::dataform::v1::QueryFolderContentsRequest const& request) { + google::cloud::dataform::v1::QueryFolderContentsResponse response; + auto status = grpc_stub_->QueryFolderContents(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataformStub::QueryUserRootContents( + grpc::ClientContext& context, Options const&, + google::cloud::dataform::v1::QueryUserRootContentsRequest const& request) { + google::cloud::dataform::v1::QueryUserRootContentsResponse response; + auto status = grpc_stub_->QueryUserRootContents(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultDataformStub::AsyncMoveFolder( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataform::v1::MoveFolderRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataform::v1::MoveFolderRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::dataform::v1::MoveFolderRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncMoveFolder(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultDataformStub::MoveFolder( + grpc::ClientContext& context, Options, + google::cloud::dataform::v1::MoveFolderRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->MoveFolder(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultDataformStub::ListRepositories( grpc::ClientContext& context, Options const&, @@ -92,6 +324,35 @@ Status DefaultDataformStub::DeleteRepository( return google::cloud::Status(); } +future> +DefaultDataformStub::AsyncMoveRepository( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataform::v1::MoveRepositoryRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::dataform::v1::MoveRepositoryRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncMoveRepository(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultDataformStub::MoveRepository( + grpc::ClientContext& context, Options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->MoveRepository(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultDataformStub::CommitRepositoryChanges( grpc::ClientContext& context, Options const&, @@ -701,6 +962,40 @@ StatusOr DefaultDataformStub::UpdateConfig( return response; } +StatusOr DefaultDataformStub::GetIamPolicy( + grpc::ClientContext& context, Options const&, + google::iam::v1::GetIamPolicyRequest const& request) { + google::iam::v1::Policy response; + auto status = grpc_stub_->GetIamPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultDataformStub::SetIamPolicy( + grpc::ClientContext& context, Options const&, + google::iam::v1::SetIamPolicyRequest const& request) { + google::iam::v1::Policy response; + auto status = grpc_stub_->SetIamPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataformStub::TestIamPermissions( + grpc::ClientContext& context, Options const&, + google::iam::v1::TestIamPermissionsRequest const& request) { + google::iam::v1::TestIamPermissionsResponse response; + auto status = grpc_stub_->TestIamPermissions(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultDataformStub::ListLocations( grpc::ClientContext& context, Options const&, @@ -724,39 +1019,88 @@ StatusOr DefaultDataformStub::GetLocation( return response; } -StatusOr DefaultDataformStub::SetIamPolicy( +StatusOr +DefaultDataformStub::ListOperations( grpc::ClientContext& context, Options const&, - google::iam::v1::SetIamPolicyRequest const& request) { - google::iam::v1::Policy response; - auto status = iampolicy_stub_->SetIamPolicy(&context, request, &response); + 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 DefaultDataformStub::GetIamPolicy( +StatusOr DefaultDataformStub::GetOperation( grpc::ClientContext& context, Options const&, - google::iam::v1::GetIamPolicyRequest const& request) { - google::iam::v1::Policy response; - auto status = iampolicy_stub_->GetIamPolicy(&context, request, &response); + 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; } -StatusOr -DefaultDataformStub::TestIamPermissions( +Status DefaultDataformStub::DeleteOperation( grpc::ClientContext& context, Options const&, - google::iam::v1::TestIamPermissionsRequest const& request) { - google::iam::v1::TestIamPermissionsResponse response; - auto status = - iampolicy_stub_->TestIamPermissions(&context, request, &response); + 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 response; + return google::cloud::Status(); +} + +Status DefaultDataformStub::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> +DefaultDataformStub::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 DefaultDataformStub::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 diff --git a/google/cloud/dataform/v1/internal/dataform_stub.h b/google/cloud/dataform/v1/internal/dataform_stub.h index 14f4ac36a5705..3820e1d1d1f57 100644 --- a/google/cloud/dataform/v1/internal/dataform_stub.h +++ b/google/cloud/dataform/v1/internal/dataform_stub.h @@ -21,10 +21,12 @@ #include "google/cloud/dataform/v1/dataform.grpc.pb.h" #include "google/cloud/location/locations.grpc.pb.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 "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -40,6 +42,95 @@ class DataformStub { public: virtual ~DataformStub() = 0; + virtual StatusOr GetTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetTeamFolderRequest const& request) = 0; + + virtual StatusOr CreateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) = 0; + + virtual StatusOr UpdateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) = 0; + + virtual Status DeleteTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) = 0; + + virtual future> + AsyncDeleteTeamFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& + request) = 0; + + virtual StatusOr DeleteTeamFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& + request) = 0; + + virtual StatusOr + QueryTeamFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryTeamFolderContentsRequest const& + request) = 0; + + virtual StatusOr + SearchTeamFolders( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::SearchTeamFoldersRequest const& request) = 0; + + virtual StatusOr GetFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetFolderRequest const& request) = 0; + + virtual StatusOr CreateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateFolderRequest const& request) = 0; + + virtual StatusOr UpdateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateFolderRequest const& request) = 0; + + virtual Status DeleteFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderRequest const& request) = 0; + + virtual future> + AsyncDeleteFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) = 0; + + virtual StatusOr DeleteFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) = 0; + + virtual StatusOr + QueryFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryFolderContentsRequest const& + request) = 0; + + virtual StatusOr + QueryUserRootContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryUserRootContentsRequest const& + request) = 0; + + virtual future> AsyncMoveFolder( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveFolderRequest const& request) = 0; + + virtual StatusOr MoveFolder( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveFolderRequest const& request) = 0; + virtual StatusOr ListRepositories( grpc::ClientContext& context, Options const& options, @@ -61,6 +152,16 @@ class DataformStub { grpc::ClientContext& context, Options const& options, google::cloud::dataform::v1::DeleteRepositoryRequest const& request) = 0; + virtual future> AsyncMoveRepository( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) = 0; + + virtual StatusOr MoveRepository( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) = 0; + virtual StatusOr CommitRepositoryChanges( grpc::ClientContext& context, Options const& options, @@ -328,6 +429,19 @@ class DataformStub { grpc::ClientContext& context, Options const& options, google::cloud::dataform::v1::UpdateConfigRequest const& request) = 0; + virtual StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) = 0; + + virtual StatusOr SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) = 0; + + virtual StatusOr + TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) = 0; + virtual StatusOr ListLocations( grpc::ClientContext& context, Options const& options, @@ -337,31 +451,140 @@ class DataformStub { grpc::ClientContext& context, Options const& options, google::cloud::location::GetLocationRequest const& request) = 0; - virtual StatusOr SetIamPolicy( + virtual StatusOr ListOperations( grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) = 0; + google::longrunning::ListOperationsRequest const& request) = 0; - virtual StatusOr GetIamPolicy( + virtual StatusOr GetOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) = 0; + google::longrunning::GetOperationRequest const& request) = 0; - virtual StatusOr - TestIamPermissions( + virtual Status DeleteOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) = 0; + 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 DefaultDataformStub : public DataformStub { public: - explicit DefaultDataformStub( + DefaultDataformStub( std::unique_ptr grpc_stub, - std::unique_ptr iampolicy_stub, std::unique_ptr - locations_stub) + locations_stub, + std::unique_ptr + operations_stub) : grpc_stub_(std::move(grpc_stub)), - iampolicy_stub_(std::move(iampolicy_stub)), - locations_stub_(std::move(locations_stub)) {} + locations_stub_(std::move(locations_stub)), + operations_stub_(std::move(operations_stub)) {} + + StatusOr GetTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetTeamFolderRequest const& request) + override; + + StatusOr CreateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) + override; + + StatusOr UpdateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) + override; + + Status DeleteTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) + override; + + future> AsyncDeleteTeamFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + StatusOr DeleteTeamFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + StatusOr + QueryTeamFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryTeamFolderContentsRequest const& + request) override; + + StatusOr + SearchTeamFolders(grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::SearchTeamFoldersRequest const& + request) override; + + StatusOr GetFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetFolderRequest const& request) override; + + StatusOr CreateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateFolderRequest const& request) override; + + StatusOr UpdateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateFolderRequest const& request) override; + + Status DeleteFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderRequest const& request) override; + + future> AsyncDeleteFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) + override; + + StatusOr DeleteFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) + override; + + StatusOr + QueryFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryFolderContentsRequest const& request) + override; + + StatusOr + QueryUserRootContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryUserRootContentsRequest const& request) + override; + + future> AsyncMoveFolder( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveFolderRequest const& request) override; + + StatusOr MoveFolder( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveFolderRequest const& request) override; StatusOr ListRepositories(grpc::ClientContext& context, Options const& options, @@ -388,6 +611,18 @@ class DefaultDataformStub : public DataformStub { google::cloud::dataform::v1::DeleteRepositoryRequest const& request) override; + future> AsyncMoveRepository( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) + override; + + StatusOr MoveRepository( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) + override; + StatusOr CommitRepositoryChanges( grpc::ClientContext& context, Options const& options, @@ -649,6 +884,18 @@ class DefaultDataformStub : public DataformStub { grpc::ClientContext& context, Options const& options, google::cloud::dataform::v1::UpdateConfigRequest const& request) override; + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -657,24 +904,41 @@ class DefaultDataformStub : public DataformStub { grpc::ClientContext& context, Options const& options, google::cloud::location::GetLocationRequest const& request) override; - StatusOr SetIamPolicy( + StatusOr ListOperations( grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) override; + google::longrunning::ListOperationsRequest const& request) override; - StatusOr GetIamPolicy( + StatusOr GetOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) override; + google::longrunning::GetOperationRequest const& request) override; - StatusOr TestIamPermissions( + Status DeleteOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) override; + 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 grpc_stub_; - std::unique_ptr iampolicy_stub_; std::unique_ptr locations_stub_; + std::unique_ptr + operations_stub_; }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/dataform/v1/internal/dataform_stub_factory.cc b/google/cloud/dataform/v1/internal/dataform_stub_factory.cc index ebaea9036848e..1e09c9f2e9bd4 100644 --- a/google/cloud/dataform/v1/internal/dataform_stub_factory.cc +++ b/google/cloud/dataform/v1/internal/dataform_stub_factory.cc @@ -30,7 +30,7 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" -#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" #include #include @@ -49,12 +49,11 @@ std::shared_ptr CreateDefaultDataformStub( internal::MakeChannelArguments(options)); auto service_grpc_stub = google::cloud::dataform::v1::Dataform::NewStub(channel); - auto service_iampolicy_stub = google::iam::v1::IAMPolicy::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_iampolicy_stub), - std::move(service_locations_stub)); + 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)); diff --git a/google/cloud/dataform/v1/internal/dataform_tracing_connection.cc b/google/cloud/dataform/v1/internal/dataform_tracing_connection.cc index 2994f131c85e0..574efa2ae3776 100644 --- a/google/cloud/dataform/v1/internal/dataform_tracing_connection.cc +++ b/google/cloud/dataform/v1/internal/dataform_tracing_connection.cc @@ -31,6 +31,211 @@ DataformTracingConnection::DataformTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} +StatusOr +DataformTracingConnection::GetTeamFolder( + google::cloud::dataform::v1::GetTeamFolderRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::GetTeamFolder"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetTeamFolder(request)); +} + +StatusOr +DataformTracingConnection::CreateTeamFolder( + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::CreateTeamFolder"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateTeamFolder(request)); +} + +StatusOr +DataformTracingConnection::UpdateTeamFolder( + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::UpdateTeamFolder"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateTeamFolder(request)); +} + +Status DataformTracingConnection::DeleteTeamFolder( + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::DeleteTeamFolder"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteTeamFolder(request)); +} + +future> +DataformTracingConnection::DeleteTeamFolderTree( + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) { + auto span = internal::MakeSpan( + "dataform_v1::DataformConnection::DeleteTeamFolderTree"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteTeamFolderTree(request)); +} + +StatusOr +DataformTracingConnection::DeleteTeamFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) { + auto span = internal::MakeSpan( + "dataform_v1::DataformConnection::DeleteTeamFolderTree"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteTeamFolderTree(NoAwaitTag{}, request)); +} + +future> +DataformTracingConnection::DeleteTeamFolderTree( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataform_v1::DataformConnection::DeleteTeamFolderTree"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteTeamFolderTree(operation)); +} + +StreamRange +DataformTracingConnection::QueryTeamFolderContents( + google::cloud::dataform::v1::QueryTeamFolderContentsRequest request) { + auto span = internal::MakeSpan( + "dataform_v1::DataformConnection::QueryTeamFolderContents"); + internal::OTelScope scope(span); + auto sr = child_->QueryTeamFolderContents(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::dataform::v1::QueryTeamFolderContentsResponse:: + TeamFolderContentsEntry>(std::move(span), std::move(sr)); +} + +StreamRange +DataformTracingConnection::SearchTeamFolders( + google::cloud::dataform::v1::SearchTeamFoldersRequest request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::SearchTeamFolders"); + internal::OTelScope scope(span); + auto sr = child_->SearchTeamFolders(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::dataform::v1::SearchTeamFoldersResponse:: + TeamFolderSearchResult>(std::move(span), std::move(sr)); +} + +StatusOr +DataformTracingConnection::GetFolder( + google::cloud::dataform::v1::GetFolderRequest const& request) { + auto span = internal::MakeSpan("dataform_v1::DataformConnection::GetFolder"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetFolder(request)); +} + +StatusOr +DataformTracingConnection::CreateFolder( + google::cloud::dataform::v1::CreateFolderRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::CreateFolder"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateFolder(request)); +} + +StatusOr +DataformTracingConnection::UpdateFolder( + google::cloud::dataform::v1::UpdateFolderRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::UpdateFolder"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateFolder(request)); +} + +Status DataformTracingConnection::DeleteFolder( + google::cloud::dataform::v1::DeleteFolderRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::DeleteFolder"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteFolder(request)); +} + +future> +DataformTracingConnection::DeleteFolderTree( + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::DeleteFolderTree"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteFolderTree(request)); +} + +StatusOr +DataformTracingConnection::DeleteFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::DeleteFolderTree"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteFolderTree(NoAwaitTag{}, request)); +} + +future> +DataformTracingConnection::DeleteFolderTree( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::DeleteFolderTree"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteFolderTree(operation)); +} + +StreamRange +DataformTracingConnection::QueryFolderContents( + google::cloud::dataform::v1::QueryFolderContentsRequest request) { + auto span = internal::MakeSpan( + "dataform_v1::DataformConnection::QueryFolderContents"); + internal::OTelScope scope(span); + auto sr = child_->QueryFolderContents(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::dataform::v1::QueryFolderContentsResponse:: + FolderContentsEntry>(std::move(span), std::move(sr)); +} + +StreamRange +DataformTracingConnection::QueryUserRootContents( + google::cloud::dataform::v1::QueryUserRootContentsRequest request) { + auto span = internal::MakeSpan( + "dataform_v1::DataformConnection::QueryUserRootContents"); + internal::OTelScope scope(span); + auto sr = child_->QueryUserRootContents(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::dataform::v1::QueryUserRootContentsResponse:: + RootContentsEntry>(std::move(span), std::move(sr)); +} + +future> +DataformTracingConnection::MoveFolder( + google::cloud::dataform::v1::MoveFolderRequest const& request) { + auto span = internal::MakeSpan("dataform_v1::DataformConnection::MoveFolder"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->MoveFolder(request)); +} + +StatusOr DataformTracingConnection::MoveFolder( + NoAwaitTag, google::cloud::dataform::v1::MoveFolderRequest const& request) { + auto span = internal::MakeSpan("dataform_v1::DataformConnection::MoveFolder"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->MoveFolder(NoAwaitTag{}, request)); +} + +future> +DataformTracingConnection::MoveFolder( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan("dataform_v1::DataformConnection::MoveFolder"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->MoveFolder(operation)); +} + StreamRange DataformTracingConnection::ListRepositories( google::cloud::dataform::v1::ListRepositoriesRequest request) { @@ -77,6 +282,35 @@ Status DataformTracingConnection::DeleteRepository( return internal::EndSpan(*span, child_->DeleteRepository(request)); } +future> +DataformTracingConnection::MoveRepository( + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::MoveRepository"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->MoveRepository(request)); +} + +StatusOr +DataformTracingConnection::MoveRepository( + NoAwaitTag, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::MoveRepository"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->MoveRepository(NoAwaitTag{}, request)); +} + +future> +DataformTracingConnection::MoveRepository( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::MoveRepository"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->MoveRepository(operation)); +} + StatusOr DataformTracingConnection::CommitRepositoryChanges( google::cloud::dataform::v1::CommitRepositoryChangesRequest const& @@ -551,6 +785,31 @@ DataformTracingConnection::UpdateConfig( return internal::EndSpan(*span, child_->UpdateConfig(request)); } +StatusOr DataformTracingConnection::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::GetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetIamPolicy(request)); +} + +StatusOr DataformTracingConnection::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::SetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->SetIamPolicy(request)); +} + +StatusOr +DataformTracingConnection::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::TestIamPermissions"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->TestIamPermissions(request)); +} + StreamRange DataformTracingConnection::ListLocations( google::cloud::location::ListLocationsRequest request) { @@ -571,29 +830,40 @@ DataformTracingConnection::GetLocation( return internal::EndSpan(*span, child_->GetLocation(request)); } -StatusOr DataformTracingConnection::SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request) { +StreamRange +DataformTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { auto span = - internal::MakeSpan("dataform_v1::DataformConnection::SetIamPolicy"); + internal::MakeSpan("dataform_v1::DataformConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +DataformTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = + internal::MakeSpan("dataform_v1::DataformConnection::GetOperation"); auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->SetIamPolicy(request)); + return internal::EndSpan(*span, child_->GetOperation(request)); } -StatusOr DataformTracingConnection::GetIamPolicy( - google::iam::v1::GetIamPolicyRequest const& request) { +Status DataformTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { auto span = - internal::MakeSpan("dataform_v1::DataformConnection::GetIamPolicy"); + internal::MakeSpan("dataform_v1::DataformConnection::DeleteOperation"); auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->GetIamPolicy(request)); + return internal::EndSpan(*span, child_->DeleteOperation(request)); } -StatusOr -DataformTracingConnection::TestIamPermissions( - google::iam::v1::TestIamPermissionsRequest const& request) { +Status DataformTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { auto span = - internal::MakeSpan("dataform_v1::DataformConnection::TestIamPermissions"); + internal::MakeSpan("dataform_v1::DataformConnection::CancelOperation"); auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->TestIamPermissions(request)); + return internal::EndSpan(*span, child_->CancelOperation(request)); } std::shared_ptr MakeDataformTracingConnection( diff --git a/google/cloud/dataform/v1/internal/dataform_tracing_connection.h b/google/cloud/dataform/v1/internal/dataform_tracing_connection.h index 315c3fad6325b..b65f08a26606d 100644 --- a/google/cloud/dataform/v1/internal/dataform_tracing_connection.h +++ b/google/cloud/dataform/v1/internal/dataform_tracing_connection.h @@ -37,6 +37,92 @@ class DataformTracingConnection : public dataform_v1::DataformConnection { Options options() override { return child_->options(); } + StatusOr GetTeamFolder( + google::cloud::dataform::v1::GetTeamFolderRequest const& request) + override; + + StatusOr CreateTeamFolder( + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) + override; + + StatusOr UpdateTeamFolder( + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) + override; + + Status DeleteTeamFolder( + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) + override; + + future> + DeleteTeamFolderTree( + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + StatusOr DeleteTeamFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + future> + DeleteTeamFolderTree( + google::longrunning::Operation const& operation) override; + + StreamRange + QueryTeamFolderContents( + google::cloud::dataform::v1::QueryTeamFolderContentsRequest request) + override; + + StreamRange + SearchTeamFolders( + google::cloud::dataform::v1::SearchTeamFoldersRequest request) override; + + StatusOr GetFolder( + google::cloud::dataform::v1::GetFolderRequest const& request) override; + + StatusOr CreateFolder( + google::cloud::dataform::v1::CreateFolderRequest const& request) override; + + StatusOr UpdateFolder( + google::cloud::dataform::v1::UpdateFolderRequest const& request) override; + + Status DeleteFolder( + google::cloud::dataform::v1::DeleteFolderRequest const& request) override; + + future> + DeleteFolderTree(google::cloud::dataform::v1::DeleteFolderTreeRequest const& + request) override; + + StatusOr DeleteFolderTree( + NoAwaitTag, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) + override; + + future> + DeleteFolderTree(google::longrunning::Operation const& operation) override; + + StreamRange + QueryFolderContents( + google::cloud::dataform::v1::QueryFolderContentsRequest request) override; + + StreamRange + QueryUserRootContents( + google::cloud::dataform::v1::QueryUserRootContentsRequest request) + override; + + future> MoveFolder( + google::cloud::dataform::v1::MoveFolderRequest const& request) override; + + StatusOr MoveFolder( + NoAwaitTag, + google::cloud::dataform::v1::MoveFolderRequest const& request) override; + + future> MoveFolder( + google::longrunning::Operation const& operation) override; + StreamRange ListRepositories( google::cloud::dataform::v1::ListRepositoriesRequest request) override; @@ -56,6 +142,18 @@ class DataformTracingConnection : public dataform_v1::DataformConnection { google::cloud::dataform::v1::DeleteRepositoryRequest const& request) override; + future> + MoveRepository(google::cloud::dataform::v1::MoveRepositoryRequest const& + request) override; + + StatusOr MoveRepository( + NoAwaitTag, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) + override; + + future> + MoveRepository(google::longrunning::Operation const& operation) override; + StatusOr CommitRepositoryChanges( google::cloud::dataform::v1::CommitRepositoryChangesRequest const& @@ -262,20 +360,32 @@ class DataformTracingConnection : public dataform_v1::DataformConnection { StatusOr UpdateConfig( google::cloud::dataform::v1::UpdateConfigRequest const& request) override; + StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request) override; + StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; StatusOr GetLocation( google::cloud::location::GetLocationRequest const& request) override; - StatusOr SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request) override; + StreamRange ListOperations( + google::longrunning::ListOperationsRequest request) override; - StatusOr GetIamPolicy( - google::iam::v1::GetIamPolicyRequest const& request) override; + StatusOr GetOperation( + google::longrunning::GetOperationRequest const& request) override; - StatusOr TestIamPermissions( - google::iam::v1::TestIamPermissionsRequest const& request) override; + Status DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + google::longrunning::CancelOperationRequest const& request) override; private: std::shared_ptr child_; diff --git a/google/cloud/dataform/v1/internal/dataform_tracing_stub.cc b/google/cloud/dataform/v1/internal/dataform_tracing_stub.cc index ef66162ed85f3..774c501fdbfed 100644 --- a/google/cloud/dataform/v1/internal/dataform_tracing_stub.cc +++ b/google/cloud/dataform/v1/internal/dataform_tracing_stub.cc @@ -32,6 +32,225 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN DataformTracingStub::DataformTracingStub(std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} +StatusOr +DataformTracingStub::GetTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetTeamFolderRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "GetTeamFolder"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetTeamFolder(context, options, request)); +} + +StatusOr +DataformTracingStub::CreateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "CreateTeamFolder"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateTeamFolder(context, options, request)); +} + +StatusOr +DataformTracingStub::UpdateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "UpdateTeamFolder"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateTeamFolder(context, options, request)); +} + +Status DataformTracingStub::DeleteTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "DeleteTeamFolder"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteTeamFolder(context, options, request)); +} + +future> +DataformTracingStub::AsyncDeleteTeamFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "DeleteTeamFolderTree"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteTeamFolderTree(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +DataformTracingStub::DeleteTeamFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "DeleteTeamFolderTree"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteTeamFolderTree(context, options, request)); +} + +StatusOr +DataformTracingStub::QueryTeamFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryTeamFolderContentsRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "QueryTeamFolderContents"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->QueryTeamFolderContents(context, options, request)); +} + +StatusOr +DataformTracingStub::SearchTeamFolders( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::SearchTeamFoldersRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "SearchTeamFolders"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->SearchTeamFolders(context, options, request)); +} + +StatusOr DataformTracingStub::GetFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetFolderRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", "GetFolder"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetFolder(context, options, request)); +} + +StatusOr DataformTracingStub::CreateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateFolderRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "CreateFolder"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateFolder(context, options, request)); +} + +StatusOr DataformTracingStub::UpdateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateFolderRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "UpdateFolder"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateFolder(context, options, request)); +} + +Status DataformTracingStub::DeleteFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "DeleteFolder"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteFolder(context, options, request)); +} + +future> +DataformTracingStub::AsyncDeleteFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "DeleteFolderTree"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteFolderTree(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr DataformTracingStub::DeleteFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "DeleteFolderTree"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteFolderTree(context, options, request)); +} + +StatusOr +DataformTracingStub::QueryFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryFolderContentsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "QueryFolderContents"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->QueryFolderContents(context, options, request)); +} + +StatusOr +DataformTracingStub::QueryUserRootContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryUserRootContentsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "QueryUserRootContents"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->QueryUserRootContents(context, options, request)); +} + +future> +DataformTracingStub::AsyncMoveFolder( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveFolderRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", "MoveFolder"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncMoveFolder(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr DataformTracingStub::MoveFolder( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveFolderRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", "MoveFolder"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->MoveFolder(context, options, request)); +} + StatusOr DataformTracingStub::ListRepositories( grpc::ClientContext& context, Options const& options, @@ -91,6 +310,32 @@ Status DataformTracingStub::DeleteRepository( child_->DeleteRepository(context, options, request)); } +future> +DataformTracingStub::AsyncMoveRepository( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "MoveRepository"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncMoveRepository(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr DataformTracingStub::MoveRepository( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "MoveRepository"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->MoveRepository(context, options, request)); +} + StatusOr DataformTracingStub::CommitRepositoryChanges( grpc::ClientContext& context, Options const& options, @@ -698,6 +943,40 @@ StatusOr DataformTracingStub::UpdateConfig( child_->UpdateConfig(context, options, request)); } +StatusOr DataformTracingStub::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "GetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetIamPolicy(context, options, request)); +} + +StatusOr DataformTracingStub::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "SetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->SetIamPolicy(context, options, request)); +} + +StatusOr +DataformTracingStub::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "TestIamPermissions"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->TestIamPermissions(context, options, request)); +} + StatusOr DataformTracingStub::ListLocations( grpc::ClientContext& context, Options const& options, @@ -721,38 +1000,77 @@ StatusOr DataformTracingStub::GetLocation( child_->GetLocation(context, options, request)); } -StatusOr DataformTracingStub::SetIamPolicy( +StatusOr +DataformTracingStub::ListOperations( grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { + google::longrunning::ListOperationsRequest const& request) { auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", - "SetIamPolicy"); + "ListOperations"); auto scope = opentelemetry::trace::Scope(span); internal::InjectTraceContext(context, *propagator_); return internal::EndSpan(context, *span, - child_->SetIamPolicy(context, options, request)); + child_->ListOperations(context, options, request)); } -StatusOr DataformTracingStub::GetIamPolicy( +StatusOr DataformTracingStub::GetOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) { + google::longrunning::GetOperationRequest const& request) { auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", - "GetIamPolicy"); + "GetOperation"); auto scope = opentelemetry::trace::Scope(span); internal::InjectTraceContext(context, *propagator_); return internal::EndSpan(context, *span, - child_->GetIamPolicy(context, options, request)); + child_->GetOperation(context, options, request)); } -StatusOr -DataformTracingStub::TestIamPermissions( +Status DataformTracingStub::DeleteOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) { + google::longrunning::DeleteOperationRequest const& request) { auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", - "TestIamPermissions"); + "DeleteOperation"); auto scope = opentelemetry::trace::Scope(span); internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan( - context, *span, child_->TestIamPermissions(context, options, request)); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status DataformTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataform.v1.Dataform", + "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +DataformTracingStub::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 DataformTracingStub::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)); } std::shared_ptr MakeDataformTracingStub( diff --git a/google/cloud/dataform/v1/internal/dataform_tracing_stub.h b/google/cloud/dataform/v1/internal/dataform_tracing_stub.h index c53c8eb32f529..be685cbebf49d 100644 --- a/google/cloud/dataform/v1/internal/dataform_tracing_stub.h +++ b/google/cloud/dataform/v1/internal/dataform_tracing_stub.h @@ -39,6 +39,99 @@ class DataformTracingStub : public DataformStub { explicit DataformTracingStub(std::shared_ptr child); + StatusOr GetTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetTeamFolderRequest const& request) + override; + + StatusOr CreateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateTeamFolderRequest const& request) + override; + + StatusOr UpdateTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateTeamFolderRequest const& request) + override; + + Status DeleteTeamFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteTeamFolderRequest const& request) + override; + + future> AsyncDeleteTeamFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + StatusOr DeleteTeamFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request) + override; + + StatusOr + QueryTeamFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryTeamFolderContentsRequest const& + request) override; + + StatusOr + SearchTeamFolders(grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::SearchTeamFoldersRequest const& + request) override; + + StatusOr GetFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::GetFolderRequest const& request) override; + + StatusOr CreateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::CreateFolderRequest const& request) override; + + StatusOr UpdateFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::UpdateFolderRequest const& request) override; + + Status DeleteFolder( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::DeleteFolderRequest const& request) override; + + future> AsyncDeleteFolderTree( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) + override; + + StatusOr DeleteFolderTree( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request) + override; + + StatusOr + QueryFolderContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryFolderContentsRequest const& request) + override; + + StatusOr + QueryUserRootContents( + grpc::ClientContext& context, Options const& options, + google::cloud::dataform::v1::QueryUserRootContentsRequest const& request) + override; + + future> AsyncMoveFolder( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveFolderRequest const& request) override; + + StatusOr MoveFolder( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveFolderRequest const& request) override; + StatusOr ListRepositories(grpc::ClientContext& context, Options const& options, google::cloud::dataform::v1::ListRepositoriesRequest const& @@ -64,6 +157,18 @@ class DataformTracingStub : public DataformStub { google::cloud::dataform::v1::DeleteRepositoryRequest const& request) override; + future> AsyncMoveRepository( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) + override; + + StatusOr MoveRepository( + grpc::ClientContext& context, Options options, + google::cloud::dataform::v1::MoveRepositoryRequest const& request) + override; + StatusOr CommitRepositoryChanges( grpc::ClientContext& context, Options const& options, @@ -325,6 +430,18 @@ class DataformTracingStub : public DataformStub { grpc::ClientContext& context, Options const& options, google::cloud::dataform::v1::UpdateConfigRequest const& request) override; + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; @@ -333,17 +450,33 @@ class DataformTracingStub : public DataformStub { grpc::ClientContext& context, Options const& options, google::cloud::location::GetLocationRequest const& request) override; - StatusOr SetIamPolicy( + StatusOr ListOperations( grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) override; + google::longrunning::ListOperationsRequest const& request) override; - StatusOr GetIamPolicy( + StatusOr GetOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) override; + google::longrunning::GetOperationRequest const& request) override; - StatusOr TestIamPermissions( + Status DeleteOperation( grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) override; + 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_; diff --git a/google/cloud/dataform/v1/mocks/mock_dataform_connection.h b/google/cloud/dataform/v1/mocks/mock_dataform_connection.h index 2812f13bd57da..6c59165cd6d10 100644 --- a/google/cloud/dataform/v1/mocks/mock_dataform_connection.h +++ b/google/cloud/dataform/v1/mocks/mock_dataform_connection.h @@ -46,6 +46,188 @@ class MockDataformConnection : public dataform_v1::DataformConnection { public: MOCK_METHOD(Options, options, (), (override)); + MOCK_METHOD( + StatusOr, GetTeamFolder, + (google::cloud::dataform::v1::GetTeamFolderRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, CreateTeamFolder, + (google::cloud::dataform::v1::CreateTeamFolderRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, UpdateTeamFolder, + (google::cloud::dataform::v1::UpdateTeamFolderRequest const& request), + (override)); + + MOCK_METHOD( + Status, DeleteTeamFolder, + (google::cloud::dataform::v1::DeleteTeamFolderRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteTeamFolderTree(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteTeamFolderTree, + (google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteTeamFolderTree(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteTeamFolderTree, + (NoAwaitTag, + google::cloud::dataform::v1::DeleteTeamFolderTreeRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteTeamFolderTree(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteTeamFolderTree, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + (StreamRange< + google::cloud::dataform::v1::QueryTeamFolderContentsResponse:: + TeamFolderContentsEntry>), + QueryTeamFolderContents, + (google::cloud::dataform::v1::QueryTeamFolderContentsRequest request), + (override)); + + MOCK_METHOD( + (StreamRange), + SearchTeamFolders, + (google::cloud::dataform::v1::SearchTeamFoldersRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetFolder, + (google::cloud::dataform::v1::GetFolderRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, CreateFolder, + (google::cloud::dataform::v1::CreateFolderRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, UpdateFolder, + (google::cloud::dataform::v1::UpdateFolderRequest const& request), + (override)); + + MOCK_METHOD(Status, DeleteFolder, + (google::cloud::dataform::v1::DeleteFolderRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteFolderTree(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteFolderTree, + (google::cloud::dataform::v1::DeleteFolderTreeRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteFolderTree(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteFolderTree, + (NoAwaitTag, + google::cloud::dataform::v1::DeleteFolderTreeRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteFolderTree(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteFolderTree, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + (StreamRange), + QueryFolderContents, + (google::cloud::dataform::v1::QueryFolderContentsRequest request), + (override)); + + MOCK_METHOD( + (StreamRange), + QueryUserRootContents, + (google::cloud::dataform::v1::QueryUserRootContentsRequest request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// MoveFolder(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + MoveFolder, + (google::cloud::dataform::v1::MoveFolderRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, MoveFolder(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, MoveFolder, + (NoAwaitTag, + google::cloud::dataform::v1::MoveFolderRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, MoveFolder(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + MoveFolder, (google::longrunning::Operation const& operation), + (override)); + MOCK_METHOD((StreamRange), ListRepositories, (google::cloud::dataform::v1::ListRepositoriesRequest request), @@ -71,6 +253,46 @@ class MockDataformConnection : public dataform_v1::DataformConnection { (google::cloud::dataform::v1::DeleteRepositoryRequest const& request), (override)); + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// MoveRepository(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + MoveRepository, + (google::cloud::dataform::v1::MoveRepositoryRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, MoveRepository(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, MoveRepository, + (NoAwaitTag, + google::cloud::dataform::v1::MoveRepositoryRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, MoveRepository(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + MoveRepository, (google::longrunning::Operation const& operation), + (override)); + MOCK_METHOD( StatusOr, CommitRepositoryChanges, @@ -351,6 +573,19 @@ class MockDataformConnection : public dataform_v1::DataformConnection { (google::cloud::dataform::v1::UpdateConfigRequest const& request), (override)); + MOCK_METHOD(StatusOr, GetIamPolicy, + (google::iam::v1::GetIamPolicyRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, SetIamPolicy, + (google::iam::v1::SetIamPolicyRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, + TestIamPermissions, + (google::iam::v1::TestIamPermissionsRequest const& request), + (override)); + MOCK_METHOD((StreamRange), ListLocations, (google::cloud::location::ListLocationsRequest request), (override)); @@ -359,17 +594,19 @@ class MockDataformConnection : public dataform_v1::DataformConnection { (google::cloud::location::GetLocationRequest const& request), (override)); - MOCK_METHOD(StatusOr, SetIamPolicy, - (google::iam::v1::SetIamPolicyRequest const& request), + MOCK_METHOD((StreamRange), ListOperations, + (google::longrunning::ListOperationsRequest request), (override)); + + MOCK_METHOD(StatusOr, GetOperation, + (google::longrunning::GetOperationRequest const& request), (override)); - MOCK_METHOD(StatusOr, GetIamPolicy, - (google::iam::v1::GetIamPolicyRequest const& request), + MOCK_METHOD(Status, DeleteOperation, + (google::longrunning::DeleteOperationRequest const& request), (override)); - MOCK_METHOD(StatusOr, - TestIamPermissions, - (google::iam::v1::TestIamPermissionsRequest const& request), + MOCK_METHOD(Status, CancelOperation, + (google::longrunning::CancelOperationRequest const& request), (override)); }; diff --git a/google/cloud/dataform/v1/samples/dataform_client_samples.cc b/google/cloud/dataform/v1/samples/dataform_client_samples.cc index 50877c33f51a3..b4317de7c7d8f 100644 --- a/google/cloud/dataform/v1/samples/dataform_client_samples.cc +++ b/google/cloud/dataform/v1/samples/dataform_client_samples.cc @@ -22,6 +22,7 @@ #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 "google/cloud/universe_domain.h" #include @@ -31,6 +32,7 @@ // clang-format off // main-dox-marker: dataform_v1::DataformClient +// lro-marker: true // clang-format on namespace { @@ -124,6 +126,43 @@ void SetRetryPolicy(std::vector const& argv) { //! [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::dataform_v1::DataformRetryPolicyOption::Type, + google::cloud::dataform_v1::DataformBackoffPolicyOption:: + Type>( + google::cloud::dataform_v1::DataformLimitedTimeRetryPolicy( + /*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::dataform_v1::MakeDataformConnection(options); + + // c1 and c2 share the same polling policies. + auto c1 = google::cloud::dataform_v1::DataformClient(connection); + auto c2 = google::cloud::dataform_v1::DataformClient(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 "}; @@ -158,6 +197,9 @@ void AutoRun(std::vector const& argv) { 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}); @@ -171,6 +213,7 @@ 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}, {"set-client-universe-domain", SetClientUniverseDomain}, {"auto", AutoRun}, diff --git a/google/cloud/datafusion/quickstart/.bazelversion b/google/cloud/datafusion/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/datafusion/quickstart/.bazelversion +++ b/google/cloud/datafusion/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/datafusion/quickstart/WORKSPACE.bazel b/google/cloud/datafusion/quickstart/WORKSPACE.bazel index 709958801a07e..27cefa228f9d3 100644 --- a/google/cloud/datafusion/quickstart/WORKSPACE.bazel +++ b/google/cloud/datafusion/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/datamigration/quickstart/.bazelversion b/google/cloud/datamigration/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/datamigration/quickstart/.bazelversion +++ b/google/cloud/datamigration/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/datamigration/quickstart/WORKSPACE.bazel b/google/cloud/datamigration/quickstart/WORKSPACE.bazel index 9089b3cca8d81..0933088531c00 100644 --- a/google/cloud/datamigration/quickstart/WORKSPACE.bazel +++ b/google/cloud/datamigration/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/datamigration/v1/data_migration_client.h b/google/cloud/datamigration/v1/data_migration_client.h index 5ba2030063c9e..ad12f389654ce 100644 --- a/google/cloud/datamigration/v1/data_migration_client.h +++ b/google/cloud/datamigration/v1/data_migration_client.h @@ -3665,7 +3665,7 @@ class DataMigrationServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -3704,7 +3704,7 @@ class DataMigrationServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataplex/doc/environment-variables.dox b/google/cloud/dataplex/doc/environment-variables.dox index 65c34e0b913cd..b4c4dc936c2b5 100644 --- a/google/cloud/dataplex/doc/environment-variables.dox +++ b/google/cloud/dataplex/doc/environment-variables.dox @@ -9,10 +9,18 @@ environment variables are convenient when troubleshooting problems. +- `GOOGLE_CLOUD_CPP_BUSINESS_GLOSSARY_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "dataplex.googleapis.com") + used by `MakeBusinessGlossaryServiceConnection()`. + - `GOOGLE_CLOUD_CPP_CATALOG_SERVICE_ENDPOINT=...` overrides the `EndpointOption` (which defaults to "dataplex.googleapis.com") used by `MakeCatalogServiceConnection()`. +- `GOOGLE_CLOUD_CPP_CMEK_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "dataplex.googleapis.com") + used by `MakeCmekServiceConnection()`. + - `GOOGLE_CLOUD_CPP_CONTENT_SERVICE_ENDPOINT=...` overrides the `EndpointOption` (which defaults to "dataplex.googleapis.com") used by `MakeContentServiceConnection()`. @@ -21,6 +29,10 @@ environment variables are convenient when troubleshooting problems. `EndpointOption` (which defaults to "dataplex.googleapis.com") used by `MakeDataplexServiceConnection()`. +- `GOOGLE_CLOUD_CPP_DATA_PRODUCT_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "dataplex.googleapis.com") + used by `MakeDataProductServiceConnection()`. + - `GOOGLE_CLOUD_CPP_DATA_SCAN_SERVICE_ENDPOINT=...` overrides the `EndpointOption` (which defaults to "dataplex.googleapis.com") used by `MakeDataScanServiceConnection()`. diff --git a/google/cloud/dataplex/doc/main.dox b/google/cloud/dataplex/doc/main.dox index 462b7069a4162..53addeab33ad2 100644 --- a/google/cloud/dataplex/doc/main.dox +++ b/google/cloud/dataplex/doc/main.dox @@ -31,8 +31,11 @@ The library also has other classes that provide helpers, configuration parameters, and infrastructure to mock the `*Client` classes when testing your application. +- [\c dataplex_v1::BusinessGlossaryServiceClient](@ref google::cloud::dataplex_v1::BusinessGlossaryServiceClient) - [\c dataplex_v1::CatalogServiceClient](@ref google::cloud::dataplex_v1::CatalogServiceClient) +- [\c dataplex_v1::CmekServiceClient](@ref google::cloud::dataplex_v1::CmekServiceClient) - [\c dataplex_v1::ContentServiceClient](@ref google::cloud::dataplex_v1::ContentServiceClient) +- [\c dataplex_v1::DataProductServiceClient](@ref google::cloud::dataplex_v1::DataProductServiceClient) - [\c dataplex_v1::DataScanServiceClient](@ref google::cloud::dataplex_v1::DataScanServiceClient) - [\c dataplex_v1::DataTaxonomyServiceClient](@ref google::cloud::dataplex_v1::DataTaxonomyServiceClient) - [\c dataplex_v1::DataplexServiceClient](@ref google::cloud::dataplex_v1::DataplexServiceClient) diff --git a/google/cloud/dataplex/doc/override-authentication.dox b/google/cloud/dataplex/doc/override-authentication.dox index 3bb1352afc1f5..d5a68a9d6cebc 100644 --- a/google/cloud/dataplex/doc/override-authentication.dox +++ b/google/cloud/dataplex/doc/override-authentication.dox @@ -9,12 +9,15 @@ this default. You can do so by providing the The following example shows how to explicitly load a service account key file: -@snippet catalog_client_samples.cc with-service-account +@snippet business_glossary_client_samples.cc with-service-account Follow these links to find examples for other \c *Client classes: +- [\c dataplex_v1::BusinessGlossaryServiceClient](@ref dataplex_v1::BusinessGlossaryServiceClient-service-account-snippet) - [\c dataplex_v1::CatalogServiceClient](@ref dataplex_v1::CatalogServiceClient-service-account-snippet) +- [\c dataplex_v1::CmekServiceClient](@ref dataplex_v1::CmekServiceClient-service-account-snippet) - [\c dataplex_v1::ContentServiceClient](@ref dataplex_v1::ContentServiceClient-service-account-snippet) +- [\c dataplex_v1::DataProductServiceClient](@ref dataplex_v1::DataProductServiceClient-service-account-snippet) - [\c dataplex_v1::DataScanServiceClient](@ref dataplex_v1::DataScanServiceClient-service-account-snippet) - [\c dataplex_v1::DataTaxonomyServiceClient](@ref dataplex_v1::DataTaxonomyServiceClient-service-account-snippet) - [\c dataplex_v1::DataplexServiceClient](@ref dataplex_v1::DataplexServiceClient-service-account-snippet) @@ -36,18 +39,36 @@ guide for more details. // +/*! @page dataplex_v1::BusinessGlossaryServiceClient-service-account-snippet Override dataplex_v1::BusinessGlossaryServiceClient Authentication Defaults + +@snippet google/cloud/dataplex/v1/samples/business_glossary_client_samples.cc with-service-account + +*/ + /*! @page dataplex_v1::CatalogServiceClient-service-account-snippet Override dataplex_v1::CatalogServiceClient Authentication Defaults @snippet google/cloud/dataplex/v1/samples/catalog_client_samples.cc with-service-account */ +/*! @page dataplex_v1::CmekServiceClient-service-account-snippet Override dataplex_v1::CmekServiceClient Authentication Defaults + +@snippet google/cloud/dataplex/v1/samples/cmek_client_samples.cc with-service-account + +*/ + /*! @page dataplex_v1::ContentServiceClient-service-account-snippet Override dataplex_v1::ContentServiceClient Authentication Defaults @snippet google/cloud/dataplex/v1/samples/content_client_samples.cc with-service-account */ +/*! @page dataplex_v1::DataProductServiceClient-service-account-snippet Override dataplex_v1::DataProductServiceClient Authentication Defaults + +@snippet google/cloud/dataplex/v1/samples/data_product_client_samples.cc with-service-account + +*/ + /*! @page dataplex_v1::DataScanServiceClient-service-account-snippet Override dataplex_v1::DataScanServiceClient Authentication Defaults @snippet google/cloud/dataplex/v1/samples/data_scan_client_samples.cc with-service-account diff --git a/google/cloud/dataplex/doc/override-endpoint.dox b/google/cloud/dataplex/doc/override-endpoint.dox index d62ff4a4a862c..c76b8cfe04cd6 100644 --- a/google/cloud/dataplex/doc/override-endpoint.dox +++ b/google/cloud/dataplex/doc/override-endpoint.dox @@ -7,14 +7,17 @@ library. Use the client library to change this default. -For example, this will override the default endpoint for `dataplex_v1::CatalogServiceClient`: +For example, this will override the default endpoint for `dataplex_v1::BusinessGlossaryServiceClient`: -@snippet catalog_client_samples.cc set-client-endpoint +@snippet business_glossary_client_samples.cc set-client-endpoint Follow these links to find examples for other \c *Client classes: +- [\c dataplex_v1::BusinessGlossaryServiceClient](@ref dataplex_v1::BusinessGlossaryServiceClient-endpoint-snippet) - [\c dataplex_v1::CatalogServiceClient](@ref dataplex_v1::CatalogServiceClient-endpoint-snippet) +- [\c dataplex_v1::CmekServiceClient](@ref dataplex_v1::CmekServiceClient-endpoint-snippet) - [\c dataplex_v1::ContentServiceClient](@ref dataplex_v1::ContentServiceClient-endpoint-snippet) +- [\c dataplex_v1::DataProductServiceClient](@ref dataplex_v1::DataProductServiceClient-endpoint-snippet) - [\c dataplex_v1::DataScanServiceClient](@ref dataplex_v1::DataScanServiceClient-endpoint-snippet) - [\c dataplex_v1::DataTaxonomyServiceClient](@ref dataplex_v1::DataTaxonomyServiceClient-endpoint-snippet) - [\c dataplex_v1::DataplexServiceClient](@ref dataplex_v1::DataplexServiceClient-endpoint-snippet) @@ -26,18 +29,36 @@ Follow these links to find examples for other \c *Client classes: // +/*! @page dataplex_v1::BusinessGlossaryServiceClient-endpoint-snippet Override dataplex_v1::BusinessGlossaryServiceClient Endpoint Configuration + +@snippet google/cloud/dataplex/v1/samples/business_glossary_client_samples.cc set-client-endpoint + +*/ + /*! @page dataplex_v1::CatalogServiceClient-endpoint-snippet Override dataplex_v1::CatalogServiceClient Endpoint Configuration @snippet google/cloud/dataplex/v1/samples/catalog_client_samples.cc set-client-endpoint */ +/*! @page dataplex_v1::CmekServiceClient-endpoint-snippet Override dataplex_v1::CmekServiceClient Endpoint Configuration + +@snippet google/cloud/dataplex/v1/samples/cmek_client_samples.cc set-client-endpoint + +*/ + /*! @page dataplex_v1::ContentServiceClient-endpoint-snippet Override dataplex_v1::ContentServiceClient Endpoint Configuration @snippet google/cloud/dataplex/v1/samples/content_client_samples.cc set-client-endpoint */ +/*! @page dataplex_v1::DataProductServiceClient-endpoint-snippet Override dataplex_v1::DataProductServiceClient Endpoint Configuration + +@snippet google/cloud/dataplex/v1/samples/data_product_client_samples.cc set-client-endpoint + +*/ + /*! @page dataplex_v1::DataScanServiceClient-endpoint-snippet Override dataplex_v1::DataScanServiceClient Endpoint Configuration @snippet google/cloud/dataplex/v1/samples/data_scan_client_samples.cc set-client-endpoint diff --git a/google/cloud/dataplex/doc/override-retry-policies.dox b/google/cloud/dataplex/doc/override-retry-policies.dox index 13db6292c0f7c..c1c9f0aac94a7 100644 --- a/google/cloud/dataplex/doc/override-retry-policies.dox +++ b/google/cloud/dataplex/doc/override-retry-policies.dox @@ -67,23 +67,26 @@ will use `FooBarIdempotencyPolicy`. This policy is very conservative. @section dataplex-override-retry-example Example -For example, this will override the retry policies for `dataplex_v1::CatalogServiceClient`: +For example, this will override the retry policies for `dataplex_v1::BusinessGlossaryServiceClient`: -@snippet catalog_client_samples.cc set-retry-policy +@snippet business_glossary_client_samples.cc set-retry-policy This assumes you have created a custom idempotency policy. Such as: -@snippet catalog_client_samples.cc custom-idempotency-policy +@snippet business_glossary_client_samples.cc custom-idempotency-policy -This will override the polling policies for `dataplex_v1::CatalogServiceClient` +This will override the polling policies for `dataplex_v1::BusinessGlossaryServiceClient` -@snippet catalog_client_samples.cc set-polling-policy +@snippet business_glossary_client_samples.cc set-polling-policy Follow these links to find examples for other \c *Client classes: +- [\c dataplex_v1::BusinessGlossaryServiceClient](@ref dataplex_v1::BusinessGlossaryServiceClient-retry-snippet) - [\c dataplex_v1::CatalogServiceClient](@ref dataplex_v1::CatalogServiceClient-retry-snippet) +- [\c dataplex_v1::CmekServiceClient](@ref dataplex_v1::CmekServiceClient-retry-snippet) - [\c dataplex_v1::ContentServiceClient](@ref dataplex_v1::ContentServiceClient-retry-snippet) +- [\c dataplex_v1::DataProductServiceClient](@ref dataplex_v1::DataProductServiceClient-retry-snippet) - [\c dataplex_v1::DataScanServiceClient](@ref dataplex_v1::DataScanServiceClient-retry-snippet) - [\c dataplex_v1::DataTaxonomyServiceClient](@ref dataplex_v1::DataTaxonomyServiceClient-retry-snippet) - [\c dataplex_v1::DataplexServiceClient](@ref dataplex_v1::DataplexServiceClient-retry-snippet) @@ -103,6 +106,18 @@ Follow these links to find examples for other \c *Client classes: // +/*! @page dataplex_v1::BusinessGlossaryServiceClient-retry-snippet Override dataplex_v1::BusinessGlossaryServiceClient Retry Policies + +This shows how to override the retry policies for dataplex_v1::BusinessGlossaryServiceClient: + +@snippet google/cloud/dataplex/v1/samples/business_glossary_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/dataplex/v1/samples/business_glossary_client_samples.cc custom-idempotency-policy + +*/ + /*! @page dataplex_v1::CatalogServiceClient-retry-snippet Override dataplex_v1::CatalogServiceClient Retry Policies This shows how to override the retry policies for dataplex_v1::CatalogServiceClient: @@ -115,6 +130,18 @@ Assuming you have created a custom idempotency policy. Such as: */ +/*! @page dataplex_v1::CmekServiceClient-retry-snippet Override dataplex_v1::CmekServiceClient Retry Policies + +This shows how to override the retry policies for dataplex_v1::CmekServiceClient: + +@snippet google/cloud/dataplex/v1/samples/cmek_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/dataplex/v1/samples/cmek_client_samples.cc custom-idempotency-policy + +*/ + /*! @page dataplex_v1::ContentServiceClient-retry-snippet Override dataplex_v1::ContentServiceClient Retry Policies This shows how to override the retry policies for dataplex_v1::ContentServiceClient: @@ -127,6 +154,18 @@ Assuming you have created a custom idempotency policy. Such as: */ +/*! @page dataplex_v1::DataProductServiceClient-retry-snippet Override dataplex_v1::DataProductServiceClient Retry Policies + +This shows how to override the retry policies for dataplex_v1::DataProductServiceClient: + +@snippet google/cloud/dataplex/v1/samples/data_product_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/dataplex/v1/samples/data_product_client_samples.cc custom-idempotency-policy + +*/ + /*! @page dataplex_v1::DataScanServiceClient-retry-snippet Override dataplex_v1::DataScanServiceClient Retry Policies This shows how to override the retry policies for dataplex_v1::DataScanServiceClient: diff --git a/google/cloud/dataplex/doc/override-universe-domain.dox b/google/cloud/dataplex/doc/override-universe-domain.dox index 265e55127c672..762107dff3c34 100644 --- a/google/cloud/dataplex/doc/override-universe-domain.dox +++ b/google/cloud/dataplex/doc/override-universe-domain.dox @@ -6,14 +6,17 @@ client library. Use `AddUniverseDomainOption` when initializing the client library to change this default. -For example, this will override the default universe domain for `dataplex_v1::CatalogServiceClient`: +For example, this will override the default universe domain for `dataplex_v1::BusinessGlossaryServiceClient`: -@snippet catalog_client_samples.cc set-client-universe-domain +@snippet business_glossary_client_samples.cc set-client-universe-domain Follow these links to find examples for other \c *Client classes: +- [\c dataplex_v1::BusinessGlossaryServiceClient](@ref dataplex_v1::BusinessGlossaryServiceClient-universe-domain-snippet) - [\c dataplex_v1::CatalogServiceClient](@ref dataplex_v1::CatalogServiceClient-universe-domain-snippet) +- [\c dataplex_v1::CmekServiceClient](@ref dataplex_v1::CmekServiceClient-universe-domain-snippet) - [\c dataplex_v1::ContentServiceClient](@ref dataplex_v1::ContentServiceClient-universe-domain-snippet) +- [\c dataplex_v1::DataProductServiceClient](@ref dataplex_v1::DataProductServiceClient-universe-domain-snippet) - [\c dataplex_v1::DataScanServiceClient](@ref dataplex_v1::DataScanServiceClient-universe-domain-snippet) - [\c dataplex_v1::DataTaxonomyServiceClient](@ref dataplex_v1::DataTaxonomyServiceClient-universe-domain-snippet) - [\c dataplex_v1::DataplexServiceClient](@ref dataplex_v1::DataplexServiceClient-universe-domain-snippet) @@ -25,18 +28,36 @@ Follow these links to find examples for other \c *Client classes: // +/*! @page dataplex_v1::BusinessGlossaryServiceClient-universe-domain-snippet Override dataplex_v1::BusinessGlossaryServiceClient Universe Domain + +@snippet google/cloud/dataplex/v1/samples/business_glossary_client_samples.cc set-client-universe-domain + +*/ + /*! @page dataplex_v1::CatalogServiceClient-universe-domain-snippet Override dataplex_v1::CatalogServiceClient Universe Domain @snippet google/cloud/dataplex/v1/samples/catalog_client_samples.cc set-client-universe-domain */ +/*! @page dataplex_v1::CmekServiceClient-universe-domain-snippet Override dataplex_v1::CmekServiceClient Universe Domain + +@snippet google/cloud/dataplex/v1/samples/cmek_client_samples.cc set-client-universe-domain + +*/ + /*! @page dataplex_v1::ContentServiceClient-universe-domain-snippet Override dataplex_v1::ContentServiceClient Universe Domain @snippet google/cloud/dataplex/v1/samples/content_client_samples.cc set-client-universe-domain */ +/*! @page dataplex_v1::DataProductServiceClient-universe-domain-snippet Override dataplex_v1::DataProductServiceClient Universe Domain + +@snippet google/cloud/dataplex/v1/samples/data_product_client_samples.cc set-client-universe-domain + +*/ + /*! @page dataplex_v1::DataScanServiceClient-universe-domain-snippet Override dataplex_v1::DataScanServiceClient Universe Domain @snippet google/cloud/dataplex/v1/samples/data_scan_client_samples.cc set-client-universe-domain diff --git a/google/cloud/dataplex/quickstart/.bazelversion b/google/cloud/dataplex/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/dataplex/quickstart/.bazelversion +++ b/google/cloud/dataplex/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/dataplex/quickstart/WORKSPACE.bazel b/google/cloud/dataplex/quickstart/WORKSPACE.bazel index d63aca06e3d59..0aa14e0c1babf 100644 --- a/google/cloud/dataplex/quickstart/WORKSPACE.bazel +++ b/google/cloud/dataplex/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/dataplex/v1/business_glossary_client.cc b/google/cloud/dataplex/v1/business_glossary_client.cc new file mode 100644 index 0000000000000..d2b9a24334c6d --- /dev/null +++ b/google/cloud/dataplex/v1/business_glossary_client.cc @@ -0,0 +1,483 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#include "google/cloud/dataplex/v1/business_glossary_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +BusinessGlossaryServiceClient::BusinessGlossaryServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +BusinessGlossaryServiceClient::~BusinessGlossaryServiceClient() = default; + +future> +BusinessGlossaryServiceClient::CreateGlossary( + std::string const& parent, + google::cloud::dataplex::v1::Glossary const& glossary, + std::string const& glossary_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::CreateGlossaryRequest request; + request.set_parent(parent); + *request.mutable_glossary() = glossary; + request.set_glossary_id(glossary_id); + return connection_->CreateGlossary(request); +} + +StatusOr +BusinessGlossaryServiceClient::CreateGlossary( + NoAwaitTag, std::string const& parent, + google::cloud::dataplex::v1::Glossary const& glossary, + std::string const& glossary_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::CreateGlossaryRequest request; + request.set_parent(parent); + *request.mutable_glossary() = glossary; + request.set_glossary_id(glossary_id); + return connection_->CreateGlossary(NoAwaitTag{}, request); +} + +future> +BusinessGlossaryServiceClient::CreateGlossary( + google::cloud::dataplex::v1::CreateGlossaryRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateGlossary(request); +} + +StatusOr +BusinessGlossaryServiceClient::CreateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateGlossary(NoAwaitTag{}, request); +} + +future> +BusinessGlossaryServiceClient::CreateGlossary( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateGlossary(operation); +} + +future> +BusinessGlossaryServiceClient::UpdateGlossary( + google::cloud::dataplex::v1::Glossary const& glossary, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::UpdateGlossaryRequest request; + *request.mutable_glossary() = glossary; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateGlossary(request); +} + +StatusOr +BusinessGlossaryServiceClient::UpdateGlossary( + NoAwaitTag, google::cloud::dataplex::v1::Glossary const& glossary, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::UpdateGlossaryRequest request; + *request.mutable_glossary() = glossary; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateGlossary(NoAwaitTag{}, request); +} + +future> +BusinessGlossaryServiceClient::UpdateGlossary( + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateGlossary(request); +} + +StatusOr +BusinessGlossaryServiceClient::UpdateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateGlossary(NoAwaitTag{}, request); +} + +future> +BusinessGlossaryServiceClient::UpdateGlossary( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateGlossary(operation); +} + +future> +BusinessGlossaryServiceClient::DeleteGlossary(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::DeleteGlossaryRequest request; + request.set_name(name); + return connection_->DeleteGlossary(request); +} + +StatusOr +BusinessGlossaryServiceClient::DeleteGlossary(NoAwaitTag, + std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::DeleteGlossaryRequest request; + request.set_name(name); + return connection_->DeleteGlossary(NoAwaitTag{}, request); +} + +future> +BusinessGlossaryServiceClient::DeleteGlossary( + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteGlossary(request); +} + +StatusOr +BusinessGlossaryServiceClient::DeleteGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteGlossary(NoAwaitTag{}, request); +} + +future> +BusinessGlossaryServiceClient::DeleteGlossary( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteGlossary(operation); +} + +StatusOr +BusinessGlossaryServiceClient::GetGlossary(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::GetGlossaryRequest request; + request.set_name(name); + return connection_->GetGlossary(request); +} + +StatusOr +BusinessGlossaryServiceClient::GetGlossary( + google::cloud::dataplex::v1::GetGlossaryRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetGlossary(request); +} + +StreamRange +BusinessGlossaryServiceClient::ListGlossaries(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::ListGlossariesRequest request; + request.set_parent(parent); + return connection_->ListGlossaries(request); +} + +StreamRange +BusinessGlossaryServiceClient::ListGlossaries( + google::cloud::dataplex::v1::ListGlossariesRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListGlossaries(std::move(request)); +} + +StatusOr +BusinessGlossaryServiceClient::CreateGlossaryCategory( + std::string const& parent, + google::cloud::dataplex::v1::GlossaryCategory const& category, + std::string const& category_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest request; + request.set_parent(parent); + *request.mutable_category() = category; + request.set_category_id(category_id); + return connection_->CreateGlossaryCategory(request); +} + +StatusOr +BusinessGlossaryServiceClient::CreateGlossaryCategory( + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateGlossaryCategory(request); +} + +StatusOr +BusinessGlossaryServiceClient::UpdateGlossaryCategory( + google::cloud::dataplex::v1::GlossaryCategory const& category, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest request; + *request.mutable_category() = category; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateGlossaryCategory(request); +} + +StatusOr +BusinessGlossaryServiceClient::UpdateGlossaryCategory( + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateGlossaryCategory(request); +} + +Status BusinessGlossaryServiceClient::DeleteGlossaryCategory( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest request; + request.set_name(name); + return connection_->DeleteGlossaryCategory(request); +} + +Status BusinessGlossaryServiceClient::DeleteGlossaryCategory( + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteGlossaryCategory(request); +} + +StatusOr +BusinessGlossaryServiceClient::GetGlossaryCategory(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::GetGlossaryCategoryRequest request; + request.set_name(name); + return connection_->GetGlossaryCategory(request); +} + +StatusOr +BusinessGlossaryServiceClient::GetGlossaryCategory( + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetGlossaryCategory(request); +} + +StreamRange +BusinessGlossaryServiceClient::ListGlossaryCategories(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest request; + request.set_parent(parent); + return connection_->ListGlossaryCategories(request); +} + +StreamRange +BusinessGlossaryServiceClient::ListGlossaryCategories( + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListGlossaryCategories(std::move(request)); +} + +StatusOr +BusinessGlossaryServiceClient::CreateGlossaryTerm( + std::string const& parent, + google::cloud::dataplex::v1::GlossaryTerm const& term, + std::string const& term_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::CreateGlossaryTermRequest request; + request.set_parent(parent); + *request.mutable_term() = term; + request.set_term_id(term_id); + return connection_->CreateGlossaryTerm(request); +} + +StatusOr +BusinessGlossaryServiceClient::CreateGlossaryTerm( + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateGlossaryTerm(request); +} + +StatusOr +BusinessGlossaryServiceClient::UpdateGlossaryTerm( + google::cloud::dataplex::v1::GlossaryTerm const& term, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::UpdateGlossaryTermRequest request; + *request.mutable_term() = term; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateGlossaryTerm(request); +} + +StatusOr +BusinessGlossaryServiceClient::UpdateGlossaryTerm( + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateGlossaryTerm(request); +} + +Status BusinessGlossaryServiceClient::DeleteGlossaryTerm( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::DeleteGlossaryTermRequest request; + request.set_name(name); + return connection_->DeleteGlossaryTerm(request); +} + +Status BusinessGlossaryServiceClient::DeleteGlossaryTerm( + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteGlossaryTerm(request); +} + +StatusOr +BusinessGlossaryServiceClient::GetGlossaryTerm(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::GetGlossaryTermRequest request; + request.set_name(name); + return connection_->GetGlossaryTerm(request); +} + +StatusOr +BusinessGlossaryServiceClient::GetGlossaryTerm( + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetGlossaryTerm(request); +} + +StreamRange +BusinessGlossaryServiceClient::ListGlossaryTerms(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::ListGlossaryTermsRequest request; + request.set_parent(parent); + return connection_->ListGlossaryTerms(request); +} + +StreamRange +BusinessGlossaryServiceClient::ListGlossaryTerms( + google::cloud::dataplex::v1::ListGlossaryTermsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListGlossaryTerms(std::move(request)); +} + +StreamRange +BusinessGlossaryServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr +BusinessGlossaryServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StatusOr BusinessGlossaryServiceClient::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->SetIamPolicy(request); +} + +StatusOr BusinessGlossaryServiceClient::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetIamPolicy(request); +} + +StatusOr +BusinessGlossaryServiceClient::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->TestIamPermissions(request); +} + +StreamRange +BusinessGlossaryServiceClient::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 +BusinessGlossaryServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr +BusinessGlossaryServiceClient::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 +BusinessGlossaryServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status BusinessGlossaryServiceClient::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 BusinessGlossaryServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status BusinessGlossaryServiceClient::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 BusinessGlossaryServiceClient::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 dataplex_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/business_glossary_client.h b/google/cloud/dataplex/v1/business_glossary_client.h new file mode 100644 index 0000000000000..e45921df3a7e9 --- /dev/null +++ b/google/cloud/dataplex/v1/business_glossary_client.h @@ -0,0 +1,1666 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_BUSINESS_GLOSSARY_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_BUSINESS_GLOSSARY_CLIENT_H + +#include "google/cloud/dataplex/v1/business_glossary_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 "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// BusinessGlossaryService provides APIs for managing business glossary +/// resources for enterprise customers. +/// The resources currently supported in Business Glossary are: +/// 1. Glossary +/// 2. GlossaryCategory +/// 3. GlossaryTerm +/// +/// @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 BusinessGlossaryServiceClient { + public: + explicit BusinessGlossaryServiceClient( + std::shared_ptr connection, + Options opts = {}); + ~BusinessGlossaryServiceClient(); + + ///@{ + /// @name Copy and move support + BusinessGlossaryServiceClient(BusinessGlossaryServiceClient const&) = default; + BusinessGlossaryServiceClient& operator=( + BusinessGlossaryServiceClient const&) = default; + BusinessGlossaryServiceClient(BusinessGlossaryServiceClient&&) = default; + BusinessGlossaryServiceClient& operator=(BusinessGlossaryServiceClient&&) = + default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(BusinessGlossaryServiceClient const& a, + BusinessGlossaryServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(BusinessGlossaryServiceClient const& a, + BusinessGlossaryServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Creates a new Glossary resource. + /// + /// @param parent Required. The parent resource where this Glossary will be created. + /// Format: projects/{project_id_or_number}/locations/{location_id} + /// where `location_id` refers to a Google Cloud region. + /// @param glossary Required. The Glossary to create. + /// @param glossary_id Required. Glossary ID: Glossary identifier. + /// @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.dataplex.v1.Glossary] 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.dataplex.v1.CreateGlossaryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L370} + /// [google.cloud.dataplex.v1.Glossary]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L201} + /// + // clang-format on + future> CreateGlossary( + std::string const& parent, + google::cloud::dataplex::v1::Glossary const& glossary, + std::string const& glossary_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateGlossary + /// + /// 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 CreateGlossary( + NoAwaitTag, std::string const& parent, + google::cloud::dataplex::v1::Glossary const& glossary, + std::string const& glossary_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Glossary resource. + /// + /// @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.dataplex.v1.CreateGlossaryRequest]. + /// 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.dataplex.v1.Glossary] 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.dataplex.v1.CreateGlossaryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L370} + /// [google.cloud.dataplex.v1.Glossary]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L201} + /// + // clang-format on + future> CreateGlossary( + google::cloud::dataplex::v1::CreateGlossaryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateGlossary + /// + /// 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 CreateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateGlossary + /// + /// 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> CreateGlossary( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates a Glossary resource. + /// + /// @param glossary Required. The Glossary to update. + /// The Glossary's `name` field is used to identify the Glossary to update. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id} + /// @param update_mask Required. The list of fields to update. + /// @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.dataplex.v1.Glossary] 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.dataplex.v1.Glossary]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L201} + /// [google.cloud.dataplex.v1.UpdateGlossaryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L393} + /// + // clang-format on + future> UpdateGlossary( + google::cloud::dataplex::v1::Glossary const& glossary, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateGlossary + /// + /// 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 UpdateGlossary( + NoAwaitTag, google::cloud::dataplex::v1::Glossary const& glossary, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a Glossary resource. + /// + /// @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.dataplex.v1.UpdateGlossaryRequest]. + /// 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.dataplex.v1.Glossary] 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.dataplex.v1.Glossary]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L201} + /// [google.cloud.dataplex.v1.UpdateGlossaryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L393} + /// + // clang-format on + future> UpdateGlossary( + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateGlossary + /// + /// 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 UpdateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateGlossary + /// + /// 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> UpdateGlossary( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a Glossary resource. All the categories and terms within the + /// Glossary must be deleted before the Glossary can be deleted. + /// + /// @param name Required. The name of the Glossary to delete. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id} + /// @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.dataplex.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.dataplex.v1.DeleteGlossaryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L410} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} + /// + // clang-format on + future> + DeleteGlossary(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteGlossary + /// + /// 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 DeleteGlossary( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a Glossary resource. All the categories and terms within the + /// Glossary must be deleted before the Glossary can be deleted. + /// + /// @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.dataplex.v1.DeleteGlossaryRequest]. + /// 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.dataplex.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.dataplex.v1.DeleteGlossaryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L410} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} + /// + // clang-format on + future> + DeleteGlossary( + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteGlossary + /// + /// 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 DeleteGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteGlossary + /// + /// 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> + DeleteGlossary(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Gets a Glossary resource. + /// + /// @param name Required. The name of the Glossary to retrieve. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id} + /// @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.dataplex.v1.Glossary]) + /// 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.dataplex.v1.GetGlossaryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L429} + /// [google.cloud.dataplex.v1.Glossary]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L201} + /// + // clang-format on + StatusOr GetGlossary( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a Glossary resource. + /// + /// @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.dataplex.v1.GetGlossaryRequest]. + /// 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.dataplex.v1.Glossary]) + /// 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.dataplex.v1.GetGlossaryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L429} + /// [google.cloud.dataplex.v1.Glossary]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L201} + /// + // clang-format on + StatusOr GetGlossary( + google::cloud::dataplex::v1::GetGlossaryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists Glossary resources in a project and location. + /// + /// @param parent Required. The parent, which has this collection of Glossaries. + /// Format: projects/{project_id_or_number}/locations/{location_id} + /// where `location_id` refers to a Google Cloud region. + /// @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.dataplex.v1.Glossary], 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.dataplex.v1.Glossary]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L201} + /// [google.cloud.dataplex.v1.ListGlossariesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L442} + /// + // clang-format on + StreamRange ListGlossaries( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Glossary resources in a 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.dataplex.v1.ListGlossariesRequest]. + /// 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.dataplex.v1.Glossary], 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.dataplex.v1.Glossary]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L201} + /// [google.cloud.dataplex.v1.ListGlossariesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L442} + /// + // clang-format on + StreamRange ListGlossaries( + google::cloud::dataplex::v1::ListGlossariesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new GlossaryCategory resource. + /// + /// @param parent Required. The parent resource where this GlossaryCategory will be created. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id} + /// where `locationId` refers to a Google Cloud region. + /// @param category Required. The GlossaryCategory to create. + /// @param category_id Required. GlossaryCategory identifier. + /// @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.dataplex.v1.GlossaryCategory]) + /// 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.dataplex.v1.CreateGlossaryCategoryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L493} + /// [google.cloud.dataplex.v1.GlossaryCategory]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L258} + /// + // clang-format on + StatusOr + CreateGlossaryCategory( + std::string const& parent, + google::cloud::dataplex::v1::GlossaryCategory const& category, + std::string const& category_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new GlossaryCategory resource. + /// + /// @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.dataplex.v1.CreateGlossaryCategoryRequest]. + /// 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.dataplex.v1.GlossaryCategory]) + /// 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.dataplex.v1.CreateGlossaryCategoryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L493} + /// [google.cloud.dataplex.v1.GlossaryCategory]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L258} + /// + // clang-format on + StatusOr + CreateGlossaryCategory( + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates a GlossaryCategory resource. + /// + /// @param category Required. The GlossaryCategory to update. + /// The GlossaryCategory's `name` field is used to identify the + /// GlossaryCategory to update. Format: + /// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/categories/{category_id} + /// @param update_mask Required. The list of fields to update. + /// @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.dataplex.v1.GlossaryCategory]) + /// 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.dataplex.v1.GlossaryCategory]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L258} + /// [google.cloud.dataplex.v1.UpdateGlossaryCategoryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L513} + /// + // clang-format on + StatusOr + UpdateGlossaryCategory( + google::cloud::dataplex::v1::GlossaryCategory const& category, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a GlossaryCategory resource. + /// + /// @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.dataplex.v1.UpdateGlossaryCategoryRequest]. + /// 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.dataplex.v1.GlossaryCategory]) + /// 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.dataplex.v1.GlossaryCategory]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L258} + /// [google.cloud.dataplex.v1.UpdateGlossaryCategoryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L513} + /// + // clang-format on + StatusOr + UpdateGlossaryCategory( + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes a GlossaryCategory resource. All the GlossaryCategories and + /// GlossaryTerms nested directly under the specified GlossaryCategory will be + /// moved one level up to the parent in the hierarchy. + /// + /// @param name Required. The name of the GlossaryCategory to delete. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/categories/{category_id} + /// @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.cloud.dataplex.v1.DeleteGlossaryCategoryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L526} + /// + // clang-format on + Status DeleteGlossaryCategory(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a GlossaryCategory resource. All the GlossaryCategories and + /// GlossaryTerms nested directly under the specified GlossaryCategory will be + /// moved one level up to the parent in the hierarchy. + /// + /// @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.dataplex.v1.DeleteGlossaryCategoryRequest]. + /// 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.cloud.dataplex.v1.DeleteGlossaryCategoryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L526} + /// + // clang-format on + Status DeleteGlossaryCategory( + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Gets a GlossaryCategory resource. + /// + /// @param name Required. The name of the GlossaryCategory to retrieve. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/categories/{category_id} + /// @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.dataplex.v1.GlossaryCategory]) + /// 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.dataplex.v1.GetGlossaryCategoryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L539} + /// [google.cloud.dataplex.v1.GlossaryCategory]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L258} + /// + // clang-format on + StatusOr GetGlossaryCategory( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a GlossaryCategory resource. + /// + /// @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.dataplex.v1.GetGlossaryCategoryRequest]. + /// 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.dataplex.v1.GlossaryCategory]) + /// 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.dataplex.v1.GetGlossaryCategoryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L539} + /// [google.cloud.dataplex.v1.GlossaryCategory]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L258} + /// + // clang-format on + StatusOr GetGlossaryCategory( + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists GlossaryCategory resources in a Glossary. + /// + /// @param parent Required. The parent, which has this collection of GlossaryCategories. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id} + /// Location is the Google Cloud region. + /// @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.dataplex.v1.GlossaryCategory], 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.dataplex.v1.GlossaryCategory]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L258} + /// [google.cloud.dataplex.v1.ListGlossaryCategoriesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L552} + /// + // clang-format on + StreamRange + ListGlossaryCategories(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists GlossaryCategory resources in a Glossary. + /// + /// @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.dataplex.v1.ListGlossaryCategoriesRequest]. + /// 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.dataplex.v1.GlossaryCategory], 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.dataplex.v1.GlossaryCategory]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L258} + /// [google.cloud.dataplex.v1.ListGlossaryCategoriesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L552} + /// + // clang-format on + StreamRange + ListGlossaryCategories( + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new GlossaryTerm resource. + /// + /// @param parent Required. The parent resource where the GlossaryTerm will be created. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id} + /// where `location_id` refers to a Google Cloud region. + /// @param term Required. The GlossaryTerm to create. + /// @param term_id Required. GlossaryTerm identifier. + /// @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.dataplex.v1.GlossaryTerm]) + /// 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.dataplex.v1.CreateGlossaryTermRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L610} + /// [google.cloud.dataplex.v1.GlossaryTerm]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L313} + /// + // clang-format on + StatusOr CreateGlossaryTerm( + std::string const& parent, + google::cloud::dataplex::v1::GlossaryTerm const& term, + std::string const& term_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new GlossaryTerm resource. + /// + /// @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.dataplex.v1.CreateGlossaryTermRequest]. + /// 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.dataplex.v1.GlossaryTerm]) + /// 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.dataplex.v1.CreateGlossaryTermRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L610} + /// [google.cloud.dataplex.v1.GlossaryTerm]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L313} + /// + // clang-format on + StatusOr CreateGlossaryTerm( + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates a GlossaryTerm resource. + /// + /// @param term Required. The GlossaryTerm to update. + /// The GlossaryTerm's `name` field is used to identify the GlossaryTerm to + /// update. Format: + /// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/terms/{term_id} + /// @param update_mask Required. The list of fields to update. + /// @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.dataplex.v1.GlossaryTerm]) + /// 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.dataplex.v1.GlossaryTerm]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L313} + /// [google.cloud.dataplex.v1.UpdateGlossaryTermRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L630} + /// + // clang-format on + StatusOr UpdateGlossaryTerm( + google::cloud::dataplex::v1::GlossaryTerm const& term, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a GlossaryTerm resource. + /// + /// @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.dataplex.v1.UpdateGlossaryTermRequest]. + /// 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.dataplex.v1.GlossaryTerm]) + /// 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.dataplex.v1.GlossaryTerm]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L313} + /// [google.cloud.dataplex.v1.UpdateGlossaryTermRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L630} + /// + // clang-format on + StatusOr UpdateGlossaryTerm( + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes a GlossaryTerm resource. + /// + /// @param name Required. The name of the GlossaryTerm to delete. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/terms/{term_id} + /// @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.cloud.dataplex.v1.DeleteGlossaryTermRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L643} + /// + // clang-format on + Status DeleteGlossaryTerm(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a GlossaryTerm resource. + /// + /// @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.dataplex.v1.DeleteGlossaryTermRequest]. + /// 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.cloud.dataplex.v1.DeleteGlossaryTermRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L643} + /// + // clang-format on + Status DeleteGlossaryTerm( + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Gets a GlossaryTerm resource. + /// + /// @param name Required. The name of the GlossaryTerm to retrieve. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id}/terms/{term_id} + /// @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.dataplex.v1.GlossaryTerm]) + /// 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.dataplex.v1.GetGlossaryTermRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L656} + /// [google.cloud.dataplex.v1.GlossaryTerm]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L313} + /// + // clang-format on + StatusOr GetGlossaryTerm( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a GlossaryTerm resource. + /// + /// @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.dataplex.v1.GetGlossaryTermRequest]. + /// 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.dataplex.v1.GlossaryTerm]) + /// 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.dataplex.v1.GetGlossaryTermRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L656} + /// [google.cloud.dataplex.v1.GlossaryTerm]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L313} + /// + // clang-format on + StatusOr GetGlossaryTerm( + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists GlossaryTerm resources in a Glossary. + /// + /// @param parent Required. The parent, which has this collection of GlossaryTerms. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/glossaries/{glossary_id} + /// where `location_id` refers to a Google Cloud region. + /// @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.dataplex.v1.GlossaryTerm], 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.dataplex.v1.GlossaryTerm]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L313} + /// [google.cloud.dataplex.v1.ListGlossaryTermsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L669} + /// + // clang-format on + StreamRange ListGlossaryTerms( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists GlossaryTerm resources in a Glossary. + /// + /// @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.dataplex.v1.ListGlossaryTermsRequest]. + /// 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.dataplex.v1.GlossaryTerm], 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.dataplex.v1.GlossaryTerm]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L313} + /// [google.cloud.dataplex.v1.ListGlossaryTermsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/business_glossary.proto#L669} + /// + // clang-format on + StreamRange ListGlossaryTerms( + google::cloud::dataplex::v1::ListGlossaryTermsRequest request, + 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 + /// + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. + /// + /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + /// + /// @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.iam.v1.SetIamPolicyRequest]. + /// 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.iam.v1.Policy]) + /// 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.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L102} + /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L100} + /// + // clang-format on + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request, Options opts = {}); + + // clang-format off + /// + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// @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.iam.v1.GetIamPolicyRequest]. + /// 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.iam.v1.Policy]) + /// 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.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123} + /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L102} + /// + // clang-format on + StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request, Options opts = {}); + + // clang-format off + /// + /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. + /// + /// @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.iam.v1.TestIamPermissionsRequest]. + /// 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.iam.v1.TestIamPermissionsResponse]) + /// 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.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L137} + /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L153} + /// + // clang-format on + StatusOr TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 dataplex_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_BUSINESS_GLOSSARY_CLIENT_H diff --git a/google/cloud/dataplex/v1/business_glossary_connection.cc b/google/cloud/dataplex/v1/business_glossary_connection.cc new file mode 100644 index 0000000000000..2dc56a2e17182 --- /dev/null +++ b/google/cloud/dataplex/v1/business_glossary_connection.cc @@ -0,0 +1,264 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#include "google/cloud/dataplex/v1/business_glossary_connection.h" +#include "google/cloud/dataplex/v1/business_glossary_options.h" +#include "google/cloud/dataplex/v1/internal/business_glossary_connection_impl.h" +#include "google/cloud/dataplex/v1/internal/business_glossary_option_defaults.h" +#include "google/cloud/dataplex/v1/internal/business_glossary_stub_factory.h" +#include "google/cloud/dataplex/v1/internal/business_glossary_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 dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +BusinessGlossaryServiceConnection::~BusinessGlossaryServiceConnection() = + default; + +future> +BusinessGlossaryServiceConnection::CreateGlossary( + google::cloud::dataplex::v1::CreateGlossaryRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +BusinessGlossaryServiceConnection::CreateGlossary( + NoAwaitTag, google::cloud::dataplex::v1::CreateGlossaryRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +BusinessGlossaryServiceConnection::CreateGlossary( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +BusinessGlossaryServiceConnection::UpdateGlossary( + google::cloud::dataplex::v1::UpdateGlossaryRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +BusinessGlossaryServiceConnection::UpdateGlossary( + NoAwaitTag, google::cloud::dataplex::v1::UpdateGlossaryRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +BusinessGlossaryServiceConnection::UpdateGlossary( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +BusinessGlossaryServiceConnection::DeleteGlossary( + google::cloud::dataplex::v1::DeleteGlossaryRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +BusinessGlossaryServiceConnection::DeleteGlossary( + NoAwaitTag, google::cloud::dataplex::v1::DeleteGlossaryRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +BusinessGlossaryServiceConnection::DeleteGlossary( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +BusinessGlossaryServiceConnection::GetGlossary( + google::cloud::dataplex::v1::GetGlossaryRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +BusinessGlossaryServiceConnection::ListGlossaries( + google::cloud::dataplex::v1:: + ListGlossariesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +BusinessGlossaryServiceConnection::CreateGlossaryCategory( + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +BusinessGlossaryServiceConnection::UpdateGlossaryCategory( + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status BusinessGlossaryServiceConnection::DeleteGlossaryCategory( + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +BusinessGlossaryServiceConnection::GetGlossaryCategory( + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +BusinessGlossaryServiceConnection::ListGlossaryCategories( + google::cloud::dataplex::v1:: + ListGlossaryCategoriesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +BusinessGlossaryServiceConnection::CreateGlossaryTerm( + google::cloud::dataplex::v1::CreateGlossaryTermRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +BusinessGlossaryServiceConnection::UpdateGlossaryTerm( + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status BusinessGlossaryServiceConnection::DeleteGlossaryTerm( + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +BusinessGlossaryServiceConnection::GetGlossaryTerm( + google::cloud::dataplex::v1::GetGlossaryTermRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +BusinessGlossaryServiceConnection::ListGlossaryTerms( + google::cloud::dataplex::v1:: + ListGlossaryTermsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StreamRange +BusinessGlossaryServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +BusinessGlossaryServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +BusinessGlossaryServiceConnection::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +BusinessGlossaryServiceConnection::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +BusinessGlossaryServiceConnection::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +BusinessGlossaryServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +BusinessGlossaryServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status BusinessGlossaryServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status BusinessGlossaryServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr +MakeBusinessGlossaryServiceConnection(Options options) { + internal::CheckExpectedOptions( + options, __func__); + options = dataplex_v1_internal::BusinessGlossaryServiceDefaultOptions( + std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = dataplex_v1_internal::CreateDefaultBusinessGlossaryServiceStub( + std::move(auth), options); + return dataplex_v1_internal::MakeBusinessGlossaryServiceTracingConnection( + std::make_shared< + dataplex_v1_internal::BusinessGlossaryServiceConnectionImpl>( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/business_glossary_connection.h b/google/cloud/dataplex/v1/business_glossary_connection.h new file mode 100644 index 0000000000000..f2187de250263 --- /dev/null +++ b/google/cloud/dataplex/v1/business_glossary_connection.h @@ -0,0 +1,334 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_BUSINESS_GLOSSARY_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_BUSINESS_GLOSSARY_CONNECTION_H + +#include "google/cloud/dataplex/v1/business_glossary.pb.h" +#include "google/cloud/dataplex/v1/business_glossary_connection_idempotency_policy.h" +#include "google/cloud/dataplex/v1/internal/business_glossary_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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `BusinessGlossaryServiceConnection`. +class BusinessGlossaryServiceRetryPolicy : 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 `BusinessGlossaryServiceConnection` 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 BusinessGlossaryServiceLimitedErrorCountRetryPolicy + : public BusinessGlossaryServiceRetryPolicy { + 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 BusinessGlossaryServiceLimitedErrorCountRetryPolicy( + int maximum_failures) + : impl_(maximum_failures) {} + + BusinessGlossaryServiceLimitedErrorCountRetryPolicy( + BusinessGlossaryServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : BusinessGlossaryServiceLimitedErrorCountRetryPolicy( + rhs.maximum_failures()) {} + BusinessGlossaryServiceLimitedErrorCountRetryPolicy( + BusinessGlossaryServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : BusinessGlossaryServiceLimitedErrorCountRetryPolicy( + 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< + BusinessGlossaryServiceLimitedErrorCountRetryPolicy>( + maximum_failures()); + } + + // This is provided only for backwards compatibility. + using BaseType = BusinessGlossaryServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + dataplex_v1_internal::BusinessGlossaryServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `BusinessGlossaryServiceConnection` 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 BusinessGlossaryServiceLimitedTimeRetryPolicy + : public BusinessGlossaryServiceRetryPolicy { + 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 BusinessGlossaryServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + BusinessGlossaryServiceLimitedTimeRetryPolicy( + BusinessGlossaryServiceLimitedTimeRetryPolicy&& rhs) noexcept + : BusinessGlossaryServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + BusinessGlossaryServiceLimitedTimeRetryPolicy( + BusinessGlossaryServiceLimitedTimeRetryPolicy const& rhs) noexcept + : BusinessGlossaryServiceLimitedTimeRetryPolicy(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 = BusinessGlossaryServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + dataplex_v1_internal::BusinessGlossaryServiceRetryTraits> + impl_; +}; + +/** + * The `BusinessGlossaryServiceConnection` object for + * `BusinessGlossaryServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `BusinessGlossaryServiceClient`. This allows users to inject custom + * behavior (e.g., with a Google Mock object) when writing tests that use + * objects of type `BusinessGlossaryServiceClient`. + * + * To create a concrete instance, see `MakeBusinessGlossaryServiceConnection()`. + * + * For mocking, see `dataplex_v1_mocks::MockBusinessGlossaryServiceConnection`. + */ +class BusinessGlossaryServiceConnection { + public: + virtual ~BusinessGlossaryServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual future> + CreateGlossary( + google::cloud::dataplex::v1::CreateGlossaryRequest const& request); + + virtual StatusOr CreateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request); + + virtual future> + CreateGlossary(google::longrunning::Operation const& operation); + + virtual future> + UpdateGlossary( + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request); + + virtual StatusOr UpdateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request); + + virtual future> + UpdateGlossary(google::longrunning::Operation const& operation); + + virtual future> + DeleteGlossary( + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request); + + virtual StatusOr DeleteGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request); + + virtual future> + DeleteGlossary(google::longrunning::Operation const& operation); + + virtual StatusOr GetGlossary( + google::cloud::dataplex::v1::GetGlossaryRequest const& request); + + virtual StreamRange ListGlossaries( + google::cloud::dataplex::v1::ListGlossariesRequest request); + + virtual StatusOr + CreateGlossaryCategory( + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& + request); + + virtual StatusOr + UpdateGlossaryCategory( + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& + request); + + virtual Status DeleteGlossaryCategory( + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& + request); + + virtual StatusOr + GetGlossaryCategory( + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request); + + virtual StreamRange + ListGlossaryCategories( + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest request); + + virtual StatusOr + CreateGlossaryTerm( + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request); + + virtual StatusOr + UpdateGlossaryTerm( + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request); + + virtual Status DeleteGlossaryTerm( + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request); + + virtual StatusOr GetGlossaryTerm( + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request); + + virtual StreamRange + ListGlossaryTerms( + google::cloud::dataplex::v1::ListGlossaryTermsRequest request); + + virtual StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request); + + virtual StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request); + + virtual StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request); + + virtual StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request); + + virtual StatusOr + TestIamPermissions(google::iam::v1::TestIamPermissionsRequest 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 + * `BusinessGlossaryServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of + * BusinessGlossaryServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `BusinessGlossaryServiceConnection`. Expected options are any of the + * types in the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::dataplex_v1::BusinessGlossaryServicePolicyOptionList` + * + * @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 `BusinessGlossaryServiceConnection` + * created by this function. + */ +std::shared_ptr +MakeBusinessGlossaryServiceConnection(Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_BUSINESS_GLOSSARY_CONNECTION_H diff --git a/google/cloud/dataplex/v1/business_glossary_connection_idempotency_policy.cc b/google/cloud/dataplex/v1/business_glossary_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..a3543b462c252 --- /dev/null +++ b/google/cloud/dataplex/v1/business_glossary_connection_idempotency_policy.cc @@ -0,0 +1,177 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#include "google/cloud/dataplex/v1/business_glossary_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +BusinessGlossaryServiceConnectionIdempotencyPolicy:: + ~BusinessGlossaryServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +BusinessGlossaryServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique( + *this); +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::CreateGlossary( + google::cloud::dataplex::v1::CreateGlossaryRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::UpdateGlossary( + google::cloud::dataplex::v1::UpdateGlossaryRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::DeleteGlossary( + google::cloud::dataplex::v1::DeleteGlossaryRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::GetGlossary( + google::cloud::dataplex::v1::GetGlossaryRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::ListGlossaries( + google::cloud::dataplex::v1::ListGlossariesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency +BusinessGlossaryServiceConnectionIdempotencyPolicy::CreateGlossaryCategory( + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +BusinessGlossaryServiceConnectionIdempotencyPolicy::UpdateGlossaryCategory( + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +BusinessGlossaryServiceConnectionIdempotencyPolicy::DeleteGlossaryCategory( + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +BusinessGlossaryServiceConnectionIdempotencyPolicy::GetGlossaryCategory( + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency +BusinessGlossaryServiceConnectionIdempotencyPolicy::ListGlossaryCategories( + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency +BusinessGlossaryServiceConnectionIdempotencyPolicy::CreateGlossaryTerm( + google::cloud::dataplex::v1::CreateGlossaryTermRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +BusinessGlossaryServiceConnectionIdempotencyPolicy::UpdateGlossaryTerm( + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +BusinessGlossaryServiceConnectionIdempotencyPolicy::DeleteGlossaryTerm( + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::GetGlossaryTerm( + google::cloud::dataplex::v1::GetGlossaryTermRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency +BusinessGlossaryServiceConnectionIdempotencyPolicy::ListGlossaryTerms( + google::cloud::dataplex::v1::ListGlossaryTermsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { + return request.policy().etag().empty() ? Idempotency::kNonIdempotent + : Idempotency::kIdempotent; +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency +BusinessGlossaryServiceConnectionIdempotencyPolicy::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency BusinessGlossaryServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultBusinessGlossaryServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/business_glossary_connection_idempotency_policy.h b/google/cloud/dataplex/v1/business_glossary_connection_idempotency_policy.h new file mode 100644 index 0000000000000..836e8de0f7ead --- /dev/null +++ b/google/cloud/dataplex/v1/business_glossary_connection_idempotency_policy.h @@ -0,0 +1,127 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_BUSINESS_GLOSSARY_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_BUSINESS_GLOSSARY_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/dataplex/v1/business_glossary.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class BusinessGlossaryServiceConnectionIdempotencyPolicy { + public: + virtual ~BusinessGlossaryServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr + clone() const; + + virtual google::cloud::Idempotency CreateGlossary( + google::cloud::dataplex::v1::CreateGlossaryRequest const& request); + + virtual google::cloud::Idempotency UpdateGlossary( + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request); + + virtual google::cloud::Idempotency DeleteGlossary( + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request); + + virtual google::cloud::Idempotency GetGlossary( + google::cloud::dataplex::v1::GetGlossaryRequest const& request); + + virtual google::cloud::Idempotency ListGlossaries( + google::cloud::dataplex::v1::ListGlossariesRequest request); + + virtual google::cloud::Idempotency CreateGlossaryCategory( + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& + request); + + virtual google::cloud::Idempotency UpdateGlossaryCategory( + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& + request); + + virtual google::cloud::Idempotency DeleteGlossaryCategory( + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& + request); + + virtual google::cloud::Idempotency GetGlossaryCategory( + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request); + + virtual google::cloud::Idempotency ListGlossaryCategories( + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest request); + + virtual google::cloud::Idempotency CreateGlossaryTerm( + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request); + + virtual google::cloud::Idempotency UpdateGlossaryTerm( + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request); + + virtual google::cloud::Idempotency DeleteGlossaryTerm( + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request); + + virtual google::cloud::Idempotency GetGlossaryTerm( + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request); + + virtual google::cloud::Idempotency ListGlossaryTerms( + google::cloud::dataplex::v1::ListGlossaryTermsRequest 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 SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request); + + virtual google::cloud::Idempotency GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request); + + virtual google::cloud::Idempotency TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest 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 +MakeDefaultBusinessGlossaryServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_BUSINESS_GLOSSARY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/dataplex/v1/business_glossary_options.h b/google/cloud/dataplex/v1/business_glossary_options.h new file mode 100644 index 0000000000000..dded801b395e2 --- /dev/null +++ b/google/cloud/dataplex/v1/business_glossary_options.h @@ -0,0 +1,88 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_BUSINESS_GLOSSARY_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_BUSINESS_GLOSSARY_OPTIONS_H + +#include "google/cloud/dataplex/v1/business_glossary_connection.h" +#include "google/cloud/dataplex/v1/business_glossary_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 dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-dataplex-options + */ +struct BusinessGlossaryServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-dataplex-options + */ +struct BusinessGlossaryServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-dataplex-options + */ +struct BusinessGlossaryServiceConnectionIdempotencyPolicyOption { + using Type = + std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-dataplex-options + */ +struct BusinessGlossaryServicePollingPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to BusinessGlossaryService. + * + * @ingroup google-cloud-dataplex-options + */ +using BusinessGlossaryServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_BUSINESS_GLOSSARY_OPTIONS_H diff --git a/google/cloud/dataplex/v1/catalog_client.cc b/google/cloud/dataplex/v1/catalog_client.cc index a53c7c28c43f6..df43ae7cd636c 100644 --- a/google/cloud/dataplex/v1/catalog_client.cc +++ b/google/cloud/dataplex/v1/catalog_client.cc @@ -740,6 +740,23 @@ CatalogServiceClient::CreateEntryLink( return connection_->CreateEntryLink(request); } +StatusOr +CatalogServiceClient::UpdateEntryLink( + google::cloud::dataplex::v1::EntryLink const& entry_link, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::UpdateEntryLinkRequest request; + *request.mutable_entry_link() = entry_link; + return connection_->UpdateEntryLink(request); +} + +StatusOr +CatalogServiceClient::UpdateEntryLink( + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateEntryLink(request); +} + StatusOr CatalogServiceClient::DeleteEntryLink(std::string const& name, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); @@ -756,6 +773,22 @@ CatalogServiceClient::DeleteEntryLink( return connection_->DeleteEntryLink(request); } +StreamRange +CatalogServiceClient::LookupEntryLinks( + google::cloud::dataplex::v1::LookupEntryLinksRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->LookupEntryLinks(std::move(request)); +} + +StatusOr +CatalogServiceClient::LookupContext( + google::cloud::dataplex::v1::LookupContextRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->LookupContext(request); +} + StatusOr CatalogServiceClient::GetEntryLink(std::string const& name, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); @@ -772,6 +805,177 @@ CatalogServiceClient::GetEntryLink( return connection_->GetEntryLink(request); } +future> +CatalogServiceClient::CreateMetadataFeed( + std::string const& parent, + google::cloud::dataplex::v1::MetadataFeed const& metadata_feed, + std::string const& metadata_feed_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::CreateMetadataFeedRequest request; + request.set_parent(parent); + *request.mutable_metadata_feed() = metadata_feed; + request.set_metadata_feed_id(metadata_feed_id); + return connection_->CreateMetadataFeed(request); +} + +StatusOr +CatalogServiceClient::CreateMetadataFeed( + NoAwaitTag, std::string const& parent, + google::cloud::dataplex::v1::MetadataFeed const& metadata_feed, + std::string const& metadata_feed_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::CreateMetadataFeedRequest request; + request.set_parent(parent); + *request.mutable_metadata_feed() = metadata_feed; + request.set_metadata_feed_id(metadata_feed_id); + return connection_->CreateMetadataFeed(NoAwaitTag{}, request); +} + +future> +CatalogServiceClient::CreateMetadataFeed( + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateMetadataFeed(request); +} + +StatusOr +CatalogServiceClient::CreateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateMetadataFeed(NoAwaitTag{}, request); +} + +future> +CatalogServiceClient::CreateMetadataFeed( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateMetadataFeed(operation); +} + +StatusOr +CatalogServiceClient::GetMetadataFeed(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::GetMetadataFeedRequest request; + request.set_name(name); + return connection_->GetMetadataFeed(request); +} + +StatusOr +CatalogServiceClient::GetMetadataFeed( + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetMetadataFeed(request); +} + +StreamRange +CatalogServiceClient::ListMetadataFeeds(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::ListMetadataFeedsRequest request; + request.set_parent(parent); + return connection_->ListMetadataFeeds(request); +} + +StreamRange +CatalogServiceClient::ListMetadataFeeds( + google::cloud::dataplex::v1::ListMetadataFeedsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListMetadataFeeds(std::move(request)); +} + +future> +CatalogServiceClient::DeleteMetadataFeed(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::DeleteMetadataFeedRequest request; + request.set_name(name); + return connection_->DeleteMetadataFeed(request); +} + +StatusOr +CatalogServiceClient::DeleteMetadataFeed(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::DeleteMetadataFeedRequest request; + request.set_name(name); + return connection_->DeleteMetadataFeed(NoAwaitTag{}, request); +} + +future> +CatalogServiceClient::DeleteMetadataFeed( + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteMetadataFeed(request); +} + +StatusOr +CatalogServiceClient::DeleteMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteMetadataFeed(NoAwaitTag{}, request); +} + +future> +CatalogServiceClient::DeleteMetadataFeed( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteMetadataFeed(operation); +} + +future> +CatalogServiceClient::UpdateMetadataFeed( + google::cloud::dataplex::v1::MetadataFeed const& metadata_feed, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::UpdateMetadataFeedRequest request; + *request.mutable_metadata_feed() = metadata_feed; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateMetadataFeed(request); +} + +StatusOr +CatalogServiceClient::UpdateMetadataFeed( + NoAwaitTag, google::cloud::dataplex::v1::MetadataFeed const& metadata_feed, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::UpdateMetadataFeedRequest request; + *request.mutable_metadata_feed() = metadata_feed; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateMetadataFeed(NoAwaitTag{}, request); +} + +future> +CatalogServiceClient::UpdateMetadataFeed( + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateMetadataFeed(request); +} + +StatusOr +CatalogServiceClient::UpdateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateMetadataFeed(NoAwaitTag{}, request); +} + +future> +CatalogServiceClient::UpdateMetadataFeed( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateMetadataFeed(operation); +} + StreamRange CatalogServiceClient::ListLocations( google::cloud::location::ListLocationsRequest request, Options opts) { diff --git a/google/cloud/dataplex/v1/catalog_client.h b/google/cloud/dataplex/v1/catalog_client.h index 8bcb1400464b9..06d1b8126066f 100644 --- a/google/cloud/dataplex/v1/catalog_client.h +++ b/google/cloud/dataplex/v1/catalog_client.h @@ -121,8 +121,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L969} - /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L625} + /// [google.cloud.dataplex.v1.CreateEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1041} + /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L697} /// // clang-format on future> CreateEntryType( @@ -176,8 +176,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L969} - /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L625} + /// [google.cloud.dataplex.v1.CreateEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1041} + /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L697} /// // clang-format on future> CreateEntryType( @@ -238,8 +238,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L625} - /// [google.cloud.dataplex.v1.UpdateEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L992} + /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L697} + /// [google.cloud.dataplex.v1.UpdateEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1064} /// // clang-format on future> UpdateEntryType( @@ -291,8 +291,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L625} - /// [google.cloud.dataplex.v1.UpdateEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L992} + /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L697} + /// [google.cloud.dataplex.v1.UpdateEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1064} /// // clang-format on future> UpdateEntryType( @@ -353,8 +353,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1006} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1078} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> @@ -404,8 +404,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1006} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1078} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> @@ -471,8 +471,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L625} - /// [google.cloud.dataplex.v1.ListEntryTypesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1022} + /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L697} + /// [google.cloud.dataplex.v1.ListEntryTypesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1094} /// // clang-format on StreamRange ListEntryTypes( @@ -510,8 +510,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L625} - /// [google.cloud.dataplex.v1.ListEntryTypesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1022} + /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L697} + /// [google.cloud.dataplex.v1.ListEntryTypesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1094} /// // clang-format on StreamRange ListEntryTypes( @@ -537,8 +537,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L625} - /// [google.cloud.dataplex.v1.GetEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1074} + /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L697} + /// [google.cloud.dataplex.v1.GetEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1146} /// // clang-format on StatusOr GetEntryType( @@ -567,8 +567,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L625} - /// [google.cloud.dataplex.v1.GetEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1074} + /// [google.cloud.dataplex.v1.EntryType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L697} + /// [google.cloud.dataplex.v1.GetEntryTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1146} /// // clang-format on StatusOr GetEntryType( @@ -604,8 +604,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L370} - /// [google.cloud.dataplex.v1.CreateAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1086} + /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L442} + /// [google.cloud.dataplex.v1.CreateAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1158} /// // clang-format on future> CreateAspectType( @@ -659,8 +659,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L370} - /// [google.cloud.dataplex.v1.CreateAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1086} + /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L442} + /// [google.cloud.dataplex.v1.CreateAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1158} /// // clang-format on future> CreateAspectType( @@ -721,8 +721,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L370} - /// [google.cloud.dataplex.v1.UpdateAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1109} + /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L442} + /// [google.cloud.dataplex.v1.UpdateAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1181} /// // clang-format on future> UpdateAspectType( @@ -774,8 +774,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L370} - /// [google.cloud.dataplex.v1.UpdateAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1109} + /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L442} + /// [google.cloud.dataplex.v1.UpdateAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1181} /// // clang-format on future> UpdateAspectType( @@ -836,8 +836,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1123} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1195} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> @@ -887,8 +887,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1123} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1195} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> @@ -954,8 +954,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L370} - /// [google.cloud.dataplex.v1.ListAspectTypesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1140} + /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L442} + /// [google.cloud.dataplex.v1.ListAspectTypesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1212} /// // clang-format on StreamRange ListAspectTypes( @@ -993,8 +993,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L370} - /// [google.cloud.dataplex.v1.ListAspectTypesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1140} + /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L442} + /// [google.cloud.dataplex.v1.ListAspectTypesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1212} /// // clang-format on StreamRange ListAspectTypes( @@ -1020,8 +1020,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L370} - /// [google.cloud.dataplex.v1.GetAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1192} + /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L442} + /// [google.cloud.dataplex.v1.GetAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1264} /// // clang-format on StatusOr GetAspectType( @@ -1050,8 +1050,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L370} - /// [google.cloud.dataplex.v1.GetAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1192} + /// [google.cloud.dataplex.v1.AspectType]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L442} + /// [google.cloud.dataplex.v1.GetAspectTypeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1264} /// // clang-format on StatusOr GetAspectType( @@ -1087,8 +1087,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L859} - /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L574} + /// [google.cloud.dataplex.v1.CreateEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L931} + /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L646} /// // clang-format on future> CreateEntryGroup( @@ -1142,8 +1142,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L859} - /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L574} + /// [google.cloud.dataplex.v1.CreateEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L931} + /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L646} /// // clang-format on future> CreateEntryGroup( @@ -1204,8 +1204,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L574} - /// [google.cloud.dataplex.v1.UpdateEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L882} + /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L646} + /// [google.cloud.dataplex.v1.UpdateEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L954} /// // clang-format on future> UpdateEntryGroup( @@ -1257,8 +1257,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L574} - /// [google.cloud.dataplex.v1.UpdateEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L882} + /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L646} + /// [google.cloud.dataplex.v1.UpdateEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L954} /// // clang-format on future> UpdateEntryGroup( @@ -1319,8 +1319,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L896} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L968} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> @@ -1370,8 +1370,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L896} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L968} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> @@ -1437,8 +1437,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L574} - /// [google.cloud.dataplex.v1.ListEntryGroupsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L913} + /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L646} + /// [google.cloud.dataplex.v1.ListEntryGroupsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L985} /// // clang-format on StreamRange ListEntryGroups( @@ -1476,8 +1476,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L574} - /// [google.cloud.dataplex.v1.ListEntryGroupsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L913} + /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L646} + /// [google.cloud.dataplex.v1.ListEntryGroupsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L985} /// // clang-format on StreamRange ListEntryGroups( @@ -1503,8 +1503,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L574} - /// [google.cloud.dataplex.v1.GetEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L957} + /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L646} + /// [google.cloud.dataplex.v1.GetEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1029} /// // clang-format on StatusOr GetEntryGroup( @@ -1533,8 +1533,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L574} - /// [google.cloud.dataplex.v1.GetEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L957} + /// [google.cloud.dataplex.v1.EntryGroup]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L646} + /// [google.cloud.dataplex.v1.GetEntryGroupRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1029} /// // clang-format on StatusOr GetEntryGroup( @@ -1581,8 +1581,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1204} - /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L743} + /// [google.cloud.dataplex.v1.CreateEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1276} + /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L815} /// // clang-format on StatusOr CreateEntry( @@ -1613,8 +1613,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1204} - /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L743} + /// [google.cloud.dataplex.v1.CreateEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1276} + /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L815} /// // clang-format on StatusOr CreateEntry( @@ -1644,8 +1644,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L743} - /// [google.cloud.dataplex.v1.UpdateEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1241} + /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L815} + /// [google.cloud.dataplex.v1.UpdateEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1313} /// // clang-format on StatusOr UpdateEntry( @@ -1675,8 +1675,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L743} - /// [google.cloud.dataplex.v1.UpdateEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1241} + /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L815} + /// [google.cloud.dataplex.v1.UpdateEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1313} /// // clang-format on StatusOr UpdateEntry( @@ -1702,8 +1702,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1284} - /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L743} + /// [google.cloud.dataplex.v1.DeleteEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1356} + /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L815} /// // clang-format on StatusOr DeleteEntry( @@ -1732,8 +1732,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1284} - /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L743} + /// [google.cloud.dataplex.v1.DeleteEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1356} + /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L815} /// // clang-format on StatusOr DeleteEntry( @@ -1743,11 +1743,6 @@ class CatalogServiceClient { // clang-format off /// /// Lists Entries within an EntryGroup. - /// Caution: The Vertex AI, Bigtable, Spanner, Pub/Sub, Dataform, and Dataproc - /// Metastore metadata that is stored in Dataplex Universal Catalog is - /// changing. For more information, see [Changes to metadata stored in - /// Dataplex Universal - /// Catalog](https://cloud.google.com/dataplex/docs/metadata-changes). /// /// @param parent Required. The resource name of the parent Entry Group: /// `projects/{project}/locations/{location}/entryGroups/{entry_group}`. @@ -1773,8 +1768,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L743} - /// [google.cloud.dataplex.v1.ListEntriesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1294} + /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L815} + /// [google.cloud.dataplex.v1.ListEntriesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1366} /// // clang-format on StreamRange ListEntries( @@ -1783,11 +1778,6 @@ class CatalogServiceClient { // clang-format off /// /// Lists Entries within an EntryGroup. - /// Caution: The Vertex AI, Bigtable, Spanner, Pub/Sub, Dataform, and Dataproc - /// Metastore metadata that is stored in Dataplex Universal Catalog is - /// changing. For more information, see [Changes to metadata stored in - /// Dataplex Universal - /// Catalog](https://cloud.google.com/dataplex/docs/metadata-changes). /// /// @param request Unary RPCs, such as the one wrapped by this /// function, receive a single `request` proto message which includes all @@ -1817,8 +1807,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L743} - /// [google.cloud.dataplex.v1.ListEntriesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1294} + /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L815} + /// [google.cloud.dataplex.v1.ListEntriesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1366} /// // clang-format on StreamRange ListEntries( @@ -1828,11 +1818,6 @@ class CatalogServiceClient { // clang-format off /// /// Gets an Entry. - /// Caution: The Vertex AI, Bigtable, Spanner, Pub/Sub, Dataform, and Dataproc - /// Metastore metadata that is stored in Dataplex Universal Catalog is - /// changing. For more information, see [Changes to metadata stored in - /// Dataplex Universal - /// Catalog](https://cloud.google.com/dataplex/docs/metadata-changes). /// /// @param name Required. The resource name of the Entry: /// `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}`. @@ -1849,8 +1834,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L743} - /// [google.cloud.dataplex.v1.GetEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1353} + /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L815} + /// [google.cloud.dataplex.v1.GetEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1425} /// // clang-format on StatusOr GetEntry(std::string const& name, @@ -1859,11 +1844,6 @@ class CatalogServiceClient { // clang-format off /// /// Gets an Entry. - /// Caution: The Vertex AI, Bigtable, Spanner, Pub/Sub, Dataform, and Dataproc - /// Metastore metadata that is stored in Dataplex Universal Catalog is - /// changing. For more information, see [Changes to metadata stored in - /// Dataplex Universal - /// Catalog](https://cloud.google.com/dataplex/docs/metadata-changes). /// /// @param request Unary RPCs, such as the one wrapped by this /// function, receive a single `request` proto message which includes all @@ -1884,8 +1864,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L743} - /// [google.cloud.dataplex.v1.GetEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1353} + /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L815} + /// [google.cloud.dataplex.v1.GetEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1425} /// // clang-format on StatusOr GetEntry( @@ -1895,11 +1875,6 @@ class CatalogServiceClient { // clang-format off /// /// Looks up an entry by name using the permission on the source system. - /// Caution: The Vertex AI, Bigtable, Spanner, Pub/Sub, Dataform, and Dataproc - /// Metastore metadata that is stored in Dataplex Universal Catalog is - /// changing. For more information, see [Changes to metadata stored in - /// Dataplex Universal - /// Catalog](https://cloud.google.com/dataplex/docs/metadata-changes). /// /// @param request Unary RPCs, such as the one wrapped by this /// function, receive a single `request` proto message which includes all @@ -1920,8 +1895,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L743} - /// [google.cloud.dataplex.v1.LookupEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1375} + /// [google.cloud.dataplex.v1.Entry]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L815} + /// [google.cloud.dataplex.v1.LookupEntryRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1447} /// // clang-format on StatusOr LookupEntry( @@ -1959,8 +1934,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.SearchEntriesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1400} - /// [google.cloud.dataplex.v1.SearchEntriesResult]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1444} + /// [google.cloud.dataplex.v1.SearchEntriesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1499} + /// [google.cloud.dataplex.v1.SearchEntriesResult]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1543} /// // clang-format on StreamRange SearchEntries( @@ -1998,8 +1973,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.SearchEntriesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1400} - /// [google.cloud.dataplex.v1.SearchEntriesResult]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1444} + /// [google.cloud.dataplex.v1.SearchEntriesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1499} + /// [google.cloud.dataplex.v1.SearchEntriesResult]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1543} /// // clang-format on StreamRange SearchEntries( @@ -2036,8 +2011,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateMetadataJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1542} - /// [google.cloud.dataplex.v1.MetadataJob]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1640} + /// [google.cloud.dataplex.v1.CreateMetadataJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1641} + /// [google.cloud.dataplex.v1.MetadataJob]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1739} /// // clang-format on future> CreateMetadataJob( @@ -2092,8 +2067,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateMetadataJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1542} - /// [google.cloud.dataplex.v1.MetadataJob]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1640} + /// [google.cloud.dataplex.v1.CreateMetadataJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1641} + /// [google.cloud.dataplex.v1.MetadataJob]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1739} /// // clang-format on future> CreateMetadataJob( @@ -2147,8 +2122,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.GetMetadataJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1565} - /// [google.cloud.dataplex.v1.MetadataJob]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1640} + /// [google.cloud.dataplex.v1.GetMetadataJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1664} + /// [google.cloud.dataplex.v1.MetadataJob]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1739} /// // clang-format on StatusOr GetMetadataJob( @@ -2177,8 +2152,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.GetMetadataJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1565} - /// [google.cloud.dataplex.v1.MetadataJob]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1640} + /// [google.cloud.dataplex.v1.GetMetadataJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1664} + /// [google.cloud.dataplex.v1.MetadataJob]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1739} /// // clang-format on StatusOr GetMetadataJob( @@ -2213,8 +2188,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.ListMetadataJobsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1577} - /// [google.cloud.dataplex.v1.MetadataJob]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1640} + /// [google.cloud.dataplex.v1.ListMetadataJobsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1676} + /// [google.cloud.dataplex.v1.MetadataJob]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1739} /// // clang-format on StreamRange ListMetadataJobs( @@ -2252,8 +2227,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.ListMetadataJobsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1577} - /// [google.cloud.dataplex.v1.MetadataJob]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1640} + /// [google.cloud.dataplex.v1.ListMetadataJobsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1676} + /// [google.cloud.dataplex.v1.MetadataJob]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1739} /// // clang-format on StreamRange ListMetadataJobs( @@ -2282,7 +2257,7 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CancelMetadataJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1628} + /// [google.cloud.dataplex.v1.CancelMetadataJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1727} /// // clang-format on Status CancelMetadataJob(std::string const& name, Options opts = {}); @@ -2313,7 +2288,7 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CancelMetadataJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1628} + /// [google.cloud.dataplex.v1.CancelMetadataJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1727} /// // clang-format on Status CancelMetadataJob( @@ -2346,8 +2321,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2207} - /// [google.cloud.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2123} + /// [google.cloud.dataplex.v1.CreateEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2316} + /// [google.cloud.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2224} /// // clang-format on StatusOr CreateEntryLink( @@ -2378,14 +2353,71 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2207} - /// [google.cloud.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2123} + /// [google.cloud.dataplex.v1.CreateEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2316} + /// [google.cloud.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2224} /// // clang-format on StatusOr CreateEntryLink( google::cloud::dataplex::v1::CreateEntryLinkRequest const& request, Options opts = {}); + // clang-format off + /// + /// Updates an Entry Link. + /// + /// @param entry_link Required. Entry Link 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.dataplex.v1.EntryLink]) + /// 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.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2224} + /// [google.cloud.dataplex.v1.UpdateEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2339} + /// + // clang-format on + StatusOr UpdateEntryLink( + google::cloud::dataplex::v1::EntryLink const& entry_link, + Options opts = {}); + + // clang-format off + /// + /// Updates an Entry Link. + /// + /// @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.dataplex.v1.UpdateEntryLinkRequest]. + /// 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.dataplex.v1.EntryLink]) + /// 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.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2224} + /// [google.cloud.dataplex.v1.UpdateEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2339} + /// + // clang-format on + StatusOr UpdateEntryLink( + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request, + Options opts = {}); + // clang-format off /// /// Deletes an Entry Link. @@ -2405,8 +2437,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2230} - /// [google.cloud.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2123} + /// [google.cloud.dataplex.v1.DeleteEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2357} + /// [google.cloud.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2224} /// // clang-format on StatusOr DeleteEntryLink( @@ -2435,14 +2467,85 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2230} - /// [google.cloud.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2123} + /// [google.cloud.dataplex.v1.DeleteEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2357} + /// [google.cloud.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2224} /// // clang-format on StatusOr DeleteEntryLink( google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request, Options opts = {}); + // clang-format off + /// + /// Looks up Entry Links referencing the specified Entry. + /// + /// @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.dataplex.v1.LookupEntryLinksRequest]. + /// 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.dataplex.v1.EntryLink], 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.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2224} + /// [google.cloud.dataplex.v1.LookupEntryLinksRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2369} + /// + // clang-format on + StreamRange LookupEntryLinks( + google::cloud::dataplex::v1::LookupEntryLinksRequest request, + Options opts = {}); + + // clang-format off + /// + /// Looks up LLM Context for the specified resources. + /// + /// @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.dataplex.v1.LookupContextRequest]. + /// 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.dataplex.v1.LookupContextResponse]) + /// 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.dataplex.v1.LookupContextRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1473} + /// [google.cloud.dataplex.v1.LookupContextResponse]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L1494} + /// + // clang-format on + StatusOr LookupContext( + google::cloud::dataplex::v1::LookupContextRequest const& request, + Options opts = {}); + // clang-format off /// /// Gets an Entry Link. @@ -2462,8 +2565,8 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2123} - /// [google.cloud.dataplex.v1.GetEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2242} + /// [google.cloud.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2224} + /// [google.cloud.dataplex.v1.GetEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2426} /// // clang-format on StatusOr GetEntryLink( @@ -2492,14 +2595,504 @@ class CatalogServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2123} - /// [google.cloud.dataplex.v1.GetEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2242} + /// [google.cloud.dataplex.v1.EntryLink]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2224} + /// [google.cloud.dataplex.v1.GetEntryLinkRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2426} /// // clang-format on StatusOr GetEntryLink( google::cloud::dataplex::v1::GetEntryLinkRequest const& request, Options opts = {}); + // clang-format off + /// + /// Creates a MetadataFeed. + /// + /// @param parent Required. The resource name of the parent location, in the format + /// `projects/{project_id_or_number}/locations/{location_id}` + /// @param metadata_feed Required. The metadata job resource. + /// @param metadata_feed_id Optional. The metadata job ID. If not provided, a unique ID is generated + /// with the prefix `metadata-job-`. + /// @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.dataplex.v1.MetadataFeed] 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.dataplex.v1.CreateMetadataFeedRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2571} + /// [google.cloud.dataplex.v1.MetadataFeed]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2438} + /// + // clang-format on + future> + CreateMetadataFeed( + std::string const& parent, + google::cloud::dataplex::v1::MetadataFeed const& metadata_feed, + std::string const& metadata_feed_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateMetadataFeed + /// + /// 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 CreateMetadataFeed( + NoAwaitTag, std::string const& parent, + google::cloud::dataplex::v1::MetadataFeed const& metadata_feed, + std::string const& metadata_feed_id, Options opts = {}); + + // clang-format off + /// + /// Creates a MetadataFeed. + /// + /// @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.dataplex.v1.CreateMetadataFeedRequest]. + /// 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.dataplex.v1.MetadataFeed] 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.dataplex.v1.CreateMetadataFeedRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2571} + /// [google.cloud.dataplex.v1.MetadataFeed]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2438} + /// + // clang-format on + future> + CreateMetadataFeed( + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateMetadataFeed + /// + /// 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 CreateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateMetadataFeed + /// + /// 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> + CreateMetadataFeed(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Gets a MetadataFeed. + /// + /// @param name Required. The resource name of the metadata feed, in the format + /// `projects/{project_id_or_number}/locations/{location_id}/MetadataFeeds/{metadata_feed_id}`. + /// @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.dataplex.v1.MetadataFeed]) + /// 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.dataplex.v1.GetMetadataFeedRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2594} + /// [google.cloud.dataplex.v1.MetadataFeed]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2438} + /// + // clang-format on + StatusOr GetMetadataFeed( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a MetadataFeed. + /// + /// @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.dataplex.v1.GetMetadataFeedRequest]. + /// 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.dataplex.v1.MetadataFeed]) + /// 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.dataplex.v1.GetMetadataFeedRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2594} + /// [google.cloud.dataplex.v1.MetadataFeed]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2438} + /// + // clang-format on + StatusOr GetMetadataFeed( + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Retrieve a list of MetadataFeeds. + /// + /// @param parent Required. The resource name of the parent location, in the format + /// `projects/{project_id_or_number}/locations/{location_id}` + /// @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.dataplex.v1.MetadataFeed], 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.dataplex.v1.ListMetadataFeedsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2606} + /// [google.cloud.dataplex.v1.MetadataFeed]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2438} + /// + // clang-format on + StreamRange ListMetadataFeeds( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Retrieve a list of MetadataFeeds. + /// + /// @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.dataplex.v1.ListMetadataFeedsRequest]. + /// 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.dataplex.v1.MetadataFeed], 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.dataplex.v1.ListMetadataFeedsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2606} + /// [google.cloud.dataplex.v1.MetadataFeed]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2438} + /// + // clang-format on + StreamRange ListMetadataFeeds( + google::cloud::dataplex::v1::ListMetadataFeedsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Deletes a MetadataFeed. + /// + /// @param name Required. The resource name of the metadata feed, in the format + /// `projects/{project_id_or_number}/locations/{location_id}/MetadataFeeds/{metadata_feed_id}`. + /// @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.dataplex.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.dataplex.v1.DeleteMetadataFeedRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2658} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} + /// + // clang-format on + future> + DeleteMetadataFeed(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteMetadataFeed + /// + /// 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 DeleteMetadataFeed( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a MetadataFeed. + /// + /// @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.dataplex.v1.DeleteMetadataFeedRequest]. + /// 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.dataplex.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.dataplex.v1.DeleteMetadataFeedRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2658} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} + /// + // clang-format on + future> + DeleteMetadataFeed( + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteMetadataFeed + /// + /// 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 DeleteMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteMetadataFeed + /// + /// 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> + DeleteMetadataFeed(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates a MetadataFeed. + /// + /// @param metadata_feed Required. Update description. + /// Only fields specified in `update_mask` are updated. + /// @param update_mask Optional. Mask of fields to update. + /// @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.dataplex.v1.MetadataFeed] 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.dataplex.v1.MetadataFeed]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2438} + /// [google.cloud.dataplex.v1.UpdateMetadataFeedRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2670} + /// + // clang-format on + future> + UpdateMetadataFeed( + google::cloud::dataplex::v1::MetadataFeed const& metadata_feed, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateMetadataFeed + /// + /// 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 UpdateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::MetadataFeed const& metadata_feed, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a MetadataFeed. + /// + /// @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.dataplex.v1.UpdateMetadataFeedRequest]. + /// 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.dataplex.v1.MetadataFeed] 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.dataplex.v1.MetadataFeed]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2438} + /// [google.cloud.dataplex.v1.UpdateMetadataFeedRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/catalog.proto#L2670} + /// + // clang-format on + future> + UpdateMetadataFeed( + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateMetadataFeed + /// + /// 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 UpdateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateMetadataFeed + /// + /// 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> + UpdateMetadataFeed(google::longrunning::Operation const& operation, + Options opts = {}); + // clang-format off /// /// Lists information about the supported locations for this service. @@ -2892,7 +3485,7 @@ class CatalogServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2931,7 +3524,7 @@ class CatalogServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataplex/v1/catalog_connection.cc b/google/cloud/dataplex/v1/catalog_connection.cc index 5f27def14b7f5..dda7ac8c6f481 100644 --- a/google/cloud/dataplex/v1/catalog_connection.cc +++ b/google/cloud/dataplex/v1/catalog_connection.cc @@ -380,18 +380,121 @@ CatalogServiceConnection::CreateEntryLink( return Status(StatusCode::kUnimplemented, "not implemented"); } +StatusOr +CatalogServiceConnection::UpdateEntryLink( + google::cloud::dataplex::v1::UpdateEntryLinkRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + StatusOr CatalogServiceConnection::DeleteEntryLink( google::cloud::dataplex::v1::DeleteEntryLinkRequest const&) { return Status(StatusCode::kUnimplemented, "not implemented"); } +StreamRange +CatalogServiceConnection::LookupEntryLinks( + google::cloud::dataplex::v1:: + LookupEntryLinksRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +CatalogServiceConnection::LookupContext( + google::cloud::dataplex::v1::LookupContextRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + StatusOr CatalogServiceConnection::GetEntryLink( google::cloud::dataplex::v1::GetEntryLinkRequest const&) { return Status(StatusCode::kUnimplemented, "not implemented"); } +future> +CatalogServiceConnection::CreateMetadataFeed( + google::cloud::dataplex::v1::CreateMetadataFeedRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +CatalogServiceConnection::CreateMetadataFeed( + NoAwaitTag, google::cloud::dataplex::v1::CreateMetadataFeedRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +CatalogServiceConnection::CreateMetadataFeed( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +CatalogServiceConnection::GetMetadataFeed( + google::cloud::dataplex::v1::GetMetadataFeedRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +CatalogServiceConnection::ListMetadataFeeds( + google::cloud::dataplex::v1:: + ListMetadataFeedsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +future> +CatalogServiceConnection::DeleteMetadataFeed( + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +CatalogServiceConnection::DeleteMetadataFeed( + NoAwaitTag, google::cloud::dataplex::v1::DeleteMetadataFeedRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +CatalogServiceConnection::DeleteMetadataFeed( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +CatalogServiceConnection::UpdateMetadataFeed( + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +CatalogServiceConnection::UpdateMetadataFeed( + NoAwaitTag, google::cloud::dataplex::v1::UpdateMetadataFeedRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +CatalogServiceConnection::UpdateMetadataFeed( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + StreamRange CatalogServiceConnection::ListLocations( google::cloud::location:: diff --git a/google/cloud/dataplex/v1/catalog_connection.h b/google/cloud/dataplex/v1/catalog_connection.h index 8119d1f1ed3f8..04a8fd73f5257 100644 --- a/google/cloud/dataplex/v1/catalog_connection.h +++ b/google/cloud/dataplex/v1/catalog_connection.h @@ -348,12 +348,62 @@ class CatalogServiceConnection { virtual StatusOr CreateEntryLink( google::cloud::dataplex::v1::CreateEntryLinkRequest const& request); + virtual StatusOr UpdateEntryLink( + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request); + virtual StatusOr DeleteEntryLink( google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request); + virtual StreamRange LookupEntryLinks( + google::cloud::dataplex::v1::LookupEntryLinksRequest request); + + virtual StatusOr + LookupContext( + google::cloud::dataplex::v1::LookupContextRequest const& request); + virtual StatusOr GetEntryLink( google::cloud::dataplex::v1::GetEntryLinkRequest const& request); + virtual future> + CreateMetadataFeed( + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request); + + virtual StatusOr CreateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request); + + virtual future> + CreateMetadataFeed(google::longrunning::Operation const& operation); + + virtual StatusOr GetMetadataFeed( + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request); + + virtual StreamRange + ListMetadataFeeds( + google::cloud::dataplex::v1::ListMetadataFeedsRequest request); + + virtual future> + DeleteMetadataFeed( + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request); + + virtual StatusOr DeleteMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request); + + virtual future> + DeleteMetadataFeed(google::longrunning::Operation const& operation); + + virtual future> + UpdateMetadataFeed( + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request); + + virtual StatusOr UpdateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request); + + virtual future> + UpdateMetadataFeed(google::longrunning::Operation const& operation); + virtual StreamRange ListLocations( google::cloud::location::ListLocationsRequest request); diff --git a/google/cloud/dataplex/v1/catalog_connection_idempotency_policy.cc b/google/cloud/dataplex/v1/catalog_connection_idempotency_policy.cc index 87e701ed61754..79bace33ae8ac 100644 --- a/google/cloud/dataplex/v1/catalog_connection_idempotency_policy.cc +++ b/google/cloud/dataplex/v1/catalog_connection_idempotency_policy.cc @@ -169,16 +169,56 @@ Idempotency CatalogServiceConnectionIdempotencyPolicy::CreateEntryLink( return Idempotency::kNonIdempotent; } +Idempotency CatalogServiceConnectionIdempotencyPolicy::UpdateEntryLink( + google::cloud::dataplex::v1::UpdateEntryLinkRequest const&) { + return Idempotency::kNonIdempotent; +} + Idempotency CatalogServiceConnectionIdempotencyPolicy::DeleteEntryLink( google::cloud::dataplex::v1::DeleteEntryLinkRequest const&) { return Idempotency::kNonIdempotent; } +Idempotency CatalogServiceConnectionIdempotencyPolicy::LookupEntryLinks( + google::cloud::dataplex::v1::LookupEntryLinksRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency CatalogServiceConnectionIdempotencyPolicy::LookupContext( + google::cloud::dataplex::v1::LookupContextRequest const&) { + return Idempotency::kNonIdempotent; +} + Idempotency CatalogServiceConnectionIdempotencyPolicy::GetEntryLink( google::cloud::dataplex::v1::GetEntryLinkRequest const&) { return Idempotency::kIdempotent; } +Idempotency CatalogServiceConnectionIdempotencyPolicy::CreateMetadataFeed( + google::cloud::dataplex::v1::CreateMetadataFeedRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency CatalogServiceConnectionIdempotencyPolicy::GetMetadataFeed( + google::cloud::dataplex::v1::GetMetadataFeedRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency CatalogServiceConnectionIdempotencyPolicy::ListMetadataFeeds( + google::cloud::dataplex::v1::ListMetadataFeedsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency CatalogServiceConnectionIdempotencyPolicy::DeleteMetadataFeed( + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency CatalogServiceConnectionIdempotencyPolicy::UpdateMetadataFeed( + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const&) { + return Idempotency::kNonIdempotent; +} + Idempotency CatalogServiceConnectionIdempotencyPolicy::ListLocations( google::cloud::location::ListLocationsRequest) { // NOLINT return Idempotency::kIdempotent; diff --git a/google/cloud/dataplex/v1/catalog_connection_idempotency_policy.h b/google/cloud/dataplex/v1/catalog_connection_idempotency_policy.h index 3734e2cd0bc15..560349dcc4891 100644 --- a/google/cloud/dataplex/v1/catalog_connection_idempotency_policy.h +++ b/google/cloud/dataplex/v1/catalog_connection_idempotency_policy.h @@ -121,12 +121,36 @@ class CatalogServiceConnectionIdempotencyPolicy { virtual google::cloud::Idempotency CreateEntryLink( google::cloud::dataplex::v1::CreateEntryLinkRequest const& request); + virtual google::cloud::Idempotency UpdateEntryLink( + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request); + virtual google::cloud::Idempotency DeleteEntryLink( google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request); + virtual google::cloud::Idempotency LookupEntryLinks( + google::cloud::dataplex::v1::LookupEntryLinksRequest request); + + virtual google::cloud::Idempotency LookupContext( + google::cloud::dataplex::v1::LookupContextRequest const& request); + virtual google::cloud::Idempotency GetEntryLink( google::cloud::dataplex::v1::GetEntryLinkRequest const& request); + virtual google::cloud::Idempotency CreateMetadataFeed( + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request); + + virtual google::cloud::Idempotency GetMetadataFeed( + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request); + + virtual google::cloud::Idempotency ListMetadataFeeds( + google::cloud::dataplex::v1::ListMetadataFeedsRequest request); + + virtual google::cloud::Idempotency DeleteMetadataFeed( + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request); + + virtual google::cloud::Idempotency UpdateMetadataFeed( + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request); + virtual google::cloud::Idempotency ListLocations( google::cloud::location::ListLocationsRequest request); diff --git a/google/cloud/dataplex/v1/cmek_client.cc b/google/cloud/dataplex/v1/cmek_client.cc new file mode 100644 index 0000000000000..9c809db927ec1 --- /dev/null +++ b/google/cloud/dataplex/v1/cmek_client.cc @@ -0,0 +1,298 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#include "google/cloud/dataplex/v1/cmek_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +CmekServiceClient::CmekServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +CmekServiceClient::~CmekServiceClient() = default; + +future> +CmekServiceClient::CreateEncryptionConfig( + std::string const& parent, + google::cloud::dataplex::v1::EncryptionConfig const& encryption_config, + std::string const& encryption_config_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::CreateEncryptionConfigRequest request; + request.set_parent(parent); + *request.mutable_encryption_config() = encryption_config; + request.set_encryption_config_id(encryption_config_id); + return connection_->CreateEncryptionConfig(request); +} + +StatusOr +CmekServiceClient::CreateEncryptionConfig( + NoAwaitTag, std::string const& parent, + google::cloud::dataplex::v1::EncryptionConfig const& encryption_config, + std::string const& encryption_config_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::CreateEncryptionConfigRequest request; + request.set_parent(parent); + *request.mutable_encryption_config() = encryption_config; + request.set_encryption_config_id(encryption_config_id); + return connection_->CreateEncryptionConfig(NoAwaitTag{}, request); +} + +future> +CmekServiceClient::CreateEncryptionConfig( + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateEncryptionConfig(request); +} + +StatusOr +CmekServiceClient::CreateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateEncryptionConfig(NoAwaitTag{}, request); +} + +future> +CmekServiceClient::CreateEncryptionConfig( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateEncryptionConfig(operation); +} + +future> +CmekServiceClient::UpdateEncryptionConfig( + google::cloud::dataplex::v1::EncryptionConfig const& encryption_config, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest request; + *request.mutable_encryption_config() = encryption_config; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateEncryptionConfig(request); +} + +StatusOr +CmekServiceClient::UpdateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::EncryptionConfig const& encryption_config, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest request; + *request.mutable_encryption_config() = encryption_config; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateEncryptionConfig(NoAwaitTag{}, request); +} + +future> +CmekServiceClient::UpdateEncryptionConfig( + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateEncryptionConfig(request); +} + +StatusOr +CmekServiceClient::UpdateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateEncryptionConfig(NoAwaitTag{}, request); +} + +future> +CmekServiceClient::UpdateEncryptionConfig( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateEncryptionConfig(operation); +} + +future> +CmekServiceClient::DeleteEncryptionConfig(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest request; + request.set_name(name); + return connection_->DeleteEncryptionConfig(request); +} + +StatusOr +CmekServiceClient::DeleteEncryptionConfig(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest request; + request.set_name(name); + return connection_->DeleteEncryptionConfig(NoAwaitTag{}, request); +} + +future> +CmekServiceClient::DeleteEncryptionConfig( + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteEncryptionConfig(request); +} + +StatusOr +CmekServiceClient::DeleteEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteEncryptionConfig(NoAwaitTag{}, request); +} + +future> +CmekServiceClient::DeleteEncryptionConfig( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteEncryptionConfig(operation); +} + +StreamRange +CmekServiceClient::ListEncryptionConfigs(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::ListEncryptionConfigsRequest request; + request.set_parent(parent); + return connection_->ListEncryptionConfigs(request); +} + +StreamRange +CmekServiceClient::ListEncryptionConfigs( + google::cloud::dataplex::v1::ListEncryptionConfigsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListEncryptionConfigs(std::move(request)); +} + +StatusOr +CmekServiceClient::GetEncryptionConfig(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::GetEncryptionConfigRequest request; + request.set_name(name); + return connection_->GetEncryptionConfig(request); +} + +StatusOr +CmekServiceClient::GetEncryptionConfig( + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetEncryptionConfig(request); +} + +StreamRange CmekServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr CmekServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StatusOr CmekServiceClient::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->SetIamPolicy(request); +} + +StatusOr CmekServiceClient::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetIamPolicy(request); +} + +StatusOr +CmekServiceClient::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->TestIamPermissions(request); +} + +StreamRange CmekServiceClient::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 CmekServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr CmekServiceClient::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 CmekServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status CmekServiceClient::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 CmekServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status CmekServiceClient::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 CmekServiceClient::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 dataplex_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/cmek_client.h b/google/cloud/dataplex/v1/cmek_client.h new file mode 100644 index 0000000000000..b32015a3b8014 --- /dev/null +++ b/google/cloud/dataplex/v1/cmek_client.h @@ -0,0 +1,1028 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CMEK_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CMEK_CLIENT_H + +#include "google/cloud/dataplex/v1/cmek_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 "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// Dataplex Universal Catalog Customer Managed Encryption Keys (CMEK) Service +/// +/// @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 CmekServiceClient { + public: + explicit CmekServiceClient(std::shared_ptr connection, + Options opts = {}); + ~CmekServiceClient(); + + ///@{ + /// @name Copy and move support + CmekServiceClient(CmekServiceClient const&) = default; + CmekServiceClient& operator=(CmekServiceClient const&) = default; + CmekServiceClient(CmekServiceClient&&) = default; + CmekServiceClient& operator=(CmekServiceClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(CmekServiceClient const& a, + CmekServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(CmekServiceClient const& a, + CmekServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Create an EncryptionConfig. + /// + /// @param parent Required. The location at which the EncryptionConfig is to be created. + /// @param encryption_config Required. The EncryptionConfig to create. + /// @param encryption_config_id Required. The ID of the + /// [EncryptionConfig][google.cloud.dataplex.v1.EncryptionConfig] to create. + /// Currently, only a value of "default" is supported. + /// @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.dataplex.v1.EncryptionConfig] 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.dataplex.v1.CreateEncryptionConfigRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L198} + /// [google.cloud.dataplex.v1.EncryptionConfig]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L110} + /// + // clang-format on + future> + CreateEncryptionConfig( + std::string const& parent, + google::cloud::dataplex::v1::EncryptionConfig const& encryption_config, + std::string const& encryption_config_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateEncryptionConfig + /// + /// 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 CreateEncryptionConfig( + NoAwaitTag, std::string const& parent, + google::cloud::dataplex::v1::EncryptionConfig const& encryption_config, + std::string const& encryption_config_id, Options opts = {}); + + // clang-format off + /// + /// Create an EncryptionConfig. + /// + /// @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.dataplex.v1.CreateEncryptionConfigRequest]. + /// 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.dataplex.v1.EncryptionConfig] 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.dataplex.v1.CreateEncryptionConfigRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L198} + /// [google.cloud.dataplex.v1.EncryptionConfig]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L110} + /// + // clang-format on + future> + CreateEncryptionConfig( + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateEncryptionConfig + /// + /// 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 CreateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateEncryptionConfig + /// + /// 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> + CreateEncryptionConfig(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Update an EncryptionConfig. + /// + /// @param encryption_config Required. The EncryptionConfig to update. + /// @param update_mask Optional. Mask of fields to update. + /// The service treats an omitted field mask as an implied field mask + /// equivalent to all fields that are populated (have a non-empty value). + /// @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.dataplex.v1.EncryptionConfig] 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.dataplex.v1.EncryptionConfig]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L110} + /// [google.cloud.dataplex.v1.UpdateEncryptionConfigRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L229} + /// + // clang-format on + future> + UpdateEncryptionConfig( + google::cloud::dataplex::v1::EncryptionConfig const& encryption_config, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateEncryptionConfig + /// + /// 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 UpdateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::EncryptionConfig const& encryption_config, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Update an EncryptionConfig. + /// + /// @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.dataplex.v1.UpdateEncryptionConfigRequest]. + /// 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.dataplex.v1.EncryptionConfig] 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.dataplex.v1.EncryptionConfig]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L110} + /// [google.cloud.dataplex.v1.UpdateEncryptionConfigRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L229} + /// + // clang-format on + future> + UpdateEncryptionConfig( + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateEncryptionConfig + /// + /// 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 UpdateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateEncryptionConfig + /// + /// 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> + UpdateEncryptionConfig(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Delete an EncryptionConfig. + /// + /// @param name Required. The name of the EncryptionConfig to delete. + /// @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.dataplex.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.dataplex.v1.DeleteEncryptionConfigRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L242} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} + /// + // clang-format on + future> + DeleteEncryptionConfig(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteEncryptionConfig + /// + /// 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 DeleteEncryptionConfig( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Delete an EncryptionConfig. + /// + /// @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.dataplex.v1.DeleteEncryptionConfigRequest]. + /// 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.dataplex.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.dataplex.v1.DeleteEncryptionConfigRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L242} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} + /// + // clang-format on + future> + DeleteEncryptionConfig( + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteEncryptionConfig + /// + /// 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 DeleteEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteEncryptionConfig + /// + /// 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> + DeleteEncryptionConfig(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// List EncryptionConfigs. + /// + /// @param parent Required. The location for which the EncryptionConfig is to be listed. + /// @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.dataplex.v1.EncryptionConfig], 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.dataplex.v1.EncryptionConfig]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L110} + /// [google.cloud.dataplex.v1.ListEncryptionConfigsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L256} + /// + // clang-format on + StreamRange + ListEncryptionConfigs(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// List EncryptionConfigs. + /// + /// @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.dataplex.v1.ListEncryptionConfigsRequest]. + /// 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.dataplex.v1.EncryptionConfig], 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.dataplex.v1.EncryptionConfig]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L110} + /// [google.cloud.dataplex.v1.ListEncryptionConfigsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L256} + /// + // clang-format on + StreamRange + ListEncryptionConfigs( + google::cloud::dataplex::v1::ListEncryptionConfigsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Get an EncryptionConfig. + /// + /// @param name Required. The name of the EncryptionConfig to fetch. + /// @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.dataplex.v1.EncryptionConfig]) + /// 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.dataplex.v1.EncryptionConfig]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L110} + /// [google.cloud.dataplex.v1.GetEncryptionConfigRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L218} + /// + // clang-format on + StatusOr GetEncryptionConfig( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Get an EncryptionConfig. + /// + /// @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.dataplex.v1.GetEncryptionConfigRequest]. + /// 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.dataplex.v1.EncryptionConfig]) + /// 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.dataplex.v1.EncryptionConfig]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L110} + /// [google.cloud.dataplex.v1.GetEncryptionConfigRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/cmek.proto#L218} + /// + // clang-format on + StatusOr GetEncryptionConfig( + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& request, + 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 + /// + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. + /// + /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + /// + /// @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.iam.v1.SetIamPolicyRequest]. + /// 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.iam.v1.Policy]) + /// 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.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L102} + /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L100} + /// + // clang-format on + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request, Options opts = {}); + + // clang-format off + /// + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// @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.iam.v1.GetIamPolicyRequest]. + /// 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.iam.v1.Policy]) + /// 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.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123} + /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L102} + /// + // clang-format on + StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request, Options opts = {}); + + // clang-format off + /// + /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. + /// + /// @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.iam.v1.TestIamPermissionsRequest]. + /// 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.iam.v1.TestIamPermissionsResponse]) + /// 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.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L137} + /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L153} + /// + // clang-format on + StatusOr TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 dataplex_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CMEK_CLIENT_H diff --git a/google/cloud/dataplex/v1/cmek_connection.cc b/google/cloud/dataplex/v1/cmek_connection.cc new file mode 100644 index 0000000000000..f82e2f7913e7d --- /dev/null +++ b/google/cloud/dataplex/v1/cmek_connection.cc @@ -0,0 +1,198 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#include "google/cloud/dataplex/v1/cmek_connection.h" +#include "google/cloud/dataplex/v1/cmek_options.h" +#include "google/cloud/dataplex/v1/internal/cmek_connection_impl.h" +#include "google/cloud/dataplex/v1/internal/cmek_option_defaults.h" +#include "google/cloud/dataplex/v1/internal/cmek_stub_factory.h" +#include "google/cloud/dataplex/v1/internal/cmek_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 dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +CmekServiceConnection::~CmekServiceConnection() = default; + +future> +CmekServiceConnection::CreateEncryptionConfig( + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +CmekServiceConnection::CreateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +CmekServiceConnection::CreateEncryptionConfig( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +CmekServiceConnection::UpdateEncryptionConfig( + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +CmekServiceConnection::UpdateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +CmekServiceConnection::UpdateEncryptionConfig( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +CmekServiceConnection::DeleteEncryptionConfig( + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +CmekServiceConnection::DeleteEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +CmekServiceConnection::DeleteEncryptionConfig( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +CmekServiceConnection::ListEncryptionConfigs( + google::cloud::dataplex::v1:: + ListEncryptionConfigsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +CmekServiceConnection::GetEncryptionConfig( + google::cloud::dataplex::v1::GetEncryptionConfigRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +CmekServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr CmekServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr CmekServiceConnection::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr CmekServiceConnection::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +CmekServiceConnection::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +CmekServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr CmekServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status CmekServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status CmekServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeCmekServiceConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = dataplex_v1_internal::CmekServiceDefaultOptions(std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = dataplex_v1_internal::CreateDefaultCmekServiceStub( + std::move(auth), options); + return dataplex_v1_internal::MakeCmekServiceTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/cmek_connection.h b/google/cloud/dataplex/v1/cmek_connection.h new file mode 100644 index 0000000000000..abb9d66135130 --- /dev/null +++ b/google/cloud/dataplex/v1/cmek_connection.h @@ -0,0 +1,292 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CMEK_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CMEK_CONNECTION_H + +#include "google/cloud/dataplex/v1/cmek.pb.h" +#include "google/cloud/dataplex/v1/cmek_connection_idempotency_policy.h" +#include "google/cloud/dataplex/v1/internal/cmek_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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `CmekServiceConnection`. +class CmekServiceRetryPolicy : 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 `CmekServiceConnection` 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 CmekServiceLimitedErrorCountRetryPolicy : public CmekServiceRetryPolicy { + 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 CmekServiceLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + CmekServiceLimitedErrorCountRetryPolicy( + CmekServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : CmekServiceLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + CmekServiceLimitedErrorCountRetryPolicy( + CmekServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : CmekServiceLimitedErrorCountRetryPolicy(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 = CmekServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + dataplex_v1_internal::CmekServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `CmekServiceConnection` 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 CmekServiceLimitedTimeRetryPolicy : public CmekServiceRetryPolicy { + 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 CmekServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + CmekServiceLimitedTimeRetryPolicy( + CmekServiceLimitedTimeRetryPolicy&& rhs) noexcept + : CmekServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + CmekServiceLimitedTimeRetryPolicy( + CmekServiceLimitedTimeRetryPolicy const& rhs) noexcept + : CmekServiceLimitedTimeRetryPolicy(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 = CmekServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + dataplex_v1_internal::CmekServiceRetryTraits> + impl_; +}; + +/** + * The `CmekServiceConnection` object for `CmekServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `CmekServiceClient`. This allows users to inject custom behavior + * (e.g., with a Google Mock object) when writing tests that use objects of type + * `CmekServiceClient`. + * + * To create a concrete instance, see `MakeCmekServiceConnection()`. + * + * For mocking, see `dataplex_v1_mocks::MockCmekServiceConnection`. + */ +class CmekServiceConnection { + public: + virtual ~CmekServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual future> + CreateEncryptionConfig( + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& + request); + + virtual StatusOr CreateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& + request); + + virtual future> + CreateEncryptionConfig(google::longrunning::Operation const& operation); + + virtual future> + UpdateEncryptionConfig( + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& + request); + + virtual StatusOr UpdateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& + request); + + virtual future> + UpdateEncryptionConfig(google::longrunning::Operation const& operation); + + virtual future> + DeleteEncryptionConfig( + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& + request); + + virtual StatusOr DeleteEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& + request); + + virtual future> + DeleteEncryptionConfig(google::longrunning::Operation const& operation); + + virtual StreamRange + ListEncryptionConfigs( + google::cloud::dataplex::v1::ListEncryptionConfigsRequest request); + + virtual StatusOr + GetEncryptionConfig( + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& request); + + virtual StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request); + + virtual StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request); + + virtual StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request); + + virtual StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request); + + virtual StatusOr + TestIamPermissions(google::iam::v1::TestIamPermissionsRequest 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 `CmekServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of CmekServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `CmekServiceConnection`. Expected options are any of the types in + * the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::dataplex_v1::CmekServicePolicyOptionList` + * + * @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 `CmekServiceConnection` created by + * this function. + */ +std::shared_ptr MakeCmekServiceConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CMEK_CONNECTION_H diff --git a/google/cloud/dataplex/v1/cmek_connection_idempotency_policy.cc b/google/cloud/dataplex/v1/cmek_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..a4d135622eff7 --- /dev/null +++ b/google/cloud/dataplex/v1/cmek_connection_idempotency_policy.cc @@ -0,0 +1,116 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#include "google/cloud/dataplex/v1/cmek_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +CmekServiceConnectionIdempotencyPolicy:: + ~CmekServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +CmekServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::CreateEncryptionConfig( + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::UpdateEncryptionConfig( + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::DeleteEncryptionConfig( + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::ListEncryptionConfigs( + google::cloud::dataplex::v1::ListEncryptionConfigsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::GetEncryptionConfig( + google::cloud::dataplex::v1::GetEncryptionConfigRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { + return request.policy().etag().empty() ? Idempotency::kNonIdempotent + : Idempotency::kIdempotent; +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency CmekServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultCmekServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/cmek_connection_idempotency_policy.h b/google/cloud/dataplex/v1/cmek_connection_idempotency_policy.h new file mode 100644 index 0000000000000..5a84714ef8775 --- /dev/null +++ b/google/cloud/dataplex/v1/cmek_connection_idempotency_policy.h @@ -0,0 +1,96 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CMEK_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CMEK_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/dataplex/v1/cmek.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class CmekServiceConnectionIdempotencyPolicy { + public: + virtual ~CmekServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() const; + + virtual google::cloud::Idempotency CreateEncryptionConfig( + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& + request); + + virtual google::cloud::Idempotency UpdateEncryptionConfig( + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& + request); + + virtual google::cloud::Idempotency DeleteEncryptionConfig( + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& + request); + + virtual google::cloud::Idempotency ListEncryptionConfigs( + google::cloud::dataplex::v1::ListEncryptionConfigsRequest request); + + virtual google::cloud::Idempotency GetEncryptionConfig( + google::cloud::dataplex::v1::GetEncryptionConfigRequest 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 SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request); + + virtual google::cloud::Idempotency GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request); + + virtual google::cloud::Idempotency TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest 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 +MakeDefaultCmekServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CMEK_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/dataplex/v1/cmek_options.h b/google/cloud/dataplex/v1/cmek_options.h new file mode 100644 index 0000000000000..c8ca12b8e3130 --- /dev/null +++ b/google/cloud/dataplex/v1/cmek_options.h @@ -0,0 +1,86 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CMEK_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CMEK_OPTIONS_H + +#include "google/cloud/dataplex/v1/cmek_connection.h" +#include "google/cloud/dataplex/v1/cmek_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 dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-dataplex-options + */ +struct CmekServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-dataplex-options + */ +struct CmekServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-dataplex-options + */ +struct CmekServiceConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-dataplex-options + */ +struct CmekServicePollingPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to CmekService. + * + * @ingroup google-cloud-dataplex-options + */ +using CmekServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_CMEK_OPTIONS_H diff --git a/google/cloud/dataplex/v1/content_client.cc b/google/cloud/dataplex/v1/content_client.cc index eeab3a30a3e1b..a17e5ed657d34 100644 --- a/google/cloud/dataplex/v1/content_client.cc +++ b/google/cloud/dataplex/v1/content_client.cc @@ -32,80 +32,23 @@ ContentServiceClient::ContentServiceClient( internal::MergeOptions(std::move(opts), connection_->options())) {} ContentServiceClient::~ContentServiceClient() = default; -StatusOr -ContentServiceClient::CreateContent( - std::string const& parent, - google::cloud::dataplex::v1::Content const& content, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::CreateContentRequest request; - request.set_parent(parent); - *request.mutable_content() = content; - return connection_->CreateContent(request); -} - -StatusOr -ContentServiceClient::CreateContent( - google::cloud::dataplex::v1::CreateContentRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->CreateContent(request); -} - -StatusOr -ContentServiceClient::UpdateContent( - google::cloud::dataplex::v1::Content const& content, - google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::UpdateContentRequest request; - *request.mutable_content() = content; - *request.mutable_update_mask() = update_mask; - return connection_->UpdateContent(request); -} - -StatusOr -ContentServiceClient::UpdateContent( - google::cloud::dataplex::v1::UpdateContentRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->UpdateContent(request); -} - -Status ContentServiceClient::DeleteContent(std::string const& name, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::DeleteContentRequest request; - request.set_name(name); - return connection_->DeleteContent(request); -} - -Status ContentServiceClient::DeleteContent( - google::cloud::dataplex::v1::DeleteContentRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->DeleteContent(request); -} - -StatusOr ContentServiceClient::GetContent( - std::string const& name, Options opts) { +StreamRange +ContentServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::GetContentRequest request; - request.set_name(name); - return connection_->GetContent(request); + return connection_->ListLocations(std::move(request)); } -StatusOr ContentServiceClient::GetContent( - google::cloud::dataplex::v1::GetContentRequest const& request, - Options opts) { +StatusOr ContentServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->GetContent(request); + return connection_->GetLocation(request); } -StatusOr ContentServiceClient::GetIamPolicy( - std::string const& resource, Options opts) { +StatusOr ContentServiceClient::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::iam::v1::GetIamPolicyRequest request; - request.set_resource(resource); - return connection_->GetIamPolicy(request); + return connection_->SetIamPolicy(request); } StatusOr ContentServiceClient::GetIamPolicy( @@ -114,12 +57,6 @@ StatusOr ContentServiceClient::GetIamPolicy( return connection_->GetIamPolicy(request); } -StatusOr ContentServiceClient::SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->SetIamPolicy(request); -} - StatusOr ContentServiceClient::TestIamPermissions( google::iam::v1::TestIamPermissionsRequest const& request, Options opts) { @@ -127,34 +64,6 @@ ContentServiceClient::TestIamPermissions( return connection_->TestIamPermissions(request); } -StreamRange -ContentServiceClient::ListContent(std::string const& parent, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::ListContentRequest request; - request.set_parent(parent); - return connection_->ListContent(request); -} - -StreamRange -ContentServiceClient::ListContent( - google::cloud::dataplex::v1::ListContentRequest request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->ListContent(std::move(request)); -} - -StreamRange -ContentServiceClient::ListLocations( - google::cloud::location::ListLocationsRequest request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->ListLocations(std::move(request)); -} - -StatusOr ContentServiceClient::GetLocation( - google::cloud::location::GetLocationRequest const& request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->GetLocation(request); -} - StreamRange ContentServiceClient::ListOperations(std::string const& name, std::string const& filter, Options opts) { diff --git a/google/cloud/dataplex/v1/content_client.h b/google/cloud/dataplex/v1/content_client.h index 59dee72f73a5e..24211e7ac1ee7 100644 --- a/google/cloud/dataplex/v1/content_client.h +++ b/google/cloud/dataplex/v1/content_client.h @@ -89,76 +89,29 @@ class ContentServiceClient { // clang-format off /// - /// Create a content. - /// - /// @param parent Required. The resource name of the parent lake: - /// projects/{project_id}/locations/{location_id}/lakes/{lake_id} - /// @param content Required. Content 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.dataplex.v1.Content]) - /// 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.dataplex.v1.Content]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L175} - /// [google.cloud.dataplex.v1.CreateContentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/content.proto#L158} - /// - // clang-format on - StatusOr CreateContent( - std::string const& parent, - google::cloud::dataplex::v1::Content const& content, Options opts = {}); - - // clang-format off - /// - /// Create a content. + /// 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.dataplex.v1.CreateContentRequest]. + /// [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 the result of the RPC. The response message type - /// ([google.cloud.dataplex.v1.Content]) - /// 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.dataplex.v1.Content]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L175} - /// [google.cloud.dataplex.v1.CreateContentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/content.proto#L158} - /// - // clang-format on - StatusOr CreateContent( - google::cloud::dataplex::v1::CreateContentRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// Update a content. Only supports full resource update. - /// - /// @param content Required. Update description. - /// Only fields specified in `update_mask` are updated. - /// @param update_mask Required. Mask of fields to update. - /// @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.dataplex.v1.Content]) - /// is mapped to a C++ class using the [Protobuf mapping rules]. - /// If the request fails, the [`StatusOr`] contains the error details. + /// @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 @@ -166,28 +119,27 @@ class ContentServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.Content]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L175} - /// [google.cloud.dataplex.v1.UpdateContentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/content.proto#L175} + /// [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 - StatusOr UpdateContent( - google::cloud::dataplex::v1::Content const& content, - google::protobuf::FieldMask const& update_mask, Options opts = {}); + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts = {}); // clang-format off /// - /// Update a content. Only supports full resource update. + /// 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.dataplex.v1.UpdateContentRequest]. + /// [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.dataplex.v1.Content]) + /// ([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. /// @@ -197,135 +149,30 @@ class ContentServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.Content]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L175} - /// [google.cloud.dataplex.v1.UpdateContentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/content.proto#L175} - /// - // clang-format on - StatusOr UpdateContent( - google::cloud::dataplex::v1::UpdateContentRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// Delete a content. - /// - /// @param name Required. The resource name of the content: - /// projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id} - /// @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.cloud.dataplex.v1.DeleteContentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/content.proto#L190} - /// - // clang-format on - Status DeleteContent(std::string const& name, Options opts = {}); - - // clang-format off - /// - /// Delete a content. - /// - /// @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.dataplex.v1.DeleteContentRequest]. - /// 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.cloud.dataplex.v1.DeleteContentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/content.proto#L190} + /// [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 - Status DeleteContent( - google::cloud::dataplex::v1::DeleteContentRequest const& request, + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts = {}); // clang-format off /// - /// Get a content resource. + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. /// - /// @param name Required. The resource name of the content: - /// projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id} - /// @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.dataplex.v1.Content]) - /// 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.dataplex.v1.Content]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L175} - /// [google.cloud.dataplex.v1.GetContentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/content.proto#L244} - /// - // clang-format on - StatusOr GetContent( - std::string const& name, Options opts = {}); - - // clang-format off - /// - /// Get a content resource. + /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. /// /// @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.dataplex.v1.GetContentRequest]. + /// [google.iam.v1.SetIamPolicyRequest]. /// 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.dataplex.v1.Content]) - /// 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.dataplex.v1.Content]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L175} - /// [google.cloud.dataplex.v1.GetContentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/content.proto#L244} - /// - // clang-format on - StatusOr GetContent( - google::cloud::dataplex::v1::GetContentRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// Gets the access control policy for a contentitem resource. A `NOT_FOUND` - /// error is returned if the resource does not exist. An empty policy is - /// returned if the resource exists but does not have a policy set on it. - /// - /// Caller must have Google IAM `dataplex.content.getIamPolicy` permission - /// on the resource. - /// - /// @param resource REQUIRED: The resource for which the policy is being requested. - /// See the operation documentation for the appropriate value for this field. - /// @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.iam.v1.Policy]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. @@ -336,21 +183,18 @@ class ContentServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123} /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L102} + /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L100} /// // clang-format on - StatusOr GetIamPolicy(std::string const& resource, - Options opts = {}); + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// Gets the access control policy for a contentitem resource. A `NOT_FOUND` - /// error is returned if the resource does not exist. An empty policy is - /// returned if the resource exists but does not have a policy set on it. - /// - /// Caller must have Google IAM `dataplex.content.getIamPolicy` permission - /// on the resource. + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. /// /// @param request Unary RPCs, such as the one wrapped by this /// function, receive a single `request` proto message which includes all @@ -380,46 +224,9 @@ class ContentServiceClient { // clang-format off /// - /// Sets the access control policy on the specified contentitem resource. - /// Replaces any existing policy. - /// - /// Caller must have Google IAM `dataplex.content.setIamPolicy` permission - /// on the resource. - /// - /// @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.iam.v1.SetIamPolicyRequest]. - /// 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.iam.v1.Policy]) - /// 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.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L102} - /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L100} - /// - // clang-format on - StatusOr SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request, Options opts = {}); - - // clang-format off - /// - /// Returns the caller's permissions on a resource. - /// If the resource does not exist, an empty set of - /// permissions is returned (a `NOT_FOUND` error is not returned). - /// - /// A caller is not required to have Google IAM permission to make this - /// request. + /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. /// /// Note: This operation is designed to be used for building permission-aware /// UIs and command-line tools, not for authorization checking. This operation @@ -452,151 +259,6 @@ class ContentServiceClient { google::iam::v1::TestIamPermissionsRequest const& request, Options opts = {}); - // clang-format off - /// - /// List content. - /// - /// @param parent Required. The resource name of the parent lake: - /// projects/{project_id}/locations/{location_id}/lakes/{lake_id} - /// @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.dataplex.v1.Content], 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.dataplex.v1.Content]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L175} - /// [google.cloud.dataplex.v1.ListContentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/content.proto#L202} - /// - // clang-format on - StreamRange ListContent( - std::string const& parent, Options opts = {}); - - // clang-format off - /// - /// List content. - /// - /// @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.dataplex.v1.ListContentRequest]. - /// 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.dataplex.v1.Content], 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.dataplex.v1.Content]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L175} - /// [google.cloud.dataplex.v1.ListContentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/content.proto#L202} - /// - // clang-format on - StreamRange ListContent( - google::cloud::dataplex::v1::ListContentRequest request, - 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 @@ -817,7 +479,7 @@ class ContentServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -856,7 +518,7 @@ class ContentServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataplex/v1/content_connection.cc b/google/cloud/dataplex/v1/content_connection.cc index 5d1e044e8f973..01ad48e853b1d 100644 --- a/google/cloud/dataplex/v1/content_connection.cc +++ b/google/cloud/dataplex/v1/content_connection.cc @@ -38,26 +38,22 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN ContentServiceConnection::~ContentServiceConnection() = default; -StatusOr -ContentServiceConnection::CreateContent( - google::cloud::dataplex::v1::CreateContentRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -StatusOr -ContentServiceConnection::UpdateContent( - google::cloud::dataplex::v1::UpdateContentRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); +StreamRange +ContentServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); } -Status ContentServiceConnection::DeleteContent( - google::cloud::dataplex::v1::DeleteContentRequest const&) { +StatusOr +ContentServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { return Status(StatusCode::kUnimplemented, "not implemented"); } -StatusOr -ContentServiceConnection::GetContent( - google::cloud::dataplex::v1::GetContentRequest const&) { +StatusOr ContentServiceConnection::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const&) { return Status(StatusCode::kUnimplemented, "not implemented"); } @@ -66,39 +62,12 @@ StatusOr ContentServiceConnection::GetIamPolicy( return Status(StatusCode::kUnimplemented, "not implemented"); } -StatusOr ContentServiceConnection::SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - StatusOr ContentServiceConnection::TestIamPermissions( google::iam::v1::TestIamPermissionsRequest const&) { return Status(StatusCode::kUnimplemented, "not implemented"); } -StreamRange -ContentServiceConnection::ListContent( - google::cloud::dataplex::v1:: - ListContentRequest) { // NOLINT(performance-unnecessary-value-param) - return google::cloud::internal::MakeUnimplementedPaginationRange< - StreamRange>(); -} - -StreamRange -ContentServiceConnection::ListLocations( - google::cloud::location:: - ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) - return google::cloud::internal::MakeUnimplementedPaginationRange< - StreamRange>(); -} - -StatusOr -ContentServiceConnection::GetLocation( - google::cloud::location::GetLocationRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - StreamRange ContentServiceConnection::ListOperations( google::longrunning:: diff --git a/google/cloud/dataplex/v1/content_connection.h b/google/cloud/dataplex/v1/content_connection.h index e997af66e7d1b..1cd1b5edbd777 100644 --- a/google/cloud/dataplex/v1/content_connection.h +++ b/google/cloud/dataplex/v1/content_connection.h @@ -182,36 +182,21 @@ class ContentServiceConnection { virtual Options options() { return Options{}; } - virtual StatusOr CreateContent( - google::cloud::dataplex::v1::CreateContentRequest const& request); - - virtual StatusOr UpdateContent( - google::cloud::dataplex::v1::UpdateContentRequest const& request); + virtual StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request); - virtual Status DeleteContent( - google::cloud::dataplex::v1::DeleteContentRequest const& request); + virtual StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request); - virtual StatusOr GetContent( - google::cloud::dataplex::v1::GetContentRequest const& request); + virtual StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request); virtual StatusOr GetIamPolicy( google::iam::v1::GetIamPolicyRequest const& request); - virtual StatusOr SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request); - virtual StatusOr TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const& request); - virtual StreamRange ListContent( - google::cloud::dataplex::v1::ListContentRequest request); - - virtual StreamRange ListLocations( - google::cloud::location::ListLocationsRequest request); - - virtual StatusOr GetLocation( - google::cloud::location::GetLocationRequest const& request); - virtual StreamRange ListOperations( google::longrunning::ListOperationsRequest request); diff --git a/google/cloud/dataplex/v1/content_connection_idempotency_policy.cc b/google/cloud/dataplex/v1/content_connection_idempotency_policy.cc index 656c65cb95ecf..dff87c0eef5ea 100644 --- a/google/cloud/dataplex/v1/content_connection_idempotency_policy.cc +++ b/google/cloud/dataplex/v1/content_connection_idempotency_policy.cc @@ -34,28 +34,13 @@ ContentServiceConnectionIdempotencyPolicy::clone() const { return std::make_unique(*this); } -Idempotency ContentServiceConnectionIdempotencyPolicy::CreateContent( - google::cloud::dataplex::v1::CreateContentRequest const&) { - return Idempotency::kNonIdempotent; -} - -Idempotency ContentServiceConnectionIdempotencyPolicy::UpdateContent( - google::cloud::dataplex::v1::UpdateContentRequest const&) { - return Idempotency::kNonIdempotent; -} - -Idempotency ContentServiceConnectionIdempotencyPolicy::DeleteContent( - google::cloud::dataplex::v1::DeleteContentRequest const&) { - return Idempotency::kNonIdempotent; -} - -Idempotency ContentServiceConnectionIdempotencyPolicy::GetContent( - google::cloud::dataplex::v1::GetContentRequest const&) { +Idempotency ContentServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT return Idempotency::kIdempotent; } -Idempotency ContentServiceConnectionIdempotencyPolicy::GetIamPolicy( - google::iam::v1::GetIamPolicyRequest const&) { +Idempotency ContentServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { return Idempotency::kIdempotent; } @@ -65,23 +50,13 @@ Idempotency ContentServiceConnectionIdempotencyPolicy::SetIamPolicy( : Idempotency::kIdempotent; } -Idempotency ContentServiceConnectionIdempotencyPolicy::TestIamPermissions( - google::iam::v1::TestIamPermissionsRequest const&) { - return Idempotency::kIdempotent; -} - -Idempotency ContentServiceConnectionIdempotencyPolicy::ListContent( - google::cloud::dataplex::v1::ListContentRequest) { // NOLINT - return Idempotency::kIdempotent; -} - -Idempotency ContentServiceConnectionIdempotencyPolicy::ListLocations( - google::cloud::location::ListLocationsRequest) { // NOLINT +Idempotency ContentServiceConnectionIdempotencyPolicy::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const&) { return Idempotency::kIdempotent; } -Idempotency ContentServiceConnectionIdempotencyPolicy::GetLocation( - google::cloud::location::GetLocationRequest const&) { +Idempotency ContentServiceConnectionIdempotencyPolicy::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const&) { return Idempotency::kIdempotent; } diff --git a/google/cloud/dataplex/v1/content_connection_idempotency_policy.h b/google/cloud/dataplex/v1/content_connection_idempotency_policy.h index f51ff1c5c539b..de8e657d4670f 100644 --- a/google/cloud/dataplex/v1/content_connection_idempotency_policy.h +++ b/google/cloud/dataplex/v1/content_connection_idempotency_policy.h @@ -23,6 +23,7 @@ #include "google/cloud/location/locations.grpc.pb.h" #include "google/cloud/idempotency.h" #include "google/cloud/version.h" +#include "google/iam/v1/iam_policy.grpc.pb.h" #include "google/longrunning/operations.grpc.pb.h" #include @@ -39,36 +40,21 @@ class ContentServiceConnectionIdempotencyPolicy { virtual std::unique_ptr clone() const; - virtual google::cloud::Idempotency CreateContent( - google::cloud::dataplex::v1::CreateContentRequest const& request); - - virtual google::cloud::Idempotency UpdateContent( - google::cloud::dataplex::v1::UpdateContentRequest const& request); + virtual google::cloud::Idempotency ListLocations( + google::cloud::location::ListLocationsRequest request); - virtual google::cloud::Idempotency DeleteContent( - google::cloud::dataplex::v1::DeleteContentRequest const& request); + virtual google::cloud::Idempotency GetLocation( + google::cloud::location::GetLocationRequest const& request); - virtual google::cloud::Idempotency GetContent( - google::cloud::dataplex::v1::GetContentRequest const& request); + virtual google::cloud::Idempotency SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request); virtual google::cloud::Idempotency GetIamPolicy( google::iam::v1::GetIamPolicyRequest const& request); - virtual google::cloud::Idempotency SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request); - virtual google::cloud::Idempotency TestIamPermissions( google::iam::v1::TestIamPermissionsRequest const& request); - virtual google::cloud::Idempotency ListContent( - google::cloud::dataplex::v1::ListContentRequest 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); diff --git a/google/cloud/dataplex/v1/data_product_client.cc b/google/cloud/dataplex/v1/data_product_client.cc new file mode 100644 index 0000000000000..3be79ce19966a --- /dev/null +++ b/google/cloud/dataplex/v1/data_product_client.cc @@ -0,0 +1,473 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#include "google/cloud/dataplex/v1/data_product_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataProductServiceClient::DataProductServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +DataProductServiceClient::~DataProductServiceClient() = default; + +future> +DataProductServiceClient::CreateDataProduct( + std::string const& parent, + google::cloud::dataplex::v1::DataProduct const& data_product, + std::string const& data_product_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::CreateDataProductRequest request; + request.set_parent(parent); + *request.mutable_data_product() = data_product; + request.set_data_product_id(data_product_id); + return connection_->CreateDataProduct(request); +} + +StatusOr +DataProductServiceClient::CreateDataProduct( + NoAwaitTag, std::string const& parent, + google::cloud::dataplex::v1::DataProduct const& data_product, + std::string const& data_product_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::CreateDataProductRequest request; + request.set_parent(parent); + *request.mutable_data_product() = data_product; + request.set_data_product_id(data_product_id); + return connection_->CreateDataProduct(NoAwaitTag{}, request); +} + +future> +DataProductServiceClient::CreateDataProduct( + google::cloud::dataplex::v1::CreateDataProductRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDataProduct(request); +} + +StatusOr +DataProductServiceClient::CreateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataProductRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDataProduct(NoAwaitTag{}, request); +} + +future> +DataProductServiceClient::CreateDataProduct( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDataProduct(operation); +} + +future> +DataProductServiceClient::DeleteDataProduct(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::DeleteDataProductRequest request; + request.set_name(name); + return connection_->DeleteDataProduct(request); +} + +StatusOr +DataProductServiceClient::DeleteDataProduct(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::DeleteDataProductRequest request; + request.set_name(name); + return connection_->DeleteDataProduct(NoAwaitTag{}, request); +} + +future> +DataProductServiceClient::DeleteDataProduct( + google::cloud::dataplex::v1::DeleteDataProductRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDataProduct(request); +} + +StatusOr +DataProductServiceClient::DeleteDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDataProduct(NoAwaitTag{}, request); +} + +future> +DataProductServiceClient::DeleteDataProduct( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDataProduct(operation); +} + +StatusOr +DataProductServiceClient::GetDataProduct(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::GetDataProductRequest request; + request.set_name(name); + return connection_->GetDataProduct(request); +} + +StatusOr +DataProductServiceClient::GetDataProduct( + google::cloud::dataplex::v1::GetDataProductRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetDataProduct(request); +} + +StreamRange +DataProductServiceClient::ListDataProducts(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::ListDataProductsRequest request; + request.set_parent(parent); + return connection_->ListDataProducts(request); +} + +StreamRange +DataProductServiceClient::ListDataProducts( + google::cloud::dataplex::v1::ListDataProductsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListDataProducts(std::move(request)); +} + +future> +DataProductServiceClient::UpdateDataProduct( + google::cloud::dataplex::v1::DataProduct const& data_product, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::UpdateDataProductRequest request; + *request.mutable_data_product() = data_product; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateDataProduct(request); +} + +StatusOr +DataProductServiceClient::UpdateDataProduct( + NoAwaitTag, google::cloud::dataplex::v1::DataProduct const& data_product, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::UpdateDataProductRequest request; + *request.mutable_data_product() = data_product; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateDataProduct(NoAwaitTag{}, request); +} + +future> +DataProductServiceClient::UpdateDataProduct( + google::cloud::dataplex::v1::UpdateDataProductRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDataProduct(request); +} + +StatusOr +DataProductServiceClient::UpdateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDataProduct(NoAwaitTag{}, request); +} + +future> +DataProductServiceClient::UpdateDataProduct( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDataProduct(operation); +} + +future> +DataProductServiceClient::CreateDataAsset( + std::string const& parent, + google::cloud::dataplex::v1::DataAsset const& data_asset, + std::string const& data_asset_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::CreateDataAssetRequest request; + request.set_parent(parent); + *request.mutable_data_asset() = data_asset; + request.set_data_asset_id(data_asset_id); + return connection_->CreateDataAsset(request); +} + +StatusOr +DataProductServiceClient::CreateDataAsset( + NoAwaitTag, std::string const& parent, + google::cloud::dataplex::v1::DataAsset const& data_asset, + std::string const& data_asset_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::CreateDataAssetRequest request; + request.set_parent(parent); + *request.mutable_data_asset() = data_asset; + request.set_data_asset_id(data_asset_id); + return connection_->CreateDataAsset(NoAwaitTag{}, request); +} + +future> +DataProductServiceClient::CreateDataAsset( + google::cloud::dataplex::v1::CreateDataAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDataAsset(request); +} + +StatusOr +DataProductServiceClient::CreateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDataAsset(NoAwaitTag{}, request); +} + +future> +DataProductServiceClient::CreateDataAsset( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDataAsset(operation); +} + +future> +DataProductServiceClient::UpdateDataAsset( + google::cloud::dataplex::v1::DataAsset const& data_asset, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::UpdateDataAssetRequest request; + *request.mutable_data_asset() = data_asset; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateDataAsset(request); +} + +StatusOr +DataProductServiceClient::UpdateDataAsset( + NoAwaitTag, google::cloud::dataplex::v1::DataAsset const& data_asset, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::UpdateDataAssetRequest request; + *request.mutable_data_asset() = data_asset; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateDataAsset(NoAwaitTag{}, request); +} + +future> +DataProductServiceClient::UpdateDataAsset( + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDataAsset(request); +} + +StatusOr +DataProductServiceClient::UpdateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDataAsset(NoAwaitTag{}, request); +} + +future> +DataProductServiceClient::UpdateDataAsset( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDataAsset(operation); +} + +future> +DataProductServiceClient::DeleteDataAsset(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::DeleteDataAssetRequest request; + request.set_name(name); + return connection_->DeleteDataAsset(request); +} + +StatusOr +DataProductServiceClient::DeleteDataAsset(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::DeleteDataAssetRequest request; + request.set_name(name); + return connection_->DeleteDataAsset(NoAwaitTag{}, request); +} + +future> +DataProductServiceClient::DeleteDataAsset( + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDataAsset(request); +} + +StatusOr +DataProductServiceClient::DeleteDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDataAsset(NoAwaitTag{}, request); +} + +future> +DataProductServiceClient::DeleteDataAsset( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDataAsset(operation); +} + +StatusOr +DataProductServiceClient::GetDataAsset(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::GetDataAssetRequest request; + request.set_name(name); + return connection_->GetDataAsset(request); +} + +StatusOr +DataProductServiceClient::GetDataAsset( + google::cloud::dataplex::v1::GetDataAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetDataAsset(request); +} + +StreamRange +DataProductServiceClient::ListDataAssets(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::dataplex::v1::ListDataAssetsRequest request; + request.set_parent(parent); + return connection_->ListDataAssets(request); +} + +StreamRange +DataProductServiceClient::ListDataAssets( + google::cloud::dataplex::v1::ListDataAssetsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListDataAssets(std::move(request)); +} + +StreamRange +DataProductServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr +DataProductServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StatusOr DataProductServiceClient::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->SetIamPolicy(request); +} + +StatusOr DataProductServiceClient::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetIamPolicy(request); +} + +StatusOr +DataProductServiceClient::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->TestIamPermissions(request); +} + +StreamRange +DataProductServiceClient::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 +DataProductServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr DataProductServiceClient::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 DataProductServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status DataProductServiceClient::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 DataProductServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status DataProductServiceClient::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 DataProductServiceClient::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 dataplex_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/data_product_client.h b/google/cloud/dataplex/v1/data_product_client.h new file mode 100644 index 0000000000000..d00fda5beb987 --- /dev/null +++ b/google/cloud/dataplex/v1/data_product_client.h @@ -0,0 +1,1535 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_PRODUCT_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_PRODUCT_CLIENT_H + +#include "google/cloud/dataplex/v1/data_product_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 "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// `DataProductService` provides APIs for managing data products and +/// the underlying data assets. +/// +/// @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 DataProductServiceClient { + public: + explicit DataProductServiceClient( + std::shared_ptr connection, + Options opts = {}); + ~DataProductServiceClient(); + + ///@{ + /// @name Copy and move support + DataProductServiceClient(DataProductServiceClient const&) = default; + DataProductServiceClient& operator=(DataProductServiceClient const&) = + default; + DataProductServiceClient(DataProductServiceClient&&) = default; + DataProductServiceClient& operator=(DataProductServiceClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(DataProductServiceClient const& a, + DataProductServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(DataProductServiceClient const& a, + DataProductServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Creates a data product. + /// + /// @param parent Required. The parent resource where this data product will be created. + /// Format: projects/{project_id_or_number}/locations/{location_id} + /// @param data_product Required. The data product to create. + /// @param data_product_id Optional. The ID of the data product to create. + /// @n + /// The ID must conform to RFC-1034 and contain only lower-case letters (a-z), + /// numbers (0-9), or hyphens, with the first character a letter, the last a + /// letter or a number, and a 63 character maximum. Characters outside of + /// ASCII are not permitted. + /// Valid format regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$` + /// If not provided, a system generated ID will be used. + /// @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.dataplex.v1.DataProduct] 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.dataplex.v1.CreateDataProductRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L370} + /// [google.cloud.dataplex.v1.DataProduct]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L163} + /// + // clang-format on + future> CreateDataProduct( + std::string const& parent, + google::cloud::dataplex::v1::DataProduct const& data_product, + std::string const& data_product_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateDataProduct + /// + /// 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 CreateDataProduct( + NoAwaitTag, std::string const& parent, + google::cloud::dataplex::v1::DataProduct const& data_product, + std::string const& data_product_id, Options opts = {}); + + // clang-format off + /// + /// Creates a data product. + /// + /// @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.dataplex.v1.CreateDataProductRequest]. + /// 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.dataplex.v1.DataProduct] 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.dataplex.v1.CreateDataProductRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L370} + /// [google.cloud.dataplex.v1.DataProduct]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L163} + /// + // clang-format on + future> CreateDataProduct( + google::cloud::dataplex::v1::CreateDataProductRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateDataProduct + /// + /// 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 CreateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataProductRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateDataProduct + /// + /// 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> CreateDataProduct( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a data product. The deletion will fail if the data product is not + /// empty (i.e. contains at least one data asset). + /// + /// @param name Required. The name of the data product to delete. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id} + /// @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.dataplex.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.dataplex.v1.DeleteDataProductRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L399} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} + /// + // clang-format on + future> + DeleteDataProduct(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteDataProduct + /// + /// 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 DeleteDataProduct( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a data product. The deletion will fail if the data product is not + /// empty (i.e. contains at least one data asset). + /// + /// @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.dataplex.v1.DeleteDataProductRequest]. + /// 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.dataplex.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.dataplex.v1.DeleteDataProductRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L399} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} + /// + // clang-format on + future> + DeleteDataProduct( + google::cloud::dataplex::v1::DeleteDataProductRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteDataProduct + /// + /// 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 DeleteDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteDataProduct + /// + /// 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> + DeleteDataProduct(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Gets a data product. + /// + /// @param name Required. The name of the data product to retrieve. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id} + /// @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.dataplex.v1.DataProduct]) + /// 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.dataplex.v1.DataProduct]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L163} + /// [google.cloud.dataplex.v1.GetDataProductRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L423} + /// + // clang-format on + StatusOr GetDataProduct( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a data product. + /// + /// @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.dataplex.v1.GetDataProductRequest]. + /// 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.dataplex.v1.DataProduct]) + /// 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.dataplex.v1.DataProduct]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L163} + /// [google.cloud.dataplex.v1.GetDataProductRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L423} + /// + // clang-format on + StatusOr GetDataProduct( + google::cloud::dataplex::v1::GetDataProductRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists data products for a given project. + /// + /// @param parent Required. The parent, which has this collection of data products. + /// @n + /// Format: `projects/{project_id_or_number}/locations/{location_id}`. + /// @n + /// Supports listing across all locations with the wildcard `-` (hyphen) + /// character. Example: `projects/{project_id_or_number}/locations/-` + /// @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.dataplex.v1.DataProduct], 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.dataplex.v1.DataProduct]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L163} + /// [google.cloud.dataplex.v1.ListDataProductsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L436} + /// + // clang-format on + StreamRange ListDataProducts( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists data products for a given project. + /// + /// @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.dataplex.v1.ListDataProductsRequest]. + /// 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.dataplex.v1.DataProduct], 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.dataplex.v1.DataProduct]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L163} + /// [google.cloud.dataplex.v1.ListDataProductsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L436} + /// + // clang-format on + StreamRange ListDataProducts( + google::cloud::dataplex::v1::ListDataProductsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Updates a data product. + /// + /// @param data_product Required. The data product to update. + /// The data product's `name` field is used to identify the data product to + /// update. + /// @param update_mask Optional. The list of fields to update. + /// If this is empty or not set, then all the fields will be updated. + /// @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.dataplex.v1.DataProduct] 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.dataplex.v1.DataProduct]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L163} + /// [google.cloud.dataplex.v1.UpdateDataProductRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L496} + /// + // clang-format on + future> UpdateDataProduct( + google::cloud::dataplex::v1::DataProduct const& data_product, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateDataProduct + /// + /// 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 UpdateDataProduct( + NoAwaitTag, google::cloud::dataplex::v1::DataProduct const& data_product, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a data product. + /// + /// @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.dataplex.v1.UpdateDataProductRequest]. + /// 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.dataplex.v1.DataProduct] 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.dataplex.v1.DataProduct]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L163} + /// [google.cloud.dataplex.v1.UpdateDataProductRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L496} + /// + // clang-format on + future> UpdateDataProduct( + google::cloud::dataplex::v1::UpdateDataProductRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateDataProduct + /// + /// 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 UpdateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateDataProduct + /// + /// 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> UpdateDataProduct( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Creates a data asset. + /// + /// @param parent Required. The parent resource where this data asset will be created. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id} + /// @param data_asset Required. The data asset to create. + /// @param data_asset_id Optional. The ID of the data asset to create. + /// @n + /// The ID must conform to RFC-1034 and contain only lower-case letters (a-z), + /// numbers (0-9), or hyphens, with the first character a letter, the last a + /// letter or a number, and a 63 character maximum. Characters outside of + /// ASCII are not permitted. + /// Valid format regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$` + /// If not provided, a system generated ID will be used. + /// @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.dataplex.v1.DataAsset] 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.dataplex.v1.CreateDataAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L513} + /// [google.cloud.dataplex.v1.DataAsset]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L281} + /// + // clang-format on + future> CreateDataAsset( + std::string const& parent, + google::cloud::dataplex::v1::DataAsset const& data_asset, + std::string const& data_asset_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateDataAsset + /// + /// 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 CreateDataAsset( + NoAwaitTag, std::string const& parent, + google::cloud::dataplex::v1::DataAsset const& data_asset, + std::string const& data_asset_id, Options opts = {}); + + // clang-format off + /// + /// Creates a data asset. + /// + /// @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.dataplex.v1.CreateDataAssetRequest]. + /// 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.dataplex.v1.DataAsset] 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.dataplex.v1.CreateDataAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L513} + /// [google.cloud.dataplex.v1.DataAsset]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L281} + /// + // clang-format on + future> CreateDataAsset( + google::cloud::dataplex::v1::CreateDataAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateDataAsset + /// + /// 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 CreateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateDataAsset + /// + /// 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> CreateDataAsset( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates a data asset. + /// + /// @param data_asset Required. The data asset to update. + /// The data asset's `name` field is used to identify the data asset to update. + /// @param update_mask Optional. The list of fields to update. + /// If this is empty or not set, then all the fields will be updated. + /// @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.dataplex.v1.DataAsset] 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.dataplex.v1.DataAsset]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L281} + /// [google.cloud.dataplex.v1.UpdateDataAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L543} + /// + // clang-format on + future> UpdateDataAsset( + google::cloud::dataplex::v1::DataAsset const& data_asset, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateDataAsset + /// + /// 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 UpdateDataAsset( + NoAwaitTag, google::cloud::dataplex::v1::DataAsset const& data_asset, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a data asset. + /// + /// @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.dataplex.v1.UpdateDataAssetRequest]. + /// 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.dataplex.v1.DataAsset] 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.dataplex.v1.DataAsset]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L281} + /// [google.cloud.dataplex.v1.UpdateDataAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L543} + /// + // clang-format on + future> UpdateDataAsset( + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateDataAsset + /// + /// 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 UpdateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateDataAsset + /// + /// 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> UpdateDataAsset( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a data asset. + /// + /// @param name Required. The name of the data asset to delete. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id}/dataAssets/{data_asset_id} + /// @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.dataplex.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.dataplex.v1.DeleteDataAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L559} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} + /// + // clang-format on + future> + DeleteDataAsset(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteDataAsset + /// + /// 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 DeleteDataAsset( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a data asset. + /// + /// @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.dataplex.v1.DeleteDataAssetRequest]. + /// 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.dataplex.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.dataplex.v1.DeleteDataAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L559} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} + /// + // clang-format on + future> + DeleteDataAsset( + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteDataAsset + /// + /// 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 DeleteDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteDataAsset + /// + /// 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> + DeleteDataAsset(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Gets a data asset. + /// + /// @param name Required. The name of the data asset to retrieve. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id}/dataAssets/{data_asset_id} + /// @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.dataplex.v1.DataAsset]) + /// 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.dataplex.v1.DataAsset]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L281} + /// [google.cloud.dataplex.v1.GetDataAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L582} + /// + // clang-format on + StatusOr GetDataAsset( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a data asset. + /// + /// @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.dataplex.v1.GetDataAssetRequest]. + /// 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.dataplex.v1.DataAsset]) + /// 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.dataplex.v1.DataAsset]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L281} + /// [google.cloud.dataplex.v1.GetDataAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L582} + /// + // clang-format on + StatusOr GetDataAsset( + google::cloud::dataplex::v1::GetDataAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists data assets for a given data product. + /// + /// @param parent Required. The parent, which has this collection of data assets. + /// Format: + /// projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id} + /// @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.dataplex.v1.DataAsset], 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.dataplex.v1.DataAsset]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L281} + /// [google.cloud.dataplex.v1.ListDataAssetsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L595} + /// + // clang-format on + StreamRange ListDataAssets( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists data assets for a given data product. + /// + /// @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.dataplex.v1.ListDataAssetsRequest]. + /// 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.dataplex.v1.DataAsset], 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.dataplex.v1.DataAsset]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L281} + /// [google.cloud.dataplex.v1.ListDataAssetsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_products.proto#L595} + /// + // clang-format on + StreamRange ListDataAssets( + google::cloud::dataplex::v1::ListDataAssetsRequest request, + 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 + /// + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. + /// + /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + /// + /// @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.iam.v1.SetIamPolicyRequest]. + /// 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.iam.v1.Policy]) + /// 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.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L102} + /// [google.iam.v1.SetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L100} + /// + // clang-format on + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request, Options opts = {}); + + // clang-format off + /// + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// @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.iam.v1.GetIamPolicyRequest]. + /// 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.iam.v1.Policy]) + /// 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.iam.v1.GetIamPolicyRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L123} + /// [google.iam.v1.Policy]: @googleapis_reference_link{google/iam/v1/policy.proto#L102} + /// + // clang-format on + StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request, Options opts = {}); + + // clang-format off + /// + /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a `NOT_FOUND` error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. + /// + /// @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.iam.v1.TestIamPermissionsRequest]. + /// 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.iam.v1.TestIamPermissionsResponse]) + /// 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.iam.v1.TestIamPermissionsRequest]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L137} + /// [google.iam.v1.TestIamPermissionsResponse]: @googleapis_reference_link{google/iam/v1/iam_policy.proto#L153} + /// + // clang-format on + StatusOr TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 dataplex_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_PRODUCT_CLIENT_H diff --git a/google/cloud/dataplex/v1/data_product_connection.cc b/google/cloud/dataplex/v1/data_product_connection.cc new file mode 100644 index 0000000000000..d1567bc69bed0 --- /dev/null +++ b/google/cloud/dataplex/v1/data_product_connection.cc @@ -0,0 +1,281 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#include "google/cloud/dataplex/v1/data_product_connection.h" +#include "google/cloud/dataplex/v1/data_product_options.h" +#include "google/cloud/dataplex/v1/internal/data_product_connection_impl.h" +#include "google/cloud/dataplex/v1/internal/data_product_option_defaults.h" +#include "google/cloud/dataplex/v1/internal/data_product_stub_factory.h" +#include "google/cloud/dataplex/v1/internal/data_product_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 dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataProductServiceConnection::~DataProductServiceConnection() = default; + +future> +DataProductServiceConnection::CreateDataProduct( + google::cloud::dataplex::v1::CreateDataProductRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +DataProductServiceConnection::CreateDataProduct( + NoAwaitTag, google::cloud::dataplex::v1::CreateDataProductRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataProductServiceConnection::CreateDataProduct( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataProductServiceConnection::DeleteDataProduct( + google::cloud::dataplex::v1::DeleteDataProductRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +DataProductServiceConnection::DeleteDataProduct( + NoAwaitTag, google::cloud::dataplex::v1::DeleteDataProductRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataProductServiceConnection::DeleteDataProduct( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +DataProductServiceConnection::GetDataProduct( + google::cloud::dataplex::v1::GetDataProductRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +DataProductServiceConnection::ListDataProducts( + google::cloud::dataplex::v1:: + ListDataProductsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +future> +DataProductServiceConnection::UpdateDataProduct( + google::cloud::dataplex::v1::UpdateDataProductRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +DataProductServiceConnection::UpdateDataProduct( + NoAwaitTag, google::cloud::dataplex::v1::UpdateDataProductRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataProductServiceConnection::UpdateDataProduct( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataProductServiceConnection::CreateDataAsset( + google::cloud::dataplex::v1::CreateDataAssetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +DataProductServiceConnection::CreateDataAsset( + NoAwaitTag, google::cloud::dataplex::v1::CreateDataAssetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataProductServiceConnection::CreateDataAsset( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataProductServiceConnection::UpdateDataAsset( + google::cloud::dataplex::v1::UpdateDataAssetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +DataProductServiceConnection::UpdateDataAsset( + NoAwaitTag, google::cloud::dataplex::v1::UpdateDataAssetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataProductServiceConnection::UpdateDataAsset( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataProductServiceConnection::DeleteDataAsset( + google::cloud::dataplex::v1::DeleteDataAssetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +DataProductServiceConnection::DeleteDataAsset( + NoAwaitTag, google::cloud::dataplex::v1::DeleteDataAssetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +DataProductServiceConnection::DeleteDataAsset( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +DataProductServiceConnection::GetDataAsset( + google::cloud::dataplex::v1::GetDataAssetRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +DataProductServiceConnection::ListDataAssets( + google::cloud::dataplex::v1:: + ListDataAssetsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StreamRange +DataProductServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +DataProductServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr DataProductServiceConnection::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr DataProductServiceConnection::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +DataProductServiceConnection::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +DataProductServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +DataProductServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status DataProductServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status DataProductServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeDataProductServiceConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = dataplex_v1_internal::DataProductServiceDefaultOptions( + std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = dataplex_v1_internal::CreateDefaultDataProductServiceStub( + std::move(auth), options); + return dataplex_v1_internal::MakeDataProductServiceTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/data_product_connection.h b/google/cloud/dataplex/v1/data_product_connection.h new file mode 100644 index 0000000000000..80354e828744b --- /dev/null +++ b/google/cloud/dataplex/v1/data_product_connection.h @@ -0,0 +1,330 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_PRODUCT_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_PRODUCT_CONNECTION_H + +#include "google/cloud/dataplex/v1/data_product_connection_idempotency_policy.h" +#include "google/cloud/dataplex/v1/data_products.pb.h" +#include "google/cloud/dataplex/v1/internal/data_product_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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `DataProductServiceConnection`. +class DataProductServiceRetryPolicy : 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 `DataProductServiceConnection` 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 DataProductServiceLimitedErrorCountRetryPolicy + : public DataProductServiceRetryPolicy { + 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 DataProductServiceLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + DataProductServiceLimitedErrorCountRetryPolicy( + DataProductServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : DataProductServiceLimitedErrorCountRetryPolicy(rhs.maximum_failures()) { + } + DataProductServiceLimitedErrorCountRetryPolicy( + DataProductServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : DataProductServiceLimitedErrorCountRetryPolicy(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 = DataProductServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + dataplex_v1_internal::DataProductServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `DataProductServiceConnection` 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 DataProductServiceLimitedTimeRetryPolicy + : public DataProductServiceRetryPolicy { + 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 DataProductServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + DataProductServiceLimitedTimeRetryPolicy( + DataProductServiceLimitedTimeRetryPolicy&& rhs) noexcept + : DataProductServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + DataProductServiceLimitedTimeRetryPolicy( + DataProductServiceLimitedTimeRetryPolicy const& rhs) noexcept + : DataProductServiceLimitedTimeRetryPolicy(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 = DataProductServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + dataplex_v1_internal::DataProductServiceRetryTraits> + impl_; +}; + +/** + * The `DataProductServiceConnection` object for `DataProductServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `DataProductServiceClient`. This allows users to inject custom + * behavior (e.g., with a Google Mock object) when writing tests that use + * objects of type `DataProductServiceClient`. + * + * To create a concrete instance, see `MakeDataProductServiceConnection()`. + * + * For mocking, see `dataplex_v1_mocks::MockDataProductServiceConnection`. + */ +class DataProductServiceConnection { + public: + virtual ~DataProductServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual future> + CreateDataProduct( + google::cloud::dataplex::v1::CreateDataProductRequest const& request); + + virtual StatusOr CreateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataProductRequest const& request); + + virtual future> + CreateDataProduct(google::longrunning::Operation const& operation); + + virtual future> + DeleteDataProduct( + google::cloud::dataplex::v1::DeleteDataProductRequest const& request); + + virtual StatusOr DeleteDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request); + + virtual future> + DeleteDataProduct(google::longrunning::Operation const& operation); + + virtual StatusOr GetDataProduct( + google::cloud::dataplex::v1::GetDataProductRequest const& request); + + virtual StreamRange + ListDataProducts( + google::cloud::dataplex::v1::ListDataProductsRequest request); + + virtual future> + UpdateDataProduct( + google::cloud::dataplex::v1::UpdateDataProductRequest const& request); + + virtual StatusOr UpdateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request); + + virtual future> + UpdateDataProduct(google::longrunning::Operation const& operation); + + virtual future> + CreateDataAsset( + google::cloud::dataplex::v1::CreateDataAssetRequest const& request); + + virtual StatusOr CreateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request); + + virtual future> + CreateDataAsset(google::longrunning::Operation const& operation); + + virtual future> + UpdateDataAsset( + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request); + + virtual StatusOr UpdateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request); + + virtual future> + UpdateDataAsset(google::longrunning::Operation const& operation); + + virtual future> + DeleteDataAsset( + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request); + + virtual StatusOr DeleteDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request); + + virtual future> + DeleteDataAsset(google::longrunning::Operation const& operation); + + virtual StatusOr GetDataAsset( + google::cloud::dataplex::v1::GetDataAssetRequest const& request); + + virtual StreamRange ListDataAssets( + google::cloud::dataplex::v1::ListDataAssetsRequest request); + + virtual StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request); + + virtual StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request); + + virtual StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request); + + virtual StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request); + + virtual StatusOr + TestIamPermissions(google::iam::v1::TestIamPermissionsRequest 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 + * `DataProductServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of + * DataProductServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `DataProductServiceConnection`. Expected options are any of the + * types in the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::dataplex_v1::DataProductServicePolicyOptionList` + * + * @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 `DataProductServiceConnection` + * created by this function. + */ +std::shared_ptr MakeDataProductServiceConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_PRODUCT_CONNECTION_H diff --git a/google/cloud/dataplex/v1/data_product_connection_idempotency_policy.cc b/google/cloud/dataplex/v1/data_product_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..71419fdcb68ce --- /dev/null +++ b/google/cloud/dataplex/v1/data_product_connection_idempotency_policy.cc @@ -0,0 +1,141 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#include "google/cloud/dataplex/v1/data_product_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +DataProductServiceConnectionIdempotencyPolicy:: + ~DataProductServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +DataProductServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::CreateDataProduct( + google::cloud::dataplex::v1::CreateDataProductRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::DeleteDataProduct( + google::cloud::dataplex::v1::DeleteDataProductRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::GetDataProduct( + google::cloud::dataplex::v1::GetDataProductRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::ListDataProducts( + google::cloud::dataplex::v1::ListDataProductsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::UpdateDataProduct( + google::cloud::dataplex::v1::UpdateDataProductRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::CreateDataAsset( + google::cloud::dataplex::v1::CreateDataAssetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::UpdateDataAsset( + google::cloud::dataplex::v1::UpdateDataAssetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::DeleteDataAsset( + google::cloud::dataplex::v1::DeleteDataAssetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::GetDataAsset( + google::cloud::dataplex::v1::GetDataAssetRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::ListDataAssets( + google::cloud::dataplex::v1::ListDataAssetsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { + return request.policy().etag().empty() ? Idempotency::kNonIdempotent + : Idempotency::kIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataProductServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultDataProductServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/data_product_connection_idempotency_policy.h b/google/cloud/dataplex/v1/data_product_connection_idempotency_policy.h new file mode 100644 index 0000000000000..a80de925bfe7e --- /dev/null +++ b/google/cloud/dataplex/v1/data_product_connection_idempotency_policy.h @@ -0,0 +1,109 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_PRODUCT_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_PRODUCT_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/dataplex/v1/data_products.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataProductServiceConnectionIdempotencyPolicy { + public: + virtual ~DataProductServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() + const; + + virtual google::cloud::Idempotency CreateDataProduct( + google::cloud::dataplex::v1::CreateDataProductRequest const& request); + + virtual google::cloud::Idempotency DeleteDataProduct( + google::cloud::dataplex::v1::DeleteDataProductRequest const& request); + + virtual google::cloud::Idempotency GetDataProduct( + google::cloud::dataplex::v1::GetDataProductRequest const& request); + + virtual google::cloud::Idempotency ListDataProducts( + google::cloud::dataplex::v1::ListDataProductsRequest request); + + virtual google::cloud::Idempotency UpdateDataProduct( + google::cloud::dataplex::v1::UpdateDataProductRequest const& request); + + virtual google::cloud::Idempotency CreateDataAsset( + google::cloud::dataplex::v1::CreateDataAssetRequest const& request); + + virtual google::cloud::Idempotency UpdateDataAsset( + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request); + + virtual google::cloud::Idempotency DeleteDataAsset( + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request); + + virtual google::cloud::Idempotency GetDataAsset( + google::cloud::dataplex::v1::GetDataAssetRequest const& request); + + virtual google::cloud::Idempotency ListDataAssets( + google::cloud::dataplex::v1::ListDataAssetsRequest 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 SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request); + + virtual google::cloud::Idempotency GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request); + + virtual google::cloud::Idempotency TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest 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 +MakeDefaultDataProductServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_PRODUCT_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/dataplex/v1/data_product_options.h b/google/cloud/dataplex/v1/data_product_options.h new file mode 100644 index 0000000000000..1e8f45064d8d5 --- /dev/null +++ b/google/cloud/dataplex/v1/data_product_options.h @@ -0,0 +1,87 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_PRODUCT_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_PRODUCT_OPTIONS_H + +#include "google/cloud/dataplex/v1/data_product_connection.h" +#include "google/cloud/dataplex/v1/data_product_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 dataplex_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-dataplex-options + */ +struct DataProductServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-dataplex-options + */ +struct DataProductServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-dataplex-options + */ +struct DataProductServiceConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-dataplex-options + */ +struct DataProductServicePollingPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to DataProductService. + * + * @ingroup google-cloud-dataplex-options + */ +using DataProductServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_DATA_PRODUCT_OPTIONS_H diff --git a/google/cloud/dataplex/v1/data_scan_client.h b/google/cloud/dataplex/v1/data_scan_client.h index 525454d90b35c..71ec3beea2b61 100644 --- a/google/cloud/dataplex/v1/data_scan_client.h +++ b/google/cloud/dataplex/v1/data_scan_client.h @@ -363,7 +363,7 @@ class DataScanServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.DeleteDataScanRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/datascans.proto#L197} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> @@ -414,7 +414,7 @@ class DataScanServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.DeleteDataScanRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/datascans.proto#L197} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> @@ -1245,7 +1245,7 @@ class DataScanServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1284,7 +1284,7 @@ class DataScanServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataplex/v1/data_taxonomy_client.h b/google/cloud/dataplex/v1/data_taxonomy_client.h index afc10755cfea1..070a0d01384bd 100644 --- a/google/cloud/dataplex/v1/data_taxonomy_client.h +++ b/google/cloud/dataplex/v1/data_taxonomy_client.h @@ -398,7 +398,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.DeleteDataTaxonomyRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_taxonomy.proto#L568} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on GOOGLE_CLOUD_CPP_DEPRECATED("This RPC is deprecated.") @@ -456,7 +456,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.DeleteDataTaxonomyRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_taxonomy.proto#L568} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on GOOGLE_CLOUD_CPP_DEPRECATED("This RPC is deprecated.") @@ -959,7 +959,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.DeleteDataAttributeBindingRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_taxonomy.proto#L800} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on GOOGLE_CLOUD_CPP_DEPRECATED("This RPC is deprecated.") @@ -1018,7 +1018,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.DeleteDataAttributeBindingRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_taxonomy.proto#L800} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on GOOGLE_CLOUD_CPP_DEPRECATED("This RPC is deprecated.") @@ -1516,7 +1516,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.DeleteDataAttributeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_taxonomy.proto#L682} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on GOOGLE_CLOUD_CPP_DEPRECATED("This RPC is deprecated.") @@ -1573,7 +1573,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.DeleteDataAttributeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/data_taxonomy.proto#L682} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on GOOGLE_CLOUD_CPP_DEPRECATED("This RPC is deprecated.") @@ -2153,7 +2153,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2192,7 +2192,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataplex/v1/dataplex_client.cc b/google/cloud/dataplex/v1/dataplex_client.cc index 63113e9ffe92e..99ed4a797c92f 100644 --- a/google/cloud/dataplex/v1/dataplex_client.cc +++ b/google/cloud/dataplex/v1/dataplex_client.cc @@ -759,192 +759,6 @@ Status DataplexServiceClient::CancelJob( return connection_->CancelJob(request); } -future> -DataplexServiceClient::CreateEnvironment( - std::string const& parent, - google::cloud::dataplex::v1::Environment const& environment, - std::string const& environment_id, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::CreateEnvironmentRequest request; - request.set_parent(parent); - *request.mutable_environment() = environment; - request.set_environment_id(environment_id); - return connection_->CreateEnvironment(request); -} - -StatusOr -DataplexServiceClient::CreateEnvironment( - NoAwaitTag, std::string const& parent, - google::cloud::dataplex::v1::Environment const& environment, - std::string const& environment_id, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::CreateEnvironmentRequest request; - request.set_parent(parent); - *request.mutable_environment() = environment; - request.set_environment_id(environment_id); - return connection_->CreateEnvironment(NoAwaitTag{}, request); -} - -future> -DataplexServiceClient::CreateEnvironment( - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->CreateEnvironment(request); -} - -StatusOr -DataplexServiceClient::CreateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->CreateEnvironment(NoAwaitTag{}, request); -} - -future> -DataplexServiceClient::CreateEnvironment( - google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->CreateEnvironment(operation); -} - -future> -DataplexServiceClient::UpdateEnvironment( - google::cloud::dataplex::v1::Environment const& environment, - google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::UpdateEnvironmentRequest request; - *request.mutable_environment() = environment; - *request.mutable_update_mask() = update_mask; - return connection_->UpdateEnvironment(request); -} - -StatusOr -DataplexServiceClient::UpdateEnvironment( - NoAwaitTag, google::cloud::dataplex::v1::Environment const& environment, - google::protobuf::FieldMask const& update_mask, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::UpdateEnvironmentRequest request; - *request.mutable_environment() = environment; - *request.mutable_update_mask() = update_mask; - return connection_->UpdateEnvironment(NoAwaitTag{}, request); -} - -future> -DataplexServiceClient::UpdateEnvironment( - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->UpdateEnvironment(request); -} - -StatusOr -DataplexServiceClient::UpdateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->UpdateEnvironment(NoAwaitTag{}, request); -} - -future> -DataplexServiceClient::UpdateEnvironment( - google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->UpdateEnvironment(operation); -} - -future> -DataplexServiceClient::DeleteEnvironment(std::string const& name, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::DeleteEnvironmentRequest request; - request.set_name(name); - return connection_->DeleteEnvironment(request); -} - -StatusOr -DataplexServiceClient::DeleteEnvironment(NoAwaitTag, std::string const& name, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::DeleteEnvironmentRequest request; - request.set_name(name); - return connection_->DeleteEnvironment(NoAwaitTag{}, request); -} - -future> -DataplexServiceClient::DeleteEnvironment( - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->DeleteEnvironment(request); -} - -StatusOr -DataplexServiceClient::DeleteEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->DeleteEnvironment(NoAwaitTag{}, request); -} - -future> -DataplexServiceClient::DeleteEnvironment( - google::longrunning::Operation const& operation, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->DeleteEnvironment(operation); -} - -StreamRange -DataplexServiceClient::ListEnvironments(std::string const& parent, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::ListEnvironmentsRequest request; - request.set_parent(parent); - return connection_->ListEnvironments(request); -} - -StreamRange -DataplexServiceClient::ListEnvironments( - google::cloud::dataplex::v1::ListEnvironmentsRequest request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->ListEnvironments(std::move(request)); -} - -StatusOr -DataplexServiceClient::GetEnvironment(std::string const& name, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::GetEnvironmentRequest request; - request.set_name(name); - return connection_->GetEnvironment(request); -} - -StatusOr -DataplexServiceClient::GetEnvironment( - google::cloud::dataplex::v1::GetEnvironmentRequest const& request, - Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->GetEnvironment(request); -} - -StreamRange -DataplexServiceClient::ListSessions(std::string const& parent, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - google::cloud::dataplex::v1::ListSessionsRequest request; - request.set_parent(parent); - return connection_->ListSessions(request); -} - -StreamRange -DataplexServiceClient::ListSessions( - google::cloud::dataplex::v1::ListSessionsRequest request, Options opts) { - internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); - return connection_->ListSessions(std::move(request)); -} - StreamRange DataplexServiceClient::ListLocations( google::cloud::location::ListLocationsRequest request, Options opts) { diff --git a/google/cloud/dataplex/v1/dataplex_client.h b/google/cloud/dataplex/v1/dataplex_client.h index c7d3b35b92b29..1b2e883cbe659 100644 --- a/google/cloud/dataplex/v1/dataplex_client.h +++ b/google/cloud/dataplex/v1/dataplex_client.h @@ -128,7 +128,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L392} + /// [google.cloud.dataplex.v1.CreateLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L324} /// [google.cloud.dataplex.v1.Lake]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L37} /// // clang-format on @@ -182,7 +182,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L392} + /// [google.cloud.dataplex.v1.CreateLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L324} /// [google.cloud.dataplex.v1.Lake]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L37} /// // clang-format on @@ -245,7 +245,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Lake]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L37} - /// [google.cloud.dataplex.v1.UpdateLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L422} + /// [google.cloud.dataplex.v1.UpdateLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L354} /// // clang-format on future> UpdateLake( @@ -298,7 +298,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Lake]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L37} - /// [google.cloud.dataplex.v1.UpdateLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L422} + /// [google.cloud.dataplex.v1.UpdateLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L354} /// // clang-format on future> UpdateLake( @@ -359,8 +359,8 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L437} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L369} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> DeleteLake( @@ -412,8 +412,8 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L437} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L369} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> DeleteLake( @@ -477,7 +477,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Lake]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L37} - /// [google.cloud.dataplex.v1.ListLakesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L447} + /// [google.cloud.dataplex.v1.ListLakesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L379} /// // clang-format on StreamRange ListLakes( @@ -516,7 +516,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Lake]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L37} - /// [google.cloud.dataplex.v1.ListLakesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L447} + /// [google.cloud.dataplex.v1.ListLakesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L379} /// // clang-format on StreamRange ListLakes( @@ -541,7 +541,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.GetLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L520} + /// [google.cloud.dataplex.v1.GetLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L452} /// [google.cloud.dataplex.v1.Lake]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L37} /// // clang-format on @@ -571,7 +571,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.GetLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L520} + /// [google.cloud.dataplex.v1.GetLakeRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L452} /// [google.cloud.dataplex.v1.Lake]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L37} /// // clang-format on @@ -608,7 +608,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Action]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L315} - /// [google.cloud.dataplex.v1.ListLakeActionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L489} + /// [google.cloud.dataplex.v1.ListLakeActionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L421} /// // clang-format on StreamRange ListLakeActions( @@ -647,7 +647,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Action]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L315} - /// [google.cloud.dataplex.v1.ListLakeActionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L489} + /// [google.cloud.dataplex.v1.ListLakeActionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L421} /// // clang-format on StreamRange ListLakeActions( @@ -690,7 +690,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L530} + /// [google.cloud.dataplex.v1.CreateZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L462} /// [google.cloud.dataplex.v1.Zone]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L150} /// // clang-format on @@ -744,7 +744,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L530} + /// [google.cloud.dataplex.v1.CreateZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L462} /// [google.cloud.dataplex.v1.Zone]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L150} /// // clang-format on @@ -806,7 +806,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.UpdateZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L558} + /// [google.cloud.dataplex.v1.UpdateZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L490} /// [google.cloud.dataplex.v1.Zone]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L150} /// // clang-format on @@ -859,7 +859,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.UpdateZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L558} + /// [google.cloud.dataplex.v1.UpdateZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L490} /// [google.cloud.dataplex.v1.Zone]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L150} /// // clang-format on @@ -921,8 +921,8 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L573} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L505} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> DeleteZone( @@ -974,8 +974,8 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L573} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L505} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> DeleteZone( @@ -1037,7 +1037,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.ListZonesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L583} + /// [google.cloud.dataplex.v1.ListZonesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L515} /// [google.cloud.dataplex.v1.Zone]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L150} /// // clang-format on @@ -1076,7 +1076,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.ListZonesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L583} + /// [google.cloud.dataplex.v1.ListZonesRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L515} /// [google.cloud.dataplex.v1.Zone]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L150} /// // clang-format on @@ -1102,7 +1102,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.GetZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L640} + /// [google.cloud.dataplex.v1.GetZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L572} /// [google.cloud.dataplex.v1.Zone]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L150} /// // clang-format on @@ -1132,7 +1132,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.GetZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L640} + /// [google.cloud.dataplex.v1.GetZoneRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L572} /// [google.cloud.dataplex.v1.Zone]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L150} /// // clang-format on @@ -1169,7 +1169,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Action]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L315} - /// [google.cloud.dataplex.v1.ListZoneActionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L619} + /// [google.cloud.dataplex.v1.ListZoneActionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L551} /// // clang-format on StreamRange ListZoneActions( @@ -1208,7 +1208,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Action]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L315} - /// [google.cloud.dataplex.v1.ListZoneActionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L619} + /// [google.cloud.dataplex.v1.ListZoneActionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L551} /// // clang-format on StreamRange ListZoneActions( @@ -1251,7 +1251,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Asset]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L505} - /// [google.cloud.dataplex.v1.CreateAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L650} + /// [google.cloud.dataplex.v1.CreateAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L582} /// // clang-format on future> CreateAsset( @@ -1306,7 +1306,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Asset]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L505} - /// [google.cloud.dataplex.v1.CreateAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L650} + /// [google.cloud.dataplex.v1.CreateAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L582} /// // clang-format on future> CreateAsset( @@ -1369,7 +1369,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Asset]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L505} - /// [google.cloud.dataplex.v1.UpdateAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L677} + /// [google.cloud.dataplex.v1.UpdateAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L609} /// // clang-format on future> UpdateAsset( @@ -1422,7 +1422,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Asset]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L505} - /// [google.cloud.dataplex.v1.UpdateAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L677} + /// [google.cloud.dataplex.v1.UpdateAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L609} /// // clang-format on future> UpdateAsset( @@ -1484,8 +1484,8 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L692} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L624} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> DeleteAsset( @@ -1537,8 +1537,8 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L692} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L624} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> DeleteAsset( @@ -1602,7 +1602,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Asset]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L505} - /// [google.cloud.dataplex.v1.ListAssetsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} + /// [google.cloud.dataplex.v1.ListAssetsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L634} /// // clang-format on StreamRange ListAssets( @@ -1641,7 +1641,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Asset]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L505} - /// [google.cloud.dataplex.v1.ListAssetsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} + /// [google.cloud.dataplex.v1.ListAssetsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L634} /// // clang-format on StreamRange ListAssets( @@ -1668,7 +1668,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Asset]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L505} - /// [google.cloud.dataplex.v1.GetAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L760} + /// [google.cloud.dataplex.v1.GetAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L692} /// // clang-format on StatusOr GetAsset(std::string const& name, @@ -1698,7 +1698,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Asset]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L505} - /// [google.cloud.dataplex.v1.GetAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L760} + /// [google.cloud.dataplex.v1.GetAssetRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L692} /// // clang-format on StatusOr GetAsset( @@ -1734,7 +1734,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Action]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L315} - /// [google.cloud.dataplex.v1.ListAssetActionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L739} + /// [google.cloud.dataplex.v1.ListAssetActionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L671} /// // clang-format on StreamRange ListAssetActions( @@ -1773,7 +1773,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Action]: @googleapis_reference_link{google/cloud/dataplex/v1/resources.proto#L315} - /// [google.cloud.dataplex.v1.ListAssetActionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L739} + /// [google.cloud.dataplex.v1.ListAssetActionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L671} /// // clang-format on StreamRange ListAssetActions( @@ -1808,7 +1808,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L800} + /// [google.cloud.dataplex.v1.CreateTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L732} /// [google.cloud.dataplex.v1.Task]: @googleapis_reference_link{google/cloud/dataplex/v1/tasks.proto#L31} /// // clang-format on @@ -1862,7 +1862,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CreateTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L800} + /// [google.cloud.dataplex.v1.CreateTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L732} /// [google.cloud.dataplex.v1.Task]: @googleapis_reference_link{google/cloud/dataplex/v1/tasks.proto#L31} /// // clang-format on @@ -1925,7 +1925,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Task]: @googleapis_reference_link{google/cloud/dataplex/v1/tasks.proto#L31} - /// [google.cloud.dataplex.v1.UpdateTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L820} + /// [google.cloud.dataplex.v1.UpdateTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L752} /// // clang-format on future> UpdateTask( @@ -1978,7 +1978,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Task]: @googleapis_reference_link{google/cloud/dataplex/v1/tasks.proto#L31} - /// [google.cloud.dataplex.v1.UpdateTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L820} + /// [google.cloud.dataplex.v1.UpdateTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L752} /// // clang-format on future> UpdateTask( @@ -2038,8 +2038,8 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L835} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L767} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> DeleteTask( @@ -2090,8 +2090,8 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.DeleteTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L835} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} + /// [google.cloud.dataplex.v1.DeleteTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L767} + /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L702} /// // clang-format on future> DeleteTask( @@ -2153,7 +2153,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.ListTasksRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L845} + /// [google.cloud.dataplex.v1.ListTasksRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L777} /// [google.cloud.dataplex.v1.Task]: @googleapis_reference_link{google/cloud/dataplex/v1/tasks.proto#L31} /// // clang-format on @@ -2192,7 +2192,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.ListTasksRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L845} + /// [google.cloud.dataplex.v1.ListTasksRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L777} /// [google.cloud.dataplex.v1.Task]: @googleapis_reference_link{google/cloud/dataplex/v1/tasks.proto#L31} /// // clang-format on @@ -2218,7 +2218,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.GetTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L884} + /// [google.cloud.dataplex.v1.GetTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L816} /// [google.cloud.dataplex.v1.Task]: @googleapis_reference_link{google/cloud/dataplex/v1/tasks.proto#L31} /// // clang-format on @@ -2248,7 +2248,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.GetTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L884} + /// [google.cloud.dataplex.v1.GetTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L816} /// [google.cloud.dataplex.v1.Task]: @googleapis_reference_link{google/cloud/dataplex/v1/tasks.proto#L31} /// // clang-format on @@ -2285,7 +2285,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Job]: @googleapis_reference_link{google/cloud/dataplex/v1/tasks.proto#L328} - /// [google.cloud.dataplex.v1.ListJobsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L936} + /// [google.cloud.dataplex.v1.ListJobsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L868} /// // clang-format on StreamRange ListJobs( @@ -2324,7 +2324,7 @@ class DataplexServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dataplex.v1.Job]: @googleapis_reference_link{google/cloud/dataplex/v1/tasks.proto#L328} - /// [google.cloud.dataplex.v1.ListJobsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L936} + /// [google.cloud.dataplex.v1.ListJobsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L868} /// // clang-format on StreamRange ListJobs( @@ -2349,8 +2349,8 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.RunTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L903} - /// [google.cloud.dataplex.v1.RunTaskResponse]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L930} + /// [google.cloud.dataplex.v1.RunTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L835} + /// [google.cloud.dataplex.v1.RunTaskResponse]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L862} /// // clang-format on StatusOr RunTask( @@ -2379,8 +2379,8 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.RunTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L903} - /// [google.cloud.dataplex.v1.RunTaskResponse]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L930} + /// [google.cloud.dataplex.v1.RunTaskRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L835} + /// [google.cloud.dataplex.v1.RunTaskResponse]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L862} /// // clang-format on StatusOr RunTask( @@ -2406,7 +2406,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.GetJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L894} + /// [google.cloud.dataplex.v1.GetJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L826} /// [google.cloud.dataplex.v1.Job]: @googleapis_reference_link{google/cloud/dataplex/v1/tasks.proto#L328} /// // clang-format on @@ -2436,7 +2436,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.GetJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L894} + /// [google.cloud.dataplex.v1.GetJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L826} /// [google.cloud.dataplex.v1.Job]: @googleapis_reference_link{google/cloud/dataplex/v1/tasks.proto#L328} /// // clang-format on @@ -2461,7 +2461,7 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CancelJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L967} + /// [google.cloud.dataplex.v1.CancelJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L899} /// // clang-format on Status CancelJob(std::string const& name, Options opts = {}); @@ -2487,576 +2487,12 @@ class DataplexServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dataplex.v1.CancelJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L967} + /// [google.cloud.dataplex.v1.CancelJobRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L899} /// // clang-format on Status CancelJob(google::cloud::dataplex::v1::CancelJobRequest const& request, Options opts = {}); - // clang-format off - /// - /// Create an environment resource. - /// - /// @param parent Required. The resource name of the parent lake: - /// `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. - /// @param environment Required. Environment resource. - /// @param environment_id Required. Environment identifier. - /// * Must contain only lowercase letters, numbers and hyphens. - /// * Must start with a letter. - /// * Must be between 1-63 characters. - /// * Must end with a number or a letter. - /// * Must be unique within the lake. - /// @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.dataplex.v1.Environment] 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.dataplex.v1.CreateEnvironmentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L977} - /// [google.cloud.dataplex.v1.Environment]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L32} - /// - // clang-format on - future> CreateEnvironment( - std::string const& parent, - google::cloud::dataplex::v1::Environment const& environment, - std::string const& environment_id, Options opts = {}); - - // clang-format off - /// - /// @copybrief CreateEnvironment - /// - /// 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 CreateEnvironment( - NoAwaitTag, std::string const& parent, - google::cloud::dataplex::v1::Environment const& environment, - std::string const& environment_id, Options opts = {}); - - // clang-format off - /// - /// Create an environment resource. - /// - /// @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.dataplex.v1.CreateEnvironmentRequest]. - /// 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.dataplex.v1.Environment] 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.dataplex.v1.CreateEnvironmentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L977} - /// [google.cloud.dataplex.v1.Environment]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L32} - /// - // clang-format on - future> CreateEnvironment( - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// @copybrief CreateEnvironment - /// - /// 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 CreateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// @copybrief CreateEnvironment - /// - /// 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> CreateEnvironment( - google::longrunning::Operation const& operation, Options opts = {}); - - // clang-format off - /// - /// Update the environment resource. - /// - /// @param environment Required. Update description. - /// Only fields specified in `update_mask` are updated. - /// @param update_mask Required. Mask of fields to update. - /// @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.dataplex.v1.Environment] 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.dataplex.v1.Environment]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L32} - /// [google.cloud.dataplex.v1.UpdateEnvironmentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L1002} - /// - // clang-format on - future> UpdateEnvironment( - google::cloud::dataplex::v1::Environment const& environment, - google::protobuf::FieldMask const& update_mask, Options opts = {}); - - // clang-format off - /// - /// @copybrief UpdateEnvironment - /// - /// 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 UpdateEnvironment( - NoAwaitTag, google::cloud::dataplex::v1::Environment const& environment, - google::protobuf::FieldMask const& update_mask, Options opts = {}); - - // clang-format off - /// - /// Update the environment resource. - /// - /// @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.dataplex.v1.UpdateEnvironmentRequest]. - /// 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.dataplex.v1.Environment] 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.dataplex.v1.Environment]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L32} - /// [google.cloud.dataplex.v1.UpdateEnvironmentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L1002} - /// - // clang-format on - future> UpdateEnvironment( - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// @copybrief UpdateEnvironment - /// - /// 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 UpdateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// @copybrief UpdateEnvironment - /// - /// 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> UpdateEnvironment( - google::longrunning::Operation const& operation, Options opts = {}); - - // clang-format off - /// - /// Delete the environment resource. All the child resources must have been - /// deleted before environment deletion can be initiated. - /// - /// @param name Required. The resource name of the environment: - /// `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. - /// @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.dataplex.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.dataplex.v1.DeleteEnvironmentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L1017} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} - /// - // clang-format on - future> - DeleteEnvironment(std::string const& name, Options opts = {}); - - // clang-format off - /// - /// @copybrief DeleteEnvironment - /// - /// 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 DeleteEnvironment( - NoAwaitTag, std::string const& name, Options opts = {}); - - // clang-format off - /// - /// Delete the environment resource. All the child resources must have been - /// deleted before environment deletion can be initiated. - /// - /// @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.dataplex.v1.DeleteEnvironmentRequest]. - /// 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.dataplex.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.dataplex.v1.DeleteEnvironmentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L1017} - /// [google.cloud.dataplex.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L770} - /// - // clang-format on - future> - DeleteEnvironment( - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// @copybrief DeleteEnvironment - /// - /// 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 DeleteEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// @copybrief DeleteEnvironment - /// - /// 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> - DeleteEnvironment(google::longrunning::Operation const& operation, - Options opts = {}); - - // clang-format off - /// - /// Lists environments under the given lake. - /// - /// @param parent Required. The resource name of the parent lake: - /// `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. - /// @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.dataplex.v1.Environment], 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.dataplex.v1.Environment]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L32} - /// [google.cloud.dataplex.v1.ListEnvironmentsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L1029} - /// - // clang-format on - StreamRange ListEnvironments( - std::string const& parent, Options opts = {}); - - // clang-format off - /// - /// Lists environments under the given lake. - /// - /// @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.dataplex.v1.ListEnvironmentsRequest]. - /// 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.dataplex.v1.Environment], 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.dataplex.v1.Environment]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L32} - /// [google.cloud.dataplex.v1.ListEnvironmentsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L1029} - /// - // clang-format on - StreamRange ListEnvironments( - google::cloud::dataplex::v1::ListEnvironmentsRequest request, - Options opts = {}); - - // clang-format off - /// - /// Get environment resource. - /// - /// @param name Required. The resource name of the environment: - /// `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. - /// @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.dataplex.v1.Environment]) - /// 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.dataplex.v1.Environment]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L32} - /// [google.cloud.dataplex.v1.GetEnvironmentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L1067} - /// - // clang-format on - StatusOr GetEnvironment( - std::string const& name, Options opts = {}); - - // clang-format off - /// - /// Get environment resource. - /// - /// @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.dataplex.v1.GetEnvironmentRequest]. - /// 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.dataplex.v1.Environment]) - /// 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.dataplex.v1.Environment]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L32} - /// [google.cloud.dataplex.v1.GetEnvironmentRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L1067} - /// - // clang-format on - StatusOr GetEnvironment( - google::cloud::dataplex::v1::GetEnvironmentRequest const& request, - Options opts = {}); - - // clang-format off - /// - /// Lists session resources in an environment. - /// - /// @param parent Required. The resource name of the parent environment: - /// `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`. - /// @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.dataplex.v1.Session], 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.dataplex.v1.ListSessionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L1079} - /// [google.cloud.dataplex.v1.Session]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L261} - /// - // clang-format on - StreamRange ListSessions( - std::string const& parent, Options opts = {}); - - // clang-format off - /// - /// Lists session resources in an environment. - /// - /// @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.dataplex.v1.ListSessionsRequest]. - /// 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.dataplex.v1.Session], 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.dataplex.v1.ListSessionsRequest]: @googleapis_reference_link{google/cloud/dataplex/v1/service.proto#L1079} - /// [google.cloud.dataplex.v1.Session]: @googleapis_reference_link{google/cloud/dataplex/v1/analyze.proto#L261} - /// - // clang-format on - StreamRange ListSessions( - google::cloud::dataplex::v1::ListSessionsRequest request, - Options opts = {}); - // clang-format off /// /// Lists information about the supported locations for this service. @@ -3449,7 +2885,7 @@ class DataplexServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -3488,7 +2924,7 @@ class DataplexServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataplex/v1/dataplex_connection.cc b/google/cloud/dataplex/v1/dataplex_connection.cc index ea3d8b605ab8e..a35b9f7067aba 100644 --- a/google/cloud/dataplex/v1/dataplex_connection.cc +++ b/google/cloud/dataplex/v1/dataplex_connection.cc @@ -391,97 +391,6 @@ Status DataplexServiceConnection::CancelJob( return Status(StatusCode::kUnimplemented, "not implemented"); } -future> -DataplexServiceConnection::CreateEnvironment( - google::cloud::dataplex::v1::CreateEnvironmentRequest const&) { - return google::cloud::make_ready_future< - StatusOr>( - Status(StatusCode::kUnimplemented, "not implemented")); -} - -StatusOr -DataplexServiceConnection::CreateEnvironment( - NoAwaitTag, google::cloud::dataplex::v1::CreateEnvironmentRequest const&) { - return StatusOr( - Status(StatusCode::kUnimplemented, "not implemented")); -} - -future> -DataplexServiceConnection::CreateEnvironment( - google::longrunning::Operation const&) { - return google::cloud::make_ready_future< - StatusOr>( - Status(StatusCode::kUnimplemented, "not implemented")); -} - -future> -DataplexServiceConnection::UpdateEnvironment( - google::cloud::dataplex::v1::UpdateEnvironmentRequest const&) { - return google::cloud::make_ready_future< - StatusOr>( - Status(StatusCode::kUnimplemented, "not implemented")); -} - -StatusOr -DataplexServiceConnection::UpdateEnvironment( - NoAwaitTag, google::cloud::dataplex::v1::UpdateEnvironmentRequest const&) { - return StatusOr( - Status(StatusCode::kUnimplemented, "not implemented")); -} - -future> -DataplexServiceConnection::UpdateEnvironment( - google::longrunning::Operation const&) { - return google::cloud::make_ready_future< - StatusOr>( - Status(StatusCode::kUnimplemented, "not implemented")); -} - -future> -DataplexServiceConnection::DeleteEnvironment( - google::cloud::dataplex::v1::DeleteEnvironmentRequest const&) { - return google::cloud::make_ready_future< - StatusOr>( - Status(StatusCode::kUnimplemented, "not implemented")); -} - -StatusOr -DataplexServiceConnection::DeleteEnvironment( - NoAwaitTag, google::cloud::dataplex::v1::DeleteEnvironmentRequest const&) { - return StatusOr( - Status(StatusCode::kUnimplemented, "not implemented")); -} - -future> -DataplexServiceConnection::DeleteEnvironment( - google::longrunning::Operation const&) { - return google::cloud::make_ready_future< - StatusOr>( - Status(StatusCode::kUnimplemented, "not implemented")); -} - -StreamRange -DataplexServiceConnection::ListEnvironments( - google::cloud::dataplex::v1:: - ListEnvironmentsRequest) { // NOLINT(performance-unnecessary-value-param) - return google::cloud::internal::MakeUnimplementedPaginationRange< - StreamRange>(); -} - -StatusOr -DataplexServiceConnection::GetEnvironment( - google::cloud::dataplex::v1::GetEnvironmentRequest const&) { - return Status(StatusCode::kUnimplemented, "not implemented"); -} - -StreamRange -DataplexServiceConnection::ListSessions( - google::cloud::dataplex::v1:: - ListSessionsRequest) { // NOLINT(performance-unnecessary-value-param) - return google::cloud::internal::MakeUnimplementedPaginationRange< - StreamRange>(); -} - StreamRange DataplexServiceConnection::ListLocations( google::cloud::location:: diff --git a/google/cloud/dataplex/v1/dataplex_connection.h b/google/cloud/dataplex/v1/dataplex_connection.h index d2fd77f3b1016..34f050c05f1cb 100644 --- a/google/cloud/dataplex/v1/dataplex_connection.h +++ b/google/cloud/dataplex/v1/dataplex_connection.h @@ -352,49 +352,6 @@ class DataplexServiceConnection { virtual Status CancelJob( google::cloud::dataplex::v1::CancelJobRequest const& request); - virtual future> - CreateEnvironment( - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request); - - virtual StatusOr CreateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request); - - virtual future> - CreateEnvironment(google::longrunning::Operation const& operation); - - virtual future> - UpdateEnvironment( - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request); - - virtual StatusOr UpdateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request); - - virtual future> - UpdateEnvironment(google::longrunning::Operation const& operation); - - virtual future> - DeleteEnvironment( - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request); - - virtual StatusOr DeleteEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request); - - virtual future> - DeleteEnvironment(google::longrunning::Operation const& operation); - - virtual StreamRange - ListEnvironments( - google::cloud::dataplex::v1::ListEnvironmentsRequest request); - - virtual StatusOr GetEnvironment( - google::cloud::dataplex::v1::GetEnvironmentRequest const& request); - - virtual StreamRange ListSessions( - google::cloud::dataplex::v1::ListSessionsRequest request); - virtual StreamRange ListLocations( google::cloud::location::ListLocationsRequest request); diff --git a/google/cloud/dataplex/v1/dataplex_connection_idempotency_policy.cc b/google/cloud/dataplex/v1/dataplex_connection_idempotency_policy.cc index ca558dc1fa581..8b8226561044d 100644 --- a/google/cloud/dataplex/v1/dataplex_connection_idempotency_policy.cc +++ b/google/cloud/dataplex/v1/dataplex_connection_idempotency_policy.cc @@ -169,36 +169,6 @@ Idempotency DataplexServiceConnectionIdempotencyPolicy::CancelJob( return Idempotency::kNonIdempotent; } -Idempotency DataplexServiceConnectionIdempotencyPolicy::CreateEnvironment( - google::cloud::dataplex::v1::CreateEnvironmentRequest const&) { - return Idempotency::kNonIdempotent; -} - -Idempotency DataplexServiceConnectionIdempotencyPolicy::UpdateEnvironment( - google::cloud::dataplex::v1::UpdateEnvironmentRequest const&) { - return Idempotency::kNonIdempotent; -} - -Idempotency DataplexServiceConnectionIdempotencyPolicy::DeleteEnvironment( - google::cloud::dataplex::v1::DeleteEnvironmentRequest const&) { - return Idempotency::kNonIdempotent; -} - -Idempotency DataplexServiceConnectionIdempotencyPolicy::ListEnvironments( - google::cloud::dataplex::v1::ListEnvironmentsRequest) { // NOLINT - return Idempotency::kIdempotent; -} - -Idempotency DataplexServiceConnectionIdempotencyPolicy::GetEnvironment( - google::cloud::dataplex::v1::GetEnvironmentRequest const&) { - return Idempotency::kIdempotent; -} - -Idempotency DataplexServiceConnectionIdempotencyPolicy::ListSessions( - google::cloud::dataplex::v1::ListSessionsRequest) { // NOLINT - return Idempotency::kIdempotent; -} - Idempotency DataplexServiceConnectionIdempotencyPolicy::ListLocations( google::cloud::location::ListLocationsRequest) { // NOLINT return Idempotency::kIdempotent; diff --git a/google/cloud/dataplex/v1/dataplex_connection_idempotency_policy.h b/google/cloud/dataplex/v1/dataplex_connection_idempotency_policy.h index bc5dc34d9394b..270fbe9b317f1 100644 --- a/google/cloud/dataplex/v1/dataplex_connection_idempotency_policy.h +++ b/google/cloud/dataplex/v1/dataplex_connection_idempotency_policy.h @@ -121,24 +121,6 @@ class DataplexServiceConnectionIdempotencyPolicy { virtual google::cloud::Idempotency CancelJob( google::cloud::dataplex::v1::CancelJobRequest const& request); - virtual google::cloud::Idempotency CreateEnvironment( - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request); - - virtual google::cloud::Idempotency UpdateEnvironment( - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request); - - virtual google::cloud::Idempotency DeleteEnvironment( - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request); - - virtual google::cloud::Idempotency ListEnvironments( - google::cloud::dataplex::v1::ListEnvironmentsRequest request); - - virtual google::cloud::Idempotency GetEnvironment( - google::cloud::dataplex::v1::GetEnvironmentRequest const& request); - - virtual google::cloud::Idempotency ListSessions( - google::cloud::dataplex::v1::ListSessionsRequest request); - virtual google::cloud::Idempotency ListLocations( google::cloud::location::ListLocationsRequest request); diff --git a/google/cloud/dataplex/v1/internal/business_glossary_auth_decorator.cc b/google/cloud/dataplex/v1/internal/business_glossary_auth_decorator.cc new file mode 100644 index 0000000000000..5774c07dd8a79 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_auth_decorator.cc @@ -0,0 +1,348 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#include "google/cloud/dataplex/v1/internal/business_glossary_auth_decorator.h" +#include "google/cloud/dataplex/v1/business_glossary.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +BusinessGlossaryServiceAuth::BusinessGlossaryServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +future> +BusinessGlossaryServiceAuth::AsyncCreateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateGlossaryRequest 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->AsyncCreateGlossary(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +BusinessGlossaryServiceAuth::CreateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateGlossary(context, options, request); +} + +future> +BusinessGlossaryServiceAuth::AsyncUpdateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateGlossaryRequest 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->AsyncUpdateGlossary(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +BusinessGlossaryServiceAuth::UpdateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateGlossary(context, options, request); +} + +future> +BusinessGlossaryServiceAuth::AsyncDeleteGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteGlossaryRequest 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->AsyncDeleteGlossary(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +BusinessGlossaryServiceAuth::DeleteGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteGlossary(context, options, request); +} + +StatusOr +BusinessGlossaryServiceAuth::GetGlossary( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetGlossary(context, options, request); +} + +StatusOr +BusinessGlossaryServiceAuth::ListGlossaries( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossariesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListGlossaries(context, options, request); +} + +StatusOr +BusinessGlossaryServiceAuth::CreateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateGlossaryCategory(context, options, request); +} + +StatusOr +BusinessGlossaryServiceAuth::UpdateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateGlossaryCategory(context, options, request); +} + +Status BusinessGlossaryServiceAuth::DeleteGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteGlossaryCategory(context, options, request); +} + +StatusOr +BusinessGlossaryServiceAuth::GetGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetGlossaryCategory(context, options, request); +} + +StatusOr +BusinessGlossaryServiceAuth::ListGlossaryCategories( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListGlossaryCategories(context, options, request); +} + +StatusOr +BusinessGlossaryServiceAuth::CreateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateGlossaryTerm(context, options, request); +} + +StatusOr +BusinessGlossaryServiceAuth::UpdateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateGlossaryTerm(context, options, request); +} + +Status BusinessGlossaryServiceAuth::DeleteGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteGlossaryTerm(context, options, request); +} + +StatusOr +BusinessGlossaryServiceAuth::GetGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetGlossaryTerm(context, options, request); +} + +StatusOr +BusinessGlossaryServiceAuth::ListGlossaryTerms( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryTermsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListGlossaryTerms(context, options, request); +} + +StatusOr +BusinessGlossaryServiceAuth::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 +BusinessGlossaryServiceAuth::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 BusinessGlossaryServiceAuth::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->SetIamPolicy(context, options, request); +} + +StatusOr BusinessGlossaryServiceAuth::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetIamPolicy(context, options, request); +} + +StatusOr +BusinessGlossaryServiceAuth::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->TestIamPermissions(context, options, request); +} + +StatusOr +BusinessGlossaryServiceAuth::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 +BusinessGlossaryServiceAuth::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 BusinessGlossaryServiceAuth::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 BusinessGlossaryServiceAuth::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> +BusinessGlossaryServiceAuth::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 BusinessGlossaryServiceAuth::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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/business_glossary_auth_decorator.h b/google/cloud/dataplex/v1/internal/business_glossary_auth_decorator.h new file mode 100644 index 0000000000000..c553a64ec54ae --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_auth_decorator.h @@ -0,0 +1,203 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_AUTH_DECORATOR_H + +#include "google/cloud/dataplex/v1/internal/business_glossary_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class BusinessGlossaryServiceAuth : public BusinessGlossaryServiceStub { + public: + ~BusinessGlossaryServiceAuth() override = default; + BusinessGlossaryServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + future> AsyncCreateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + StatusOr CreateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + future> AsyncUpdateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + StatusOr UpdateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + future> AsyncDeleteGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) + override; + + StatusOr DeleteGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) + override; + + StatusOr GetGlossary( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryRequest const& request) override; + + StatusOr ListGlossaries( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossariesRequest const& request) + override; + + StatusOr + CreateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) + override; + + StatusOr + UpdateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) + override; + + Status DeleteGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) + override; + + StatusOr GetGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) + override; + + StatusOr + ListGlossaryCategories( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest const& request) + override; + + StatusOr CreateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) + override; + + StatusOr UpdateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) + override; + + Status DeleteGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) + override; + + StatusOr GetGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) + override; + + StatusOr + ListGlossaryTerms(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryTermsRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_AUTH_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/business_glossary_connection_impl.cc b/google/cloud/dataplex/v1/internal/business_glossary_connection_impl.cc new file mode 100644 index 0000000000000..1a4ffe912f957 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_connection_impl.cc @@ -0,0 +1,746 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#include "google/cloud/dataplex/v1/internal/business_glossary_connection_impl.h" +#include "google/cloud/dataplex/v1/internal/business_glossary_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 dataplex_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 + +BusinessGlossaryServiceConnectionImpl::BusinessGlossaryServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions( + std::move(options), BusinessGlossaryServiceConnection::options())) {} + +future> +BusinessGlossaryServiceConnectionImpl::CreateGlossary( + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateGlossary(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::v1::Glossary>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + return stub->AsyncCreateGlossary(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::dataplex::v1::Glossary>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +BusinessGlossaryServiceConnectionImpl::CreateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateGlossary(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + return stub_->CreateGlossary(context, options, request); + }, + *current, request, __func__); +} + +future> +BusinessGlossaryServiceConnectionImpl::CreateGlossary( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateGlossary", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::v1::Glossary>( + 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::dataplex::v1::Glossary>, + polling_policy(*current), __func__); +} + +future> +BusinessGlossaryServiceConnectionImpl::UpdateGlossary( + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateGlossary(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::v1::Glossary>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + return stub->AsyncUpdateGlossary(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::dataplex::v1::Glossary>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +BusinessGlossaryServiceConnectionImpl::UpdateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateGlossary(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + return stub_->UpdateGlossary(context, options, request); + }, + *current, request, __func__); +} + +future> +BusinessGlossaryServiceConnectionImpl::UpdateGlossary( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateGlossary", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::v1::Glossary>( + 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::dataplex::v1::Glossary>, + polling_policy(*current), __func__); +} + +future> +BusinessGlossaryServiceConnectionImpl::DeleteGlossary( + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteGlossary(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::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::dataplex::v1::DeleteGlossaryRequest const& request) { + return stub->AsyncDeleteGlossary(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::dataplex::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +BusinessGlossaryServiceConnectionImpl::DeleteGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteGlossary(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + return stub_->DeleteGlossary(context, options, request); + }, + *current, request, __func__); +} + +future> +BusinessGlossaryServiceConnectionImpl::DeleteGlossary( + 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 DeleteGlossary", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::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::dataplex::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StatusOr +BusinessGlossaryServiceConnectionImpl::GetGlossary( + google::cloud::dataplex::v1::GetGlossaryRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetGlossary(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryRequest const& request) { + return stub_->GetGlossary(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +BusinessGlossaryServiceConnectionImpl::ListGlossaries( + google::cloud::dataplex::v1::ListGlossariesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListGlossaries(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::dataplex::v1::ListGlossariesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossariesRequest const& + request) { + return stub->ListGlossaries(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::dataplex::v1::ListGlossariesResponse r) { + std::vector result( + r.glossaries().size()); + auto& messages = *r.mutable_glossaries(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +BusinessGlossaryServiceConnectionImpl::CreateGlossaryCategory( + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateGlossaryCategory(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& + request) { + return stub_->CreateGlossaryCategory(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +BusinessGlossaryServiceConnectionImpl::UpdateGlossaryCategory( + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateGlossaryCategory(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& + request) { + return stub_->UpdateGlossaryCategory(context, options, request); + }, + *current, request, __func__); +} + +Status BusinessGlossaryServiceConnectionImpl::DeleteGlossaryCategory( + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteGlossaryCategory(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& + request) { + return stub_->DeleteGlossaryCategory(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +BusinessGlossaryServiceConnectionImpl::GetGlossaryCategory( + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetGlossaryCategory(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& + request) { + return stub_->GetGlossaryCategory(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +BusinessGlossaryServiceConnectionImpl::ListGlossaryCategories( + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListGlossaryCategories(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::dataplex::v1::ListGlossaryCategoriesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1:: + ListGlossaryCategoriesRequest const& request) { + return stub->ListGlossaryCategories(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::dataplex::v1::ListGlossaryCategoriesResponse r) { + std::vector result( + r.categories().size()); + auto& messages = *r.mutable_categories(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +BusinessGlossaryServiceConnectionImpl::CreateGlossaryTerm( + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateGlossaryTerm(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& + request) { + return stub_->CreateGlossaryTerm(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +BusinessGlossaryServiceConnectionImpl::UpdateGlossaryTerm( + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateGlossaryTerm(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& + request) { + return stub_->UpdateGlossaryTerm(context, options, request); + }, + *current, request, __func__); +} + +Status BusinessGlossaryServiceConnectionImpl::DeleteGlossaryTerm( + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteGlossaryTerm(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& + request) { + return stub_->DeleteGlossaryTerm(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +BusinessGlossaryServiceConnectionImpl::GetGlossaryTerm( + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetGlossaryTerm(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) { + return stub_->GetGlossaryTerm(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +BusinessGlossaryServiceConnectionImpl::ListGlossaryTerms( + google::cloud::dataplex::v1::ListGlossaryTermsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListGlossaryTerms(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::dataplex::v1::ListGlossaryTermsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryTermsRequest const& + request) { + return stub->ListGlossaryTerms(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::dataplex::v1::ListGlossaryTermsResponse r) { + std::vector result( + r.terms().size()); + auto& messages = *r.mutable_terms(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StreamRange +BusinessGlossaryServiceConnectionImpl::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 +BusinessGlossaryServiceConnectionImpl::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__); +} + +StatusOr +BusinessGlossaryServiceConnectionImpl::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->SetIamPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + return stub_->SetIamPolicy(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +BusinessGlossaryServiceConnectionImpl::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetIamPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + return stub_->GetIamPolicy(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +BusinessGlossaryServiceConnectionImpl::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->TestIamPermissions(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + return stub_->TestIamPermissions(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +BusinessGlossaryServiceConnectionImpl::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 +BusinessGlossaryServiceConnectionImpl::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 BusinessGlossaryServiceConnectionImpl::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 BusinessGlossaryServiceConnectionImpl::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 dataplex_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/internal/business_glossary_connection_impl.h b/google/cloud/dataplex/v1/internal/business_glossary_connection_impl.h new file mode 100644 index 0000000000000..170760e1ae178 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_connection_impl.h @@ -0,0 +1,177 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_CONNECTION_IMPL_H + +#include "google/cloud/dataplex/v1/business_glossary_connection.h" +#include "google/cloud/dataplex/v1/business_glossary_connection_idempotency_policy.h" +#include "google/cloud/dataplex/v1/business_glossary_options.h" +#include "google/cloud/dataplex/v1/internal/business_glossary_retry_traits.h" +#include "google/cloud/dataplex/v1/internal/business_glossary_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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class BusinessGlossaryServiceConnectionImpl + : public dataplex_v1::BusinessGlossaryServiceConnection { + public: + ~BusinessGlossaryServiceConnectionImpl() override = default; + + BusinessGlossaryServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + future> CreateGlossary( + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + StatusOr CreateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + future> CreateGlossary( + google::longrunning::Operation const& operation) override; + + future> UpdateGlossary( + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + StatusOr UpdateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + future> UpdateGlossary( + google::longrunning::Operation const& operation) override; + + future> + DeleteGlossary(google::cloud::dataplex::v1::DeleteGlossaryRequest const& + request) override; + + StatusOr DeleteGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) + override; + + future> + DeleteGlossary(google::longrunning::Operation const& operation) override; + + StatusOr GetGlossary( + google::cloud::dataplex::v1::GetGlossaryRequest const& request) override; + + StreamRange ListGlossaries( + google::cloud::dataplex::v1::ListGlossariesRequest request) override; + + StatusOr + CreateGlossaryCategory( + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) + override; + + StatusOr + UpdateGlossaryCategory( + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) + override; + + Status DeleteGlossaryCategory( + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) + override; + + StatusOr GetGlossaryCategory( + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) + override; + + StreamRange + ListGlossaryCategories( + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest request) + override; + + StatusOr CreateGlossaryTerm( + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) + override; + + StatusOr UpdateGlossaryTerm( + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) + override; + + Status DeleteGlossaryTerm( + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) + override; + + StatusOr GetGlossaryTerm( + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) + override; + + StreamRange ListGlossaryTerms( + google::cloud::dataplex::v1::ListGlossaryTermsRequest request) override; + + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request) override; + + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest 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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_CONNECTION_IMPL_H diff --git a/google/cloud/dataplex/v1/internal/business_glossary_logging_decorator.cc b/google/cloud/dataplex/v1/internal/business_glossary_logging_decorator.cc new file mode 100644 index 0000000000000..91d949ec9118a --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_logging_decorator.cc @@ -0,0 +1,434 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#include "google/cloud/dataplex/v1/internal/business_glossary_logging_decorator.h" +#include "google/cloud/dataplex/v1/business_glossary.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +BusinessGlossaryServiceLogging::BusinessGlossaryServiceLogging( + std::shared_ptr child, + TracingOptions tracing_options, std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +future> +BusinessGlossaryServiceLogging::AsyncCreateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + return child_->AsyncCreateGlossary(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::CreateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + return child_->CreateGlossary(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +BusinessGlossaryServiceLogging::AsyncUpdateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + return child_->AsyncUpdateGlossary(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::UpdateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + return child_->UpdateGlossary(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +BusinessGlossaryServiceLogging::AsyncDeleteGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + return child_->AsyncDeleteGlossary(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::DeleteGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + return child_->DeleteGlossary(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::GetGlossary( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryRequest const& request) { + return child_->GetGlossary(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::ListGlossaries( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossariesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossariesRequest const& request) { + return child_->ListGlossaries(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::CreateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& + request) { + return child_->CreateGlossaryCategory(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::UpdateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& + request) { + return child_->UpdateGlossaryCategory(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status BusinessGlossaryServiceLogging::DeleteGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& + request) { + return child_->DeleteGlossaryCategory(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::GetGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& + request) { + return child_->GetGlossaryCategory(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::ListGlossaryCategories( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest const& + request) { + return child_->ListGlossaryCategories(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::CreateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& + request) { + return child_->CreateGlossaryTerm(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::UpdateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& + request) { + return child_->UpdateGlossaryTerm(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status BusinessGlossaryServiceLogging::DeleteGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& + request) { + return child_->DeleteGlossaryTerm(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::GetGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) { + return child_->GetGlossaryTerm(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::ListGlossaryTerms( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryTermsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryTermsRequest const& + request) { + return child_->ListGlossaryTerms(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::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 +BusinessGlossaryServiceLogging::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 BusinessGlossaryServiceLogging::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + return child_->SetIamPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr BusinessGlossaryServiceLogging::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + return child_->GetIamPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + return child_->TestIamPermissions(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +BusinessGlossaryServiceLogging::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 +BusinessGlossaryServiceLogging::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 BusinessGlossaryServiceLogging::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 BusinessGlossaryServiceLogging::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> +BusinessGlossaryServiceLogging::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 BusinessGlossaryServiceLogging::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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/business_glossary_logging_decorator.h b/google/cloud/dataplex/v1/internal/business_glossary_logging_decorator.h new file mode 100644 index 0000000000000..59deca5f6c2ef --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_logging_decorator.h @@ -0,0 +1,203 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_LOGGING_DECORATOR_H + +#include "google/cloud/dataplex/v1/internal/business_glossary_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class BusinessGlossaryServiceLogging : public BusinessGlossaryServiceStub { + public: + ~BusinessGlossaryServiceLogging() override = default; + BusinessGlossaryServiceLogging( + std::shared_ptr child, + TracingOptions tracing_options, std::set const& components); + + future> AsyncCreateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + StatusOr CreateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + future> AsyncUpdateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + StatusOr UpdateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + future> AsyncDeleteGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) + override; + + StatusOr DeleteGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) + override; + + StatusOr GetGlossary( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryRequest const& request) override; + + StatusOr ListGlossaries( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossariesRequest const& request) + override; + + StatusOr + CreateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) + override; + + StatusOr + UpdateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) + override; + + Status DeleteGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) + override; + + StatusOr GetGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) + override; + + StatusOr + ListGlossaryCategories( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest const& request) + override; + + StatusOr CreateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) + override; + + StatusOr UpdateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) + override; + + Status DeleteGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) + override; + + StatusOr GetGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) + override; + + StatusOr + ListGlossaryTerms(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryTermsRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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_; +}; // BusinessGlossaryServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_LOGGING_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/business_glossary_metadata_decorator.cc b/google/cloud/dataplex/v1/internal/business_glossary_metadata_decorator.cc new file mode 100644 index 0000000000000..e292e05bb65ca --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_metadata_decorator.cc @@ -0,0 +1,345 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#include "google/cloud/dataplex/v1/internal/business_glossary_metadata_decorator.h" +#include "google/cloud/dataplex/v1/business_glossary.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +BusinessGlossaryServiceMetadata::BusinessGlossaryServiceMetadata( + 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)) {} + +future> +BusinessGlossaryServiceMetadata::AsyncCreateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateGlossary(cq, std::move(context), std::move(options), + request); +} + +StatusOr +BusinessGlossaryServiceMetadata::CreateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateGlossary(context, options, request); +} + +future> +BusinessGlossaryServiceMetadata::AsyncUpdateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("glossary.name=", + internal::UrlEncode(request.glossary().name()))); + return child_->AsyncUpdateGlossary(cq, std::move(context), std::move(options), + request); +} + +StatusOr +BusinessGlossaryServiceMetadata::UpdateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + SetMetadata(context, options, + absl::StrCat("glossary.name=", + internal::UrlEncode(request.glossary().name()))); + return child_->UpdateGlossary(context, options, request); +} + +future> +BusinessGlossaryServiceMetadata::AsyncDeleteGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteGlossary(cq, std::move(context), std::move(options), + request); +} + +StatusOr +BusinessGlossaryServiceMetadata::DeleteGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteGlossary(context, options, request); +} + +StatusOr +BusinessGlossaryServiceMetadata::GetGlossary( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetGlossary(context, options, request); +} + +StatusOr +BusinessGlossaryServiceMetadata::ListGlossaries( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossariesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListGlossaries(context, options, request); +} + +StatusOr +BusinessGlossaryServiceMetadata::CreateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateGlossaryCategory(context, options, request); +} + +StatusOr +BusinessGlossaryServiceMetadata::UpdateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) { + SetMetadata(context, options, + absl::StrCat("category.name=", + internal::UrlEncode(request.category().name()))); + return child_->UpdateGlossaryCategory(context, options, request); +} + +Status BusinessGlossaryServiceMetadata::DeleteGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteGlossaryCategory(context, options, request); +} + +StatusOr +BusinessGlossaryServiceMetadata::GetGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetGlossaryCategory(context, options, request); +} + +StatusOr +BusinessGlossaryServiceMetadata::ListGlossaryCategories( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListGlossaryCategories(context, options, request); +} + +StatusOr +BusinessGlossaryServiceMetadata::CreateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateGlossaryTerm(context, options, request); +} + +StatusOr +BusinessGlossaryServiceMetadata::UpdateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("term.name=", internal::UrlEncode(request.term().name()))); + return child_->UpdateGlossaryTerm(context, options, request); +} + +Status BusinessGlossaryServiceMetadata::DeleteGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteGlossaryTerm(context, options, request); +} + +StatusOr +BusinessGlossaryServiceMetadata::GetGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetGlossaryTerm(context, options, request); +} + +StatusOr +BusinessGlossaryServiceMetadata::ListGlossaryTerms( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryTermsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListGlossaryTerms(context, options, request); +} + +StatusOr +BusinessGlossaryServiceMetadata::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 +BusinessGlossaryServiceMetadata::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 BusinessGlossaryServiceMetadata::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("resource=", internal::UrlEncode(request.resource()))); + return child_->SetIamPolicy(context, options, request); +} + +StatusOr BusinessGlossaryServiceMetadata::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("resource=", internal::UrlEncode(request.resource()))); + return child_->GetIamPolicy(context, options, request); +} + +StatusOr +BusinessGlossaryServiceMetadata::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("resource=", internal::UrlEncode(request.resource()))); + return child_->TestIamPermissions(context, options, request); +} + +StatusOr +BusinessGlossaryServiceMetadata::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 +BusinessGlossaryServiceMetadata::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 BusinessGlossaryServiceMetadata::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 BusinessGlossaryServiceMetadata::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> +BusinessGlossaryServiceMetadata::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 BusinessGlossaryServiceMetadata::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 BusinessGlossaryServiceMetadata::SetMetadata( + grpc::ClientContext& context, Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void BusinessGlossaryServiceMetadata::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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/business_glossary_metadata_decorator.h b/google/cloud/dataplex/v1/internal/business_glossary_metadata_decorator.h new file mode 100644 index 0000000000000..579a32ee4b45d --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_metadata_decorator.h @@ -0,0 +1,209 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_METADATA_DECORATOR_H + +#include "google/cloud/dataplex/v1/internal/business_glossary_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class BusinessGlossaryServiceMetadata : public BusinessGlossaryServiceStub { + public: + ~BusinessGlossaryServiceMetadata() override = default; + BusinessGlossaryServiceMetadata( + std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + future> AsyncCreateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + StatusOr CreateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + future> AsyncUpdateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + StatusOr UpdateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + future> AsyncDeleteGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) + override; + + StatusOr DeleteGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) + override; + + StatusOr GetGlossary( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryRequest const& request) override; + + StatusOr ListGlossaries( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossariesRequest const& request) + override; + + StatusOr + CreateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) + override; + + StatusOr + UpdateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) + override; + + Status DeleteGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) + override; + + StatusOr GetGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) + override; + + StatusOr + ListGlossaryCategories( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest const& request) + override; + + StatusOr CreateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) + override; + + StatusOr UpdateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) + override; + + Status DeleteGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) + override; + + StatusOr GetGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) + override; + + StatusOr + ListGlossaryTerms(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryTermsRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_METADATA_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/business_glossary_option_defaults.cc b/google/cloud/dataplex/v1/internal/business_glossary_option_defaults.cc new file mode 100644 index 0000000000000..d1b5383d52853 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_option_defaults.cc @@ -0,0 +1,83 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#include "google/cloud/dataplex/v1/internal/business_glossary_option_defaults.h" +#include "google/cloud/dataplex/v1/business_glossary_connection.h" +#include "google/cloud/dataplex/v1/business_glossary_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 dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options BusinessGlossaryServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_BUSINESS_GLOSSARY_SERVICE_ENDPOINT", + "", "GOOGLE_CLOUD_CPP_BUSINESS_GLOSSARY_SERVICE_AUTHORITY", + "dataplex.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + dataplex_v1::BusinessGlossaryServiceLimitedTimeRetryPolicy( + std::chrono::minutes(10)) + .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< + dataplex_v1::BusinessGlossaryServiceRetryPolicyOption::Type, + dataplex_v1::BusinessGlossaryServiceBackoffPolicyOption::Type>( + options + .get() + ->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } + if (!options.has< + dataplex_v1:: + BusinessGlossaryServiceConnectionIdempotencyPolicyOption>()) { + options.set< + dataplex_v1::BusinessGlossaryServiceConnectionIdempotencyPolicyOption>( + dataplex_v1:: + MakeDefaultBusinessGlossaryServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/internal/business_glossary_option_defaults.h b/google/cloud/dataplex/v1/internal/business_glossary_option_defaults.h new file mode 100644 index 0000000000000..99512db06d4f8 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options BusinessGlossaryServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_OPTION_DEFAULTS_H diff --git a/google/cloud/dataplex/v1/internal/business_glossary_retry_traits.h b/google/cloud/dataplex/v1/internal/business_glossary_retry_traits.h new file mode 100644 index 0000000000000..496de8979bc76 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct BusinessGlossaryServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_RETRY_TRAITS_H diff --git a/google/cloud/dataplex/v1/internal/business_glossary_sources.cc b/google/cloud/dataplex/v1/internal/business_glossary_sources.cc new file mode 100644 index 0000000000000..b2edd58ce5728 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/dataplex/v1/business_glossary_client.cc" +#include "google/cloud/dataplex/v1/business_glossary_connection.cc" +#include "google/cloud/dataplex/v1/business_glossary_connection_idempotency_policy.cc" +#include "google/cloud/dataplex/v1/internal/business_glossary_auth_decorator.cc" +#include "google/cloud/dataplex/v1/internal/business_glossary_connection_impl.cc" +#include "google/cloud/dataplex/v1/internal/business_glossary_logging_decorator.cc" +#include "google/cloud/dataplex/v1/internal/business_glossary_metadata_decorator.cc" +#include "google/cloud/dataplex/v1/internal/business_glossary_option_defaults.cc" +#include "google/cloud/dataplex/v1/internal/business_glossary_stub.cc" +#include "google/cloud/dataplex/v1/internal/business_glossary_stub_factory.cc" +#include "google/cloud/dataplex/v1/internal/business_glossary_tracing_connection.cc" +#include "google/cloud/dataplex/v1/internal/business_glossary_tracing_stub.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/dataplex/v1/internal/business_glossary_stub.cc b/google/cloud/dataplex/v1/internal/business_glossary_stub.cc new file mode 100644 index 0000000000000..c7796026b67fb --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_stub.cc @@ -0,0 +1,424 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#include "google/cloud/dataplex/v1/internal/business_glossary_stub.h" +#include "google/cloud/dataplex/v1/business_glossary.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +BusinessGlossaryServiceStub::~BusinessGlossaryServiceStub() = default; + +future> +DefaultBusinessGlossaryServiceStub::AsyncCreateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::CreateGlossaryRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateGlossary(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultBusinessGlossaryServiceStub::CreateGlossary( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateGlossary(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultBusinessGlossaryServiceStub::AsyncUpdateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::UpdateGlossaryRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateGlossary(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultBusinessGlossaryServiceStub::UpdateGlossary( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateGlossary(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultBusinessGlossaryServiceStub::AsyncDeleteGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::DeleteGlossaryRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteGlossary(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultBusinessGlossaryServiceStub::DeleteGlossary( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteGlossary(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultBusinessGlossaryServiceStub::GetGlossary( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::GetGlossaryRequest const& request) { + google::cloud::dataplex::v1::Glossary response; + auto status = grpc_stub_->GetGlossary(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultBusinessGlossaryServiceStub::ListGlossaries( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::ListGlossariesRequest const& request) { + google::cloud::dataplex::v1::ListGlossariesResponse response; + auto status = grpc_stub_->ListGlossaries(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultBusinessGlossaryServiceStub::CreateGlossaryCategory( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) { + google::cloud::dataplex::v1::GlossaryCategory response; + auto status = + grpc_stub_->CreateGlossaryCategory(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultBusinessGlossaryServiceStub::UpdateGlossaryCategory( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) { + google::cloud::dataplex::v1::GlossaryCategory response; + auto status = + grpc_stub_->UpdateGlossaryCategory(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultBusinessGlossaryServiceStub::DeleteGlossaryCategory( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) { + google::protobuf::Empty response; + auto status = + grpc_stub_->DeleteGlossaryCategory(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +StatusOr +DefaultBusinessGlossaryServiceStub::GetGlossaryCategory( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) { + google::cloud::dataplex::v1::GlossaryCategory response; + auto status = grpc_stub_->GetGlossaryCategory(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultBusinessGlossaryServiceStub::ListGlossaryCategories( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest const& request) { + google::cloud::dataplex::v1::ListGlossaryCategoriesResponse response; + auto status = + grpc_stub_->ListGlossaryCategories(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultBusinessGlossaryServiceStub::CreateGlossaryTerm( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) { + google::cloud::dataplex::v1::GlossaryTerm response; + auto status = grpc_stub_->CreateGlossaryTerm(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultBusinessGlossaryServiceStub::UpdateGlossaryTerm( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) { + google::cloud::dataplex::v1::GlossaryTerm response; + auto status = grpc_stub_->UpdateGlossaryTerm(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultBusinessGlossaryServiceStub::DeleteGlossaryTerm( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteGlossaryTerm(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +StatusOr +DefaultBusinessGlossaryServiceStub::GetGlossaryTerm( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) { + google::cloud::dataplex::v1::GlossaryTerm response; + auto status = grpc_stub_->GetGlossaryTerm(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultBusinessGlossaryServiceStub::ListGlossaryTerms( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::ListGlossaryTermsRequest const& request) { + google::cloud::dataplex::v1::ListGlossaryTermsResponse response; + auto status = grpc_stub_->ListGlossaryTerms(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultBusinessGlossaryServiceStub::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 +DefaultBusinessGlossaryServiceStub::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 +DefaultBusinessGlossaryServiceStub::SetIamPolicy( + grpc::ClientContext& context, Options const&, + google::iam::v1::SetIamPolicyRequest const& request) { + google::iam::v1::Policy response; + auto status = iampolicy_stub_->SetIamPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultBusinessGlossaryServiceStub::GetIamPolicy( + grpc::ClientContext& context, Options const&, + google::iam::v1::GetIamPolicyRequest const& request) { + google::iam::v1::Policy response; + auto status = iampolicy_stub_->GetIamPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultBusinessGlossaryServiceStub::TestIamPermissions( + grpc::ClientContext& context, Options const&, + google::iam::v1::TestIamPermissionsRequest const& request) { + google::iam::v1::TestIamPermissionsResponse response; + auto status = + iampolicy_stub_->TestIamPermissions(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultBusinessGlossaryServiceStub::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 +DefaultBusinessGlossaryServiceStub::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 DefaultBusinessGlossaryServiceStub::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 DefaultBusinessGlossaryServiceStub::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> +DefaultBusinessGlossaryServiceStub::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 DefaultBusinessGlossaryServiceStub::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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/business_glossary_stub.h b/google/cloud/dataplex/v1/internal/business_glossary_stub.h new file mode 100644 index 0000000000000..09b877e18f162 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_stub.h @@ -0,0 +1,371 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_STUB_H + +#include "google/cloud/dataplex/v1/business_glossary.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.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 "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class BusinessGlossaryServiceStub { + public: + virtual ~BusinessGlossaryServiceStub() = 0; + + virtual future> AsyncCreateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) = 0; + + virtual StatusOr CreateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) = 0; + + virtual future> AsyncUpdateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) = 0; + + virtual StatusOr UpdateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) = 0; + + virtual future> AsyncDeleteGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) = 0; + + virtual StatusOr DeleteGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) = 0; + + virtual StatusOr GetGlossary( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryRequest const& request) = 0; + + virtual StatusOr + ListGlossaries( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossariesRequest const& request) = 0; + + virtual StatusOr + CreateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& + request) = 0; + + virtual StatusOr + UpdateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& + request) = 0; + + virtual Status DeleteGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& + request) = 0; + + virtual StatusOr + GetGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& + request) = 0; + + virtual StatusOr + ListGlossaryCategories( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest const& + request) = 0; + + virtual StatusOr + CreateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& + request) = 0; + + virtual StatusOr + UpdateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& + request) = 0; + + virtual Status DeleteGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& + request) = 0; + + virtual StatusOr GetGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) = 0; + + virtual StatusOr + ListGlossaryTerms( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryTermsRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) = 0; + + virtual StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) = 0; + + virtual StatusOr + TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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 DefaultBusinessGlossaryServiceStub : public BusinessGlossaryServiceStub { + public: + DefaultBusinessGlossaryServiceStub( + std::unique_ptr< + google::cloud::dataplex::v1::BusinessGlossaryService::StubInterface> + grpc_stub, + std::unique_ptr iampolicy_stub, + std::unique_ptr + locations_stub, + std::unique_ptr + operations_stub) + : grpc_stub_(std::move(grpc_stub)), + iampolicy_stub_(std::move(iampolicy_stub)), + locations_stub_(std::move(locations_stub)), + operations_stub_(std::move(operations_stub)) {} + + future> AsyncCreateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + StatusOr CreateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + future> AsyncUpdateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + StatusOr UpdateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + future> AsyncDeleteGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) + override; + + StatusOr DeleteGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) + override; + + StatusOr GetGlossary( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryRequest const& request) override; + + StatusOr ListGlossaries( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossariesRequest const& request) + override; + + StatusOr + CreateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) + override; + + StatusOr + UpdateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) + override; + + Status DeleteGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) + override; + + StatusOr GetGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) + override; + + StatusOr + ListGlossaryCategories( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest const& request) + override; + + StatusOr CreateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) + override; + + StatusOr UpdateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) + override; + + Status DeleteGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) + override; + + StatusOr GetGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) + override; + + StatusOr + ListGlossaryTerms(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryTermsRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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::dataplex::v1::BusinessGlossaryService::StubInterface> + grpc_stub_; + std::unique_ptr iampolicy_stub_; + std::unique_ptr + locations_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_STUB_H diff --git a/google/cloud/dataplex/v1/internal/business_glossary_stub_factory.cc b/google/cloud/dataplex/v1/internal/business_glossary_stub_factory.cc new file mode 100644 index 0000000000000..9410b5286baaa --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_stub_factory.cc @@ -0,0 +1,86 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#include "google/cloud/dataplex/v1/internal/business_glossary_stub_factory.h" +#include "google/cloud/dataplex/v1/business_glossary.grpc.pb.h" +#include "google/cloud/dataplex/v1/internal/business_glossary_auth_decorator.h" +#include "google/cloud/dataplex/v1/internal/business_glossary_logging_decorator.h" +#include "google/cloud/dataplex/v1/internal/business_glossary_metadata_decorator.h" +#include "google/cloud/dataplex/v1/internal/business_glossary_stub.h" +#include "google/cloud/dataplex/v1/internal/business_glossary_tracing_stub.h" +#include "google/cloud/location/locations.grpc.pb.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 "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr +CreateDefaultBusinessGlossaryServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::dataplex::v1::BusinessGlossaryService::NewStub(channel); + auto service_iampolicy_stub = google::iam::v1::IAMPolicy::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_iampolicy_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 = MakeBusinessGlossaryServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/business_glossary_stub_factory.h b/google/cloud/dataplex/v1/internal/business_glossary_stub_factory.h new file mode 100644 index 0000000000000..40e566dd0e139 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_stub_factory.h @@ -0,0 +1,48 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_STUB_FACTORY_H + +#include "google/cloud/dataplex/v1/internal/business_glossary_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr +CreateDefaultBusinessGlossaryServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_STUB_FACTORY_H diff --git a/google/cloud/dataplex/v1/internal/business_glossary_tracing_connection.cc b/google/cloud/dataplex/v1/internal/business_glossary_tracing_connection.cc new file mode 100644 index 0000000000000..31e43fdbb7900 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_tracing_connection.cc @@ -0,0 +1,332 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#include "google/cloud/dataplex/v1/internal/business_glossary_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +BusinessGlossaryServiceTracingConnection:: + BusinessGlossaryServiceTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +future> +BusinessGlossaryServiceTracingConnection::CreateGlossary( + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::CreateGlossary"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateGlossary(request)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::CreateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::CreateGlossary"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateGlossary(NoAwaitTag{}, request)); +} + +future> +BusinessGlossaryServiceTracingConnection::CreateGlossary( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::CreateGlossary"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateGlossary(operation)); +} + +future> +BusinessGlossaryServiceTracingConnection::UpdateGlossary( + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::UpdateGlossary"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateGlossary(request)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::UpdateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::UpdateGlossary"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateGlossary(NoAwaitTag{}, request)); +} + +future> +BusinessGlossaryServiceTracingConnection::UpdateGlossary( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::UpdateGlossary"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateGlossary(operation)); +} + +future> +BusinessGlossaryServiceTracingConnection::DeleteGlossary( + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::DeleteGlossary"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteGlossary(request)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::DeleteGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::DeleteGlossary"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteGlossary(NoAwaitTag{}, request)); +} + +future> +BusinessGlossaryServiceTracingConnection::DeleteGlossary( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::DeleteGlossary"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteGlossary(operation)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::GetGlossary( + google::cloud::dataplex::v1::GetGlossaryRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::GetGlossary"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetGlossary(request)); +} + +StreamRange +BusinessGlossaryServiceTracingConnection::ListGlossaries( + google::cloud::dataplex::v1::ListGlossariesRequest request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::ListGlossaries"); + internal::OTelScope scope(span); + auto sr = child_->ListGlossaries(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::CreateGlossaryCategory( + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::CreateGlossaryCategory"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateGlossaryCategory(request)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::UpdateGlossaryCategory( + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::UpdateGlossaryCategory"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateGlossaryCategory(request)); +} + +Status BusinessGlossaryServiceTracingConnection::DeleteGlossaryCategory( + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::DeleteGlossaryCategory"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteGlossaryCategory(request)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::GetGlossaryCategory( + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::GetGlossaryCategory"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetGlossaryCategory(request)); +} + +StreamRange +BusinessGlossaryServiceTracingConnection::ListGlossaryCategories( + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::ListGlossaryCategories"); + internal::OTelScope scope(span); + auto sr = child_->ListGlossaryCategories(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::dataplex::v1::GlossaryCategory>(std::move(span), + std::move(sr)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::CreateGlossaryTerm( + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::CreateGlossaryTerm"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateGlossaryTerm(request)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::UpdateGlossaryTerm( + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::UpdateGlossaryTerm"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateGlossaryTerm(request)); +} + +Status BusinessGlossaryServiceTracingConnection::DeleteGlossaryTerm( + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::DeleteGlossaryTerm"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteGlossaryTerm(request)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::GetGlossaryTerm( + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::GetGlossaryTerm"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetGlossaryTerm(request)); +} + +StreamRange +BusinessGlossaryServiceTracingConnection::ListGlossaryTerms( + google::cloud::dataplex::v1::ListGlossaryTermsRequest request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::ListGlossaryTerms"); + internal::OTelScope scope(span); + auto sr = child_->ListGlossaryTerms(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::dataplex::v1::GlossaryTerm>(std::move(span), + std::move(sr)); +} + +StreamRange +BusinessGlossaryServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::SetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->SetIamPolicy(request)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::GetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetIamPolicy(request)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::TestIamPermissions"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->TestIamPermissions(request)); +} + +StreamRange +BusinessGlossaryServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +BusinessGlossaryServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status BusinessGlossaryServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status BusinessGlossaryServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::BusinessGlossaryServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeBusinessGlossaryServiceTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared( + std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/internal/business_glossary_tracing_connection.h b/google/cloud/dataplex/v1/internal/business_glossary_tracing_connection.h new file mode 100644 index 0000000000000..08dccace80c1a --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_tracing_connection.h @@ -0,0 +1,171 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_TRACING_CONNECTION_H + +#include "google/cloud/dataplex/v1/business_glossary_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class BusinessGlossaryServiceTracingConnection + : public dataplex_v1::BusinessGlossaryServiceConnection { + public: + ~BusinessGlossaryServiceTracingConnection() override = default; + + explicit BusinessGlossaryServiceTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + future> CreateGlossary( + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + StatusOr CreateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + future> CreateGlossary( + google::longrunning::Operation const& operation) override; + + future> UpdateGlossary( + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + StatusOr UpdateGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + future> UpdateGlossary( + google::longrunning::Operation const& operation) override; + + future> + DeleteGlossary(google::cloud::dataplex::v1::DeleteGlossaryRequest const& + request) override; + + StatusOr DeleteGlossary( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) + override; + + future> + DeleteGlossary(google::longrunning::Operation const& operation) override; + + StatusOr GetGlossary( + google::cloud::dataplex::v1::GetGlossaryRequest const& request) override; + + StreamRange ListGlossaries( + google::cloud::dataplex::v1::ListGlossariesRequest request) override; + + StatusOr + CreateGlossaryCategory( + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) + override; + + StatusOr + UpdateGlossaryCategory( + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) + override; + + Status DeleteGlossaryCategory( + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) + override; + + StatusOr GetGlossaryCategory( + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) + override; + + StreamRange + ListGlossaryCategories( + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest request) + override; + + StatusOr CreateGlossaryTerm( + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) + override; + + StatusOr UpdateGlossaryTerm( + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) + override; + + Status DeleteGlossaryTerm( + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) + override; + + StatusOr GetGlossaryTerm( + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) + override; + + StreamRange ListGlossaryTerms( + google::cloud::dataplex::v1::ListGlossaryTermsRequest request) override; + + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request) override; + + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest 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_; +}; + +/** + * 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 +MakeBusinessGlossaryServiceTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_TRACING_CONNECTION_H diff --git a/google/cloud/dataplex/v1/internal/business_glossary_tracing_stub.cc b/google/cloud/dataplex/v1/internal/business_glossary_tracing_stub.cc new file mode 100644 index 0000000000000..5aa1c5c997cfa --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_tracing_stub.cc @@ -0,0 +1,413 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#include "google/cloud/dataplex/v1/internal/business_glossary_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +BusinessGlossaryServiceTracingStub::BusinessGlossaryServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +future> +BusinessGlossaryServiceTracingStub::AsyncCreateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "CreateGlossary"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateGlossary(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::CreateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "CreateGlossary"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateGlossary(context, options, request)); +} + +future> +BusinessGlossaryServiceTracingStub::AsyncUpdateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "UpdateGlossary"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateGlossary(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::UpdateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "UpdateGlossary"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateGlossary(context, options, request)); +} + +future> +BusinessGlossaryServiceTracingStub::AsyncDeleteGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "DeleteGlossary"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteGlossary(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::DeleteGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "DeleteGlossary"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteGlossary(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::GetGlossary( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "GetGlossary"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetGlossary(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::ListGlossaries( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossariesRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "ListGlossaries"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListGlossaries(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::CreateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.dataplex.v1.BusinessGlossaryService", + "CreateGlossaryCategory"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->CreateGlossaryCategory(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::UpdateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.dataplex.v1.BusinessGlossaryService", + "UpdateGlossaryCategory"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->UpdateGlossaryCategory(context, options, request)); +} + +Status BusinessGlossaryServiceTracingStub::DeleteGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.dataplex.v1.BusinessGlossaryService", + "DeleteGlossaryCategory"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->DeleteGlossaryCategory(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::GetGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.dataplex.v1.BusinessGlossaryService", + "GetGlossaryCategory"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->GetGlossaryCategory(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::ListGlossaryCategories( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.dataplex.v1.BusinessGlossaryService", + "ListGlossaryCategories"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ListGlossaryCategories(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::CreateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "CreateGlossaryTerm"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->CreateGlossaryTerm(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::UpdateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "UpdateGlossaryTerm"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UpdateGlossaryTerm(context, options, request)); +} + +Status BusinessGlossaryServiceTracingStub::DeleteGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "DeleteGlossaryTerm"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteGlossaryTerm(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::GetGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "GetGlossaryTerm"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetGlossaryTerm(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::ListGlossaryTerms( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryTermsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "ListGlossaryTerms"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListGlossaryTerms(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "SetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->SetIamPolicy(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "GetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetIamPolicy(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "TestIamPermissions"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->TestIamPermissions(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +BusinessGlossaryServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status BusinessGlossaryServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status BusinessGlossaryServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.BusinessGlossaryService", "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +BusinessGlossaryServiceTracingStub::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 BusinessGlossaryServiceTracingStub::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)); +} + +std::shared_ptr +MakeBusinessGlossaryServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/business_glossary_tracing_stub.h b/google/cloud/dataplex/v1/internal/business_glossary_tracing_stub.h new file mode 100644 index 0000000000000..de10b8d586db2 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/business_glossary_tracing_stub.h @@ -0,0 +1,212 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_TRACING_STUB_H + +#include "google/cloud/dataplex/v1/internal/business_glossary_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class BusinessGlossaryServiceTracingStub : public BusinessGlossaryServiceStub { + public: + ~BusinessGlossaryServiceTracingStub() override = default; + + explicit BusinessGlossaryServiceTracingStub( + std::shared_ptr child); + + future> AsyncCreateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + StatusOr CreateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request) + override; + + future> AsyncUpdateGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + StatusOr UpdateGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request) + override; + + future> AsyncDeleteGlossary( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) + override; + + StatusOr DeleteGlossary( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request) + override; + + StatusOr GetGlossary( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryRequest const& request) override; + + StatusOr ListGlossaries( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossariesRequest const& request) + override; + + StatusOr + CreateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& request) + override; + + StatusOr + UpdateGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& request) + override; + + Status DeleteGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& request) + override; + + StatusOr GetGlossaryCategory( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request) + override; + + StatusOr + ListGlossaryCategories( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryCategoriesRequest const& request) + override; + + StatusOr CreateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request) + override; + + StatusOr UpdateGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request) + override; + + Status DeleteGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request) + override; + + StatusOr GetGlossaryTerm( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetGlossaryTermRequest const& request) + override; + + StatusOr + ListGlossaryTerms(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListGlossaryTermsRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr +MakeBusinessGlossaryServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_BUSINESS_GLOSSARY_TRACING_STUB_H diff --git a/google/cloud/dataplex/v1/internal/catalog_auth_decorator.cc b/google/cloud/dataplex/v1/internal/catalog_auth_decorator.cc index 8fc912aa4437b..26ec8e02f47e6 100644 --- a/google/cloud/dataplex/v1/internal/catalog_auth_decorator.cc +++ b/google/cloud/dataplex/v1/internal/catalog_auth_decorator.cc @@ -461,6 +461,15 @@ CatalogServiceAuth::CreateEntryLink( return child_->CreateEntryLink(context, options, request); } +StatusOr +CatalogServiceAuth::UpdateEntryLink( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateEntryLink(context, options, request); +} + StatusOr CatalogServiceAuth::DeleteEntryLink( grpc::ClientContext& context, Options const& options, @@ -470,6 +479,24 @@ CatalogServiceAuth::DeleteEntryLink( return child_->DeleteEntryLink(context, options, request); } +StatusOr +CatalogServiceAuth::LookupEntryLinks( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupEntryLinksRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->LookupEntryLinks(context, options, request); +} + +StatusOr +CatalogServiceAuth::LookupContext( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupContextRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->LookupContext(context, options, request); +} + StatusOr CatalogServiceAuth::GetEntryLink( grpc::ClientContext& context, Options const& options, @@ -479,6 +506,108 @@ CatalogServiceAuth::GetEntryLink( return child_->GetEntryLink(context, options, request); } +future> +CatalogServiceAuth::AsyncCreateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest 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->AsyncCreateMetadataFeed(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr CatalogServiceAuth::CreateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateMetadataFeed(context, options, request); +} + +StatusOr +CatalogServiceAuth::GetMetadataFeed( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetMetadataFeed(context, options, request); +} + +StatusOr +CatalogServiceAuth::ListMetadataFeeds( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListMetadataFeedsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListMetadataFeeds(context, options, request); +} + +future> +CatalogServiceAuth::AsyncDeleteMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest 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->AsyncDeleteMetadataFeed(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr CatalogServiceAuth::DeleteMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteMetadataFeed(context, options, request); +} + +future> +CatalogServiceAuth::AsyncUpdateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest 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->AsyncUpdateMetadataFeed(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr CatalogServiceAuth::UpdateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateMetadataFeed(context, options, request); +} + StatusOr CatalogServiceAuth::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/dataplex/v1/internal/catalog_auth_decorator.h b/google/cloud/dataplex/v1/internal/catalog_auth_decorator.h index 00da6b25a7879..e3343702e4d1c 100644 --- a/google/cloud/dataplex/v1/internal/catalog_auth_decorator.h +++ b/google/cloud/dataplex/v1/internal/catalog_auth_decorator.h @@ -240,15 +240,76 @@ class CatalogServiceAuth : public CatalogServiceStub { google::cloud::dataplex::v1::CreateEntryLinkRequest const& request) override; + StatusOr UpdateEntryLink( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) + override; + StatusOr DeleteEntryLink( grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request) override; + StatusOr + LookupEntryLinks(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupEntryLinksRequest const& + request) override; + + StatusOr LookupContext( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupContextRequest const& request) + override; + StatusOr GetEntryLink( grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::GetEntryLinkRequest const& request) override; + future> AsyncCreateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + StatusOr CreateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + StatusOr GetMetadataFeed( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) + override; + + StatusOr + ListMetadataFeeds(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListMetadataFeedsRequest const& + request) override; + + future> AsyncDeleteMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + StatusOr DeleteMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + future> AsyncUpdateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + + StatusOr UpdateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/dataplex/v1/internal/catalog_connection_impl.cc b/google/cloud/dataplex/v1/internal/catalog_connection_impl.cc index 329a1685b45fb..edbaf4b172235 100644 --- a/google/cloud/dataplex/v1/internal/catalog_connection_impl.cc +++ b/google/cloud/dataplex/v1/internal/catalog_connection_impl.cc @@ -1339,6 +1339,21 @@ CatalogServiceConnectionImpl::CreateEntryLink( *current, request, __func__); } +StatusOr +CatalogServiceConnectionImpl::UpdateEntryLink( + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateEntryLink(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) { + return stub_->UpdateEntryLink(context, options, request); + }, + *current, request, __func__); +} + StatusOr CatalogServiceConnectionImpl::DeleteEntryLink( google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request) { @@ -1354,6 +1369,54 @@ CatalogServiceConnectionImpl::DeleteEntryLink( *current, request, __func__); } +StreamRange +CatalogServiceConnectionImpl::LookupEntryLinks( + google::cloud::dataplex::v1::LookupEntryLinksRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->LookupEntryLinks(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::dataplex::v1::LookupEntryLinksRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupEntryLinksRequest const& + request) { + return stub->LookupEntryLinks(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::dataplex::v1::LookupEntryLinksResponse r) { + std::vector result( + r.entry_links().size()); + auto& messages = *r.mutable_entry_links(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +CatalogServiceConnectionImpl::LookupContext( + google::cloud::dataplex::v1::LookupContextRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->LookupContext(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupContextRequest const& request) { + return stub_->LookupContext(context, options, request); + }, + *current, request, __func__); +} + StatusOr CatalogServiceConnectionImpl::GetEntryLink( google::cloud::dataplex::v1::GetEntryLinkRequest const& request) { @@ -1368,6 +1431,334 @@ CatalogServiceConnectionImpl::GetEntryLink( *current, request, __func__); } +future> +CatalogServiceConnectionImpl::CreateMetadataFeed( + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateMetadataFeed(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::v1::MetadataFeed>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& + request) { + return stub->AsyncCreateMetadataFeed(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::dataplex::v1::MetadataFeed>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +CatalogServiceConnectionImpl::CreateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateMetadataFeed(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& + request) { + return stub_->CreateMetadataFeed(context, options, request); + }, + *current, request, __func__); +} + +future> +CatalogServiceConnectionImpl::CreateMetadataFeed( + 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 CreateMetadataFeed", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::v1::MetadataFeed>( + 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::dataplex::v1::MetadataFeed>, + polling_policy(*current), __func__); +} + +StatusOr +CatalogServiceConnectionImpl::GetMetadataFeed( + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetMetadataFeed(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) { + return stub_->GetMetadataFeed(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +CatalogServiceConnectionImpl::ListMetadataFeeds( + google::cloud::dataplex::v1::ListMetadataFeedsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListMetadataFeeds(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::dataplex::v1::ListMetadataFeedsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListMetadataFeedsRequest const& + request) { + return stub->ListMetadataFeeds(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::dataplex::v1::ListMetadataFeedsResponse r) { + std::vector result( + r.metadata_feeds().size()); + auto& messages = *r.mutable_metadata_feeds(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +future> +CatalogServiceConnectionImpl::DeleteMetadataFeed( + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteMetadataFeed(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::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::dataplex::v1::DeleteMetadataFeedRequest const& + request) { + return stub->AsyncDeleteMetadataFeed(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::dataplex::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +CatalogServiceConnectionImpl::DeleteMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteMetadataFeed(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& + request) { + return stub_->DeleteMetadataFeed(context, options, request); + }, + *current, request, __func__); +} + +future> +CatalogServiceConnectionImpl::DeleteMetadataFeed( + 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 DeleteMetadataFeed", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::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::dataplex::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +future> +CatalogServiceConnectionImpl::UpdateMetadataFeed( + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateMetadataFeed(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::v1::MetadataFeed>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& + request) { + return stub->AsyncUpdateMetadataFeed(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::dataplex::v1::MetadataFeed>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +CatalogServiceConnectionImpl::UpdateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateMetadataFeed(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& + request) { + return stub_->UpdateMetadataFeed(context, options, request); + }, + *current, request, __func__); +} + +future> +CatalogServiceConnectionImpl::UpdateMetadataFeed( + 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 UpdateMetadataFeed", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::v1::MetadataFeed>( + 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::dataplex::v1::MetadataFeed>, + polling_policy(*current), __func__); +} + StreamRange CatalogServiceConnectionImpl::ListLocations( google::cloud::location::ListLocationsRequest request) { diff --git a/google/cloud/dataplex/v1/internal/catalog_connection_impl.h b/google/cloud/dataplex/v1/internal/catalog_connection_impl.h index 7e950afa4ab68..9918050b5522f 100644 --- a/google/cloud/dataplex/v1/internal/catalog_connection_impl.h +++ b/google/cloud/dataplex/v1/internal/catalog_connection_impl.h @@ -228,13 +228,70 @@ class CatalogServiceConnectionImpl google::cloud::dataplex::v1::CreateEntryLinkRequest const& request) override; + StatusOr UpdateEntryLink( + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) + override; + StatusOr DeleteEntryLink( google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request) override; + StreamRange LookupEntryLinks( + google::cloud::dataplex::v1::LookupEntryLinksRequest request) override; + + StatusOr LookupContext( + google::cloud::dataplex::v1::LookupContextRequest const& request) + override; + StatusOr GetEntryLink( google::cloud::dataplex::v1::GetEntryLinkRequest const& request) override; + future> + CreateMetadataFeed( + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + StatusOr CreateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + future> + CreateMetadataFeed(google::longrunning::Operation const& operation) override; + + StatusOr GetMetadataFeed( + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) + override; + + StreamRange ListMetadataFeeds( + google::cloud::dataplex::v1::ListMetadataFeedsRequest request) override; + + future> + DeleteMetadataFeed( + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + StatusOr DeleteMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + future> + DeleteMetadataFeed(google::longrunning::Operation const& operation) override; + + future> + UpdateMetadataFeed( + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + + StatusOr UpdateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + + future> + UpdateMetadataFeed(google::longrunning::Operation const& operation) override; + StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; diff --git a/google/cloud/dataplex/v1/internal/catalog_logging_decorator.cc b/google/cloud/dataplex/v1/internal/catalog_logging_decorator.cc index 0faa4bd05d314..c33953d4fd0ae 100644 --- a/google/cloud/dataplex/v1/internal/catalog_logging_decorator.cc +++ b/google/cloud/dataplex/v1/internal/catalog_logging_decorator.cc @@ -560,6 +560,19 @@ CatalogServiceLogging::CreateEntryLink( context, options, request, __func__, tracing_options_); } +StatusOr +CatalogServiceLogging::UpdateEntryLink( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) { + return child_->UpdateEntryLink(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr CatalogServiceLogging::DeleteEntryLink( grpc::ClientContext& context, Options const& options, @@ -573,6 +586,31 @@ CatalogServiceLogging::DeleteEntryLink( context, options, request, __func__, tracing_options_); } +StatusOr +CatalogServiceLogging::LookupEntryLinks( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupEntryLinksRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupEntryLinksRequest const& request) { + return child_->LookupEntryLinks(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +CatalogServiceLogging::LookupContext( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupContextRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupContextRequest const& request) { + return child_->LookupContext(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr CatalogServiceLogging::GetEntryLink( grpc::ClientContext& context, Options const& options, @@ -585,6 +623,128 @@ CatalogServiceLogging::GetEntryLink( context, options, request, __func__, tracing_options_); } +future> +CatalogServiceLogging::AsyncCreateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& + request) { + return child_->AsyncCreateMetadataFeed(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +CatalogServiceLogging::CreateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& + request) { + return child_->CreateMetadataFeed(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +CatalogServiceLogging::GetMetadataFeed( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) { + return child_->GetMetadataFeed(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +CatalogServiceLogging::ListMetadataFeeds( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListMetadataFeedsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListMetadataFeedsRequest const& + request) { + return child_->ListMetadataFeeds(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +CatalogServiceLogging::AsyncDeleteMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& + request) { + return child_->AsyncDeleteMetadataFeed(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +CatalogServiceLogging::DeleteMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& + request) { + return child_->DeleteMetadataFeed(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +CatalogServiceLogging::AsyncUpdateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& + request) { + return child_->AsyncUpdateMetadataFeed(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +CatalogServiceLogging::UpdateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& + request) { + return child_->UpdateMetadataFeed(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr CatalogServiceLogging::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/dataplex/v1/internal/catalog_logging_decorator.h b/google/cloud/dataplex/v1/internal/catalog_logging_decorator.h index a425cb9d02a90..325cd2a0059d9 100644 --- a/google/cloud/dataplex/v1/internal/catalog_logging_decorator.h +++ b/google/cloud/dataplex/v1/internal/catalog_logging_decorator.h @@ -240,15 +240,76 @@ class CatalogServiceLogging : public CatalogServiceStub { google::cloud::dataplex::v1::CreateEntryLinkRequest const& request) override; + StatusOr UpdateEntryLink( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) + override; + StatusOr DeleteEntryLink( grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request) override; + StatusOr + LookupEntryLinks(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupEntryLinksRequest const& + request) override; + + StatusOr LookupContext( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupContextRequest const& request) + override; + StatusOr GetEntryLink( grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::GetEntryLinkRequest const& request) override; + future> AsyncCreateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + StatusOr CreateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + StatusOr GetMetadataFeed( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) + override; + + StatusOr + ListMetadataFeeds(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListMetadataFeedsRequest const& + request) override; + + future> AsyncDeleteMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + StatusOr DeleteMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + future> AsyncUpdateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + + StatusOr UpdateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.cc b/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.cc index 1916f4231e4a6..d8e3a9516b250 100644 --- a/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.cc +++ b/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.cc @@ -416,6 +416,16 @@ CatalogServiceMetadata::CreateEntryLink( return child_->CreateEntryLink(context, options, request); } +StatusOr +CatalogServiceMetadata::UpdateEntryLink( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) { + SetMetadata(context, options, + absl::StrCat("entry_link.name=", + internal::UrlEncode(request.entry_link().name()))); + return child_->UpdateEntryLink(context, options, request); +} + StatusOr CatalogServiceMetadata::DeleteEntryLink( grpc::ClientContext& context, Options const& options, @@ -425,6 +435,24 @@ CatalogServiceMetadata::DeleteEntryLink( return child_->DeleteEntryLink(context, options, request); } +StatusOr +CatalogServiceMetadata::LookupEntryLinks( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupEntryLinksRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->LookupEntryLinks(context, options, request); +} + +StatusOr +CatalogServiceMetadata::LookupContext( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupContextRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->LookupContext(context, options, request); +} + StatusOr CatalogServiceMetadata::GetEntryLink( grpc::ClientContext& context, Options const& options, @@ -434,6 +462,91 @@ CatalogServiceMetadata::GetEntryLink( return child_->GetEntryLink(context, options, request); } +future> +CatalogServiceMetadata::AsyncCreateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateMetadataFeed(cq, std::move(context), + std::move(options), request); +} + +StatusOr +CatalogServiceMetadata::CreateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateMetadataFeed(context, options, request); +} + +StatusOr +CatalogServiceMetadata::GetMetadataFeed( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetMetadataFeed(context, options, request); +} + +StatusOr +CatalogServiceMetadata::ListMetadataFeeds( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListMetadataFeedsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListMetadataFeeds(context, options, request); +} + +future> +CatalogServiceMetadata::AsyncDeleteMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteMetadataFeed(cq, std::move(context), + std::move(options), request); +} + +StatusOr +CatalogServiceMetadata::DeleteMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteMetadataFeed(context, options, request); +} + +future> +CatalogServiceMetadata::AsyncUpdateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) { + SetMetadata( + *context, *options, + absl::StrCat("metadata_feed.name=", + internal::UrlEncode(request.metadata_feed().name()))); + return child_->AsyncUpdateMetadataFeed(cq, std::move(context), + std::move(options), request); +} + +StatusOr +CatalogServiceMetadata::UpdateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("metadata_feed.name=", + internal::UrlEncode(request.metadata_feed().name()))); + return child_->UpdateMetadataFeed(context, options, request); +} + StatusOr CatalogServiceMetadata::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.h b/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.h index 331c466b18c79..28777d3e72550 100644 --- a/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.h +++ b/google/cloud/dataplex/v1/internal/catalog_metadata_decorator.h @@ -240,15 +240,76 @@ class CatalogServiceMetadata : public CatalogServiceStub { google::cloud::dataplex::v1::CreateEntryLinkRequest const& request) override; + StatusOr UpdateEntryLink( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) + override; + StatusOr DeleteEntryLink( grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request) override; + StatusOr + LookupEntryLinks(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupEntryLinksRequest const& + request) override; + + StatusOr LookupContext( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupContextRequest const& request) + override; + StatusOr GetEntryLink( grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::GetEntryLinkRequest const& request) override; + future> AsyncCreateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + StatusOr CreateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + StatusOr GetMetadataFeed( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) + override; + + StatusOr + ListMetadataFeeds(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListMetadataFeedsRequest const& + request) override; + + future> AsyncDeleteMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + StatusOr DeleteMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + future> AsyncUpdateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + + StatusOr UpdateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/dataplex/v1/internal/catalog_stub.cc b/google/cloud/dataplex/v1/internal/catalog_stub.cc index 4266e9939754f..0b12b6626e2fc 100644 --- a/google/cloud/dataplex/v1/internal/catalog_stub.cc +++ b/google/cloud/dataplex/v1/internal/catalog_stub.cc @@ -544,6 +544,18 @@ DefaultCatalogServiceStub::CreateEntryLink( return response; } +StatusOr +DefaultCatalogServiceStub::UpdateEntryLink( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) { + google::cloud::dataplex::v1::EntryLink response; + auto status = grpc_stub_->UpdateEntryLink(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultCatalogServiceStub::DeleteEntryLink( grpc::ClientContext& context, Options const&, @@ -556,6 +568,30 @@ DefaultCatalogServiceStub::DeleteEntryLink( return response; } +StatusOr +DefaultCatalogServiceStub::LookupEntryLinks( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::LookupEntryLinksRequest const& request) { + google::cloud::dataplex::v1::LookupEntryLinksResponse response; + auto status = grpc_stub_->LookupEntryLinks(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultCatalogServiceStub::LookupContext( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::LookupContextRequest const& request) { + google::cloud::dataplex::v1::LookupContextResponse response; + auto status = grpc_stub_->LookupContext(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultCatalogServiceStub::GetEntryLink( grpc::ClientContext& context, Options const&, @@ -568,6 +604,123 @@ DefaultCatalogServiceStub::GetEntryLink( return response; } +future> +DefaultCatalogServiceStub::AsyncCreateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::CreateMetadataFeedRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateMetadataFeed(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultCatalogServiceStub::CreateMetadataFeed( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateMetadataFeed(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultCatalogServiceStub::GetMetadataFeed( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) { + google::cloud::dataplex::v1::MetadataFeed response; + auto status = grpc_stub_->GetMetadataFeed(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultCatalogServiceStub::ListMetadataFeeds( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::ListMetadataFeedsRequest const& request) { + google::cloud::dataplex::v1::ListMetadataFeedsResponse response; + auto status = grpc_stub_->ListMetadataFeeds(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultCatalogServiceStub::AsyncDeleteMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::DeleteMetadataFeedRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteMetadataFeed(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultCatalogServiceStub::DeleteMetadataFeed( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteMetadataFeed(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultCatalogServiceStub::AsyncUpdateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::UpdateMetadataFeedRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateMetadataFeed(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultCatalogServiceStub::UpdateMetadataFeed( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateMetadataFeed(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultCatalogServiceStub::ListLocations( grpc::ClientContext& context, Options const&, diff --git a/google/cloud/dataplex/v1/internal/catalog_stub.h b/google/cloud/dataplex/v1/internal/catalog_stub.h index 583312999000c..1f6d1de0a9c27 100644 --- a/google/cloud/dataplex/v1/internal/catalog_stub.h +++ b/google/cloud/dataplex/v1/internal/catalog_stub.h @@ -224,14 +224,76 @@ class CatalogServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::CreateEntryLinkRequest const& request) = 0; + virtual StatusOr UpdateEntryLink( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) = 0; + virtual StatusOr DeleteEntryLink( grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request) = 0; + virtual StatusOr + LookupEntryLinks( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupEntryLinksRequest const& request) = 0; + + virtual StatusOr + LookupContext( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupContextRequest const& request) = 0; + virtual StatusOr GetEntryLink( grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::GetEntryLinkRequest const& request) = 0; + virtual future> + AsyncCreateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& + request) = 0; + + virtual StatusOr CreateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& + request) = 0; + + virtual StatusOr GetMetadataFeed( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) = 0; + + virtual StatusOr + ListMetadataFeeds( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListMetadataFeedsRequest const& request) = 0; + + virtual future> + AsyncDeleteMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& + request) = 0; + + virtual StatusOr DeleteMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& + request) = 0; + + virtual future> + AsyncUpdateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& + request) = 0; + + virtual StatusOr UpdateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& + request) = 0; + virtual StatusOr ListLocations( grpc::ClientContext& context, Options const& options, @@ -497,15 +559,76 @@ class DefaultCatalogServiceStub : public CatalogServiceStub { google::cloud::dataplex::v1::CreateEntryLinkRequest const& request) override; + StatusOr UpdateEntryLink( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) + override; + StatusOr DeleteEntryLink( grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request) override; + StatusOr + LookupEntryLinks(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupEntryLinksRequest const& + request) override; + + StatusOr LookupContext( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupContextRequest const& request) + override; + StatusOr GetEntryLink( grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::GetEntryLinkRequest const& request) override; + future> AsyncCreateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + StatusOr CreateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + StatusOr GetMetadataFeed( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) + override; + + StatusOr + ListMetadataFeeds(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListMetadataFeedsRequest const& + request) override; + + future> AsyncDeleteMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + StatusOr DeleteMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + future> AsyncUpdateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + + StatusOr UpdateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/dataplex/v1/internal/catalog_tracing_connection.cc b/google/cloud/dataplex/v1/internal/catalog_tracing_connection.cc index 47339903c3fea..a9930abb7e214 100644 --- a/google/cloud/dataplex/v1/internal/catalog_tracing_connection.cc +++ b/google/cloud/dataplex/v1/internal/catalog_tracing_connection.cc @@ -493,6 +493,15 @@ CatalogServiceTracingConnection::CreateEntryLink( return internal::EndSpan(*span, child_->CreateEntryLink(request)); } +StatusOr +CatalogServiceTracingConnection::UpdateEntryLink( + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::UpdateEntryLink"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateEntryLink(request)); +} + StatusOr CatalogServiceTracingConnection::DeleteEntryLink( google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request) { @@ -502,6 +511,26 @@ CatalogServiceTracingConnection::DeleteEntryLink( return internal::EndSpan(*span, child_->DeleteEntryLink(request)); } +StreamRange +CatalogServiceTracingConnection::LookupEntryLinks( + google::cloud::dataplex::v1::LookupEntryLinksRequest request) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::LookupEntryLinks"); + internal::OTelScope scope(span); + auto sr = child_->LookupEntryLinks(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::dataplex::v1::EntryLink>(std::move(span), std::move(sr)); +} + +StatusOr +CatalogServiceTracingConnection::LookupContext( + google::cloud::dataplex::v1::LookupContextRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::LookupContext"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->LookupContext(request)); +} + StatusOr CatalogServiceTracingConnection::GetEntryLink( google::cloud::dataplex::v1::GetEntryLinkRequest const& request) { @@ -511,6 +540,120 @@ CatalogServiceTracingConnection::GetEntryLink( return internal::EndSpan(*span, child_->GetEntryLink(request)); } +future> +CatalogServiceTracingConnection::CreateMetadataFeed( + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::CreateMetadataFeed"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateMetadataFeed(request)); +} + +StatusOr +CatalogServiceTracingConnection::CreateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::CreateMetadataFeed"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateMetadataFeed(NoAwaitTag{}, request)); +} + +future> +CatalogServiceTracingConnection::CreateMetadataFeed( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::CreateMetadataFeed"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateMetadataFeed(operation)); +} + +StatusOr +CatalogServiceTracingConnection::GetMetadataFeed( + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::GetMetadataFeed"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetMetadataFeed(request)); +} + +StreamRange +CatalogServiceTracingConnection::ListMetadataFeeds( + google::cloud::dataplex::v1::ListMetadataFeedsRequest request) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::ListMetadataFeeds"); + internal::OTelScope scope(span); + auto sr = child_->ListMetadataFeeds(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::dataplex::v1::MetadataFeed>(std::move(span), + std::move(sr)); +} + +future> +CatalogServiceTracingConnection::DeleteMetadataFeed( + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::DeleteMetadataFeed"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteMetadataFeed(request)); +} + +StatusOr +CatalogServiceTracingConnection::DeleteMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::DeleteMetadataFeed"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteMetadataFeed(NoAwaitTag{}, request)); +} + +future> +CatalogServiceTracingConnection::DeleteMetadataFeed( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::DeleteMetadataFeed"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteMetadataFeed(operation)); +} + +future> +CatalogServiceTracingConnection::UpdateMetadataFeed( + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::UpdateMetadataFeed"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateMetadataFeed(request)); +} + +StatusOr +CatalogServiceTracingConnection::UpdateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::UpdateMetadataFeed"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateMetadataFeed(NoAwaitTag{}, request)); +} + +future> +CatalogServiceTracingConnection::UpdateMetadataFeed( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::CatalogServiceConnection::UpdateMetadataFeed"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateMetadataFeed(operation)); +} + StreamRange CatalogServiceTracingConnection::ListLocations( google::cloud::location::ListLocationsRequest request) { diff --git a/google/cloud/dataplex/v1/internal/catalog_tracing_connection.h b/google/cloud/dataplex/v1/internal/catalog_tracing_connection.h index 96b35191dcf98..fa4b8f88dece3 100644 --- a/google/cloud/dataplex/v1/internal/catalog_tracing_connection.h +++ b/google/cloud/dataplex/v1/internal/catalog_tracing_connection.h @@ -214,13 +214,70 @@ class CatalogServiceTracingConnection google::cloud::dataplex::v1::CreateEntryLinkRequest const& request) override; + StatusOr UpdateEntryLink( + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) + override; + StatusOr DeleteEntryLink( google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request) override; + StreamRange LookupEntryLinks( + google::cloud::dataplex::v1::LookupEntryLinksRequest request) override; + + StatusOr LookupContext( + google::cloud::dataplex::v1::LookupContextRequest const& request) + override; + StatusOr GetEntryLink( google::cloud::dataplex::v1::GetEntryLinkRequest const& request) override; + future> + CreateMetadataFeed( + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + StatusOr CreateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + future> + CreateMetadataFeed(google::longrunning::Operation const& operation) override; + + StatusOr GetMetadataFeed( + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) + override; + + StreamRange ListMetadataFeeds( + google::cloud::dataplex::v1::ListMetadataFeedsRequest request) override; + + future> + DeleteMetadataFeed( + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + StatusOr DeleteMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + future> + DeleteMetadataFeed(google::longrunning::Operation const& operation) override; + + future> + UpdateMetadataFeed( + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + + StatusOr UpdateMetadataFeed( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + + future> + UpdateMetadataFeed(google::longrunning::Operation const& operation) override; + StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; diff --git a/google/cloud/dataplex/v1/internal/catalog_tracing_stub.cc b/google/cloud/dataplex/v1/internal/catalog_tracing_stub.cc index 04e8eac7cdd9f..9e8748a9ebebd 100644 --- a/google/cloud/dataplex/v1/internal/catalog_tracing_stub.cc +++ b/google/cloud/dataplex/v1/internal/catalog_tracing_stub.cc @@ -506,6 +506,18 @@ CatalogServiceTracingStub::CreateEntryLink( child_->CreateEntryLink(context, options, request)); } +StatusOr +CatalogServiceTracingStub::UpdateEntryLink( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CatalogService", + "UpdateEntryLink"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateEntryLink(context, options, request)); +} + StatusOr CatalogServiceTracingStub::DeleteEntryLink( grpc::ClientContext& context, Options const& options, @@ -518,6 +530,30 @@ CatalogServiceTracingStub::DeleteEntryLink( child_->DeleteEntryLink(context, options, request)); } +StatusOr +CatalogServiceTracingStub::LookupEntryLinks( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupEntryLinksRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CatalogService", + "LookupEntryLinks"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->LookupEntryLinks(context, options, request)); +} + +StatusOr +CatalogServiceTracingStub::LookupContext( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupContextRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CatalogService", + "LookupContext"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->LookupContext(context, options, request)); +} + StatusOr CatalogServiceTracingStub::GetEntryLink( grpc::ClientContext& context, Options const& options, @@ -530,6 +566,111 @@ CatalogServiceTracingStub::GetEntryLink( child_->GetEntryLink(context, options, request)); } +future> +CatalogServiceTracingStub::AsyncCreateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CatalogService", + "CreateMetadataFeed"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateMetadataFeed(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +CatalogServiceTracingStub::CreateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CatalogService", + "CreateMetadataFeed"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->CreateMetadataFeed(context, options, request)); +} + +StatusOr +CatalogServiceTracingStub::GetMetadataFeed( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CatalogService", + "GetMetadataFeed"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetMetadataFeed(context, options, request)); +} + +StatusOr +CatalogServiceTracingStub::ListMetadataFeeds( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListMetadataFeedsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CatalogService", + "ListMetadataFeeds"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListMetadataFeeds(context, options, request)); +} + +future> +CatalogServiceTracingStub::AsyncDeleteMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CatalogService", + "DeleteMetadataFeed"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteMetadataFeed(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +CatalogServiceTracingStub::DeleteMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CatalogService", + "DeleteMetadataFeed"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteMetadataFeed(context, options, request)); +} + +future> +CatalogServiceTracingStub::AsyncUpdateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CatalogService", + "UpdateMetadataFeed"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateMetadataFeed(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +CatalogServiceTracingStub::UpdateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CatalogService", + "UpdateMetadataFeed"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UpdateMetadataFeed(context, options, request)); +} + StatusOr CatalogServiceTracingStub::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/dataplex/v1/internal/catalog_tracing_stub.h b/google/cloud/dataplex/v1/internal/catalog_tracing_stub.h index b297204c424bc..6a80b919961a2 100644 --- a/google/cloud/dataplex/v1/internal/catalog_tracing_stub.h +++ b/google/cloud/dataplex/v1/internal/catalog_tracing_stub.h @@ -237,15 +237,76 @@ class CatalogServiceTracingStub : public CatalogServiceStub { google::cloud::dataplex::v1::CreateEntryLinkRequest const& request) override; + StatusOr UpdateEntryLink( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request) + override; + StatusOr DeleteEntryLink( grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request) override; + StatusOr + LookupEntryLinks(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupEntryLinksRequest const& + request) override; + + StatusOr LookupContext( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::LookupContextRequest const& request) + override; + StatusOr GetEntryLink( grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::GetEntryLinkRequest const& request) override; + future> AsyncCreateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + StatusOr CreateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request) + override; + + StatusOr GetMetadataFeed( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetMetadataFeedRequest const& request) + override; + + StatusOr + ListMetadataFeeds(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListMetadataFeedsRequest const& + request) override; + + future> AsyncDeleteMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + StatusOr DeleteMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request) + override; + + future> AsyncUpdateMetadataFeed( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + + StatusOr UpdateMetadataFeed( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request) + override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/dataplex/v1/internal/cmek_auth_decorator.cc b/google/cloud/dataplex/v1/internal/cmek_auth_decorator.cc new file mode 100644 index 0000000000000..248b96d92cf14 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_auth_decorator.cc @@ -0,0 +1,258 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#include "google/cloud/dataplex/v1/internal/cmek_auth_decorator.h" +#include "google/cloud/dataplex/v1/cmek.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +CmekServiceAuth::CmekServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +future> +CmekServiceAuth::AsyncCreateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest 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->AsyncCreateEncryptionConfig(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +CmekServiceAuth::CreateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateEncryptionConfig(context, options, request); +} + +future> +CmekServiceAuth::AsyncUpdateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest 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->AsyncUpdateEncryptionConfig(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +CmekServiceAuth::UpdateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateEncryptionConfig(context, options, request); +} + +future> +CmekServiceAuth::AsyncDeleteEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest 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->AsyncDeleteEncryptionConfig(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +CmekServiceAuth::DeleteEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteEncryptionConfig(context, options, request); +} + +StatusOr +CmekServiceAuth::ListEncryptionConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListEncryptionConfigsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListEncryptionConfigs(context, options, request); +} + +StatusOr +CmekServiceAuth::GetEncryptionConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetEncryptionConfig(context, options, request); +} + +StatusOr +CmekServiceAuth::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 CmekServiceAuth::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 CmekServiceAuth::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->SetIamPolicy(context, options, request); +} + +StatusOr CmekServiceAuth::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetIamPolicy(context, options, request); +} + +StatusOr +CmekServiceAuth::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->TestIamPermissions(context, options, request); +} + +StatusOr +CmekServiceAuth::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 CmekServiceAuth::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 CmekServiceAuth::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 CmekServiceAuth::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> +CmekServiceAuth::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 CmekServiceAuth::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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/cmek_auth_decorator.h b/google/cloud/dataplex/v1/internal/cmek_auth_decorator.h new file mode 100644 index 0000000000000..7e38102471c11 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_auth_decorator.h @@ -0,0 +1,152 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_AUTH_DECORATOR_H + +#include "google/cloud/dataplex/v1/internal/cmek_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class CmekServiceAuth : public CmekServiceStub { + public: + ~CmekServiceAuth() override = default; + CmekServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + future> AsyncCreateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + StatusOr CreateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + future> AsyncUpdateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + StatusOr UpdateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + future> AsyncDeleteEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + StatusOr DeleteEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + StatusOr + ListEncryptionConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListEncryptionConfigsRequest const& request) + override; + + StatusOr GetEncryptionConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetEncryptionConfigRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_AUTH_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/cmek_connection_impl.cc b/google/cloud/dataplex/v1/internal/cmek_connection_impl.cc new file mode 100644 index 0000000000000..8ed1b577cd9f6 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_connection_impl.cc @@ -0,0 +1,561 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#include "google/cloud/dataplex/v1/internal/cmek_connection_impl.h" +#include "google/cloud/dataplex/v1/internal/cmek_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 dataplex_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 + +CmekServiceConnectionImpl::CmekServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions(std::move(options), + CmekServiceConnection::options())) {} + +future> +CmekServiceConnectionImpl::CreateEncryptionConfig( + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateEncryptionConfig(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::v1::EncryptionConfig>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& + request) { + return stub->AsyncCreateEncryptionConfig(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::dataplex::v1::EncryptionConfig>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +CmekServiceConnectionImpl::CreateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateEncryptionConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& + request) { + return stub_->CreateEncryptionConfig(context, options, request); + }, + *current, request, __func__); +} + +future> +CmekServiceConnectionImpl::CreateEncryptionConfig( + 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 CreateEncryptionConfig", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::v1::EncryptionConfig>( + 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::dataplex::v1::EncryptionConfig>, + polling_policy(*current), __func__); +} + +future> +CmekServiceConnectionImpl::UpdateEncryptionConfig( + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateEncryptionConfig(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::v1::EncryptionConfig>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& + request) { + return stub->AsyncUpdateEncryptionConfig(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::dataplex::v1::EncryptionConfig>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +CmekServiceConnectionImpl::UpdateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateEncryptionConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& + request) { + return stub_->UpdateEncryptionConfig(context, options, request); + }, + *current, request, __func__); +} + +future> +CmekServiceConnectionImpl::UpdateEncryptionConfig( + 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 UpdateEncryptionConfig", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::v1::EncryptionConfig>( + 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::dataplex::v1::EncryptionConfig>, + polling_policy(*current), __func__); +} + +future> +CmekServiceConnectionImpl::DeleteEncryptionConfig( + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteEncryptionConfig(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::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::dataplex::v1::DeleteEncryptionConfigRequest const& + request) { + return stub->AsyncDeleteEncryptionConfig(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::dataplex::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +CmekServiceConnectionImpl::DeleteEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteEncryptionConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& + request) { + return stub_->DeleteEncryptionConfig(context, options, request); + }, + *current, request, __func__); +} + +future> +CmekServiceConnectionImpl::DeleteEncryptionConfig( + 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 DeleteEncryptionConfig", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::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::dataplex::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +CmekServiceConnectionImpl::ListEncryptionConfigs( + google::cloud::dataplex::v1::ListEncryptionConfigsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListEncryptionConfigs(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::dataplex::v1::ListEncryptionConfigsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListEncryptionConfigsRequest const& + request) { + return stub->ListEncryptionConfigs(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::dataplex::v1::ListEncryptionConfigsResponse r) { + std::vector result( + r.encryption_configs().size()); + auto& messages = *r.mutable_encryption_configs(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +CmekServiceConnectionImpl::GetEncryptionConfig( + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetEncryptionConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& + request) { + return stub_->GetEncryptionConfig(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +CmekServiceConnectionImpl::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 +CmekServiceConnectionImpl::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__); +} + +StatusOr CmekServiceConnectionImpl::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->SetIamPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + return stub_->SetIamPolicy(context, options, request); + }, + *current, request, __func__); +} + +StatusOr CmekServiceConnectionImpl::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetIamPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + return stub_->GetIamPolicy(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +CmekServiceConnectionImpl::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->TestIamPermissions(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + return stub_->TestIamPermissions(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +CmekServiceConnectionImpl::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 +CmekServiceConnectionImpl::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 CmekServiceConnectionImpl::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 CmekServiceConnectionImpl::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 dataplex_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/internal/cmek_connection_impl.h b/google/cloud/dataplex/v1/internal/cmek_connection_impl.h new file mode 100644 index 0000000000000..78c69a847c963 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_connection_impl.h @@ -0,0 +1,143 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_CONNECTION_IMPL_H + +#include "google/cloud/dataplex/v1/cmek_connection.h" +#include "google/cloud/dataplex/v1/cmek_connection_idempotency_policy.h" +#include "google/cloud/dataplex/v1/cmek_options.h" +#include "google/cloud/dataplex/v1/internal/cmek_retry_traits.h" +#include "google/cloud/dataplex/v1/internal/cmek_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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class CmekServiceConnectionImpl : public dataplex_v1::CmekServiceConnection { + public: + ~CmekServiceConnectionImpl() override = default; + + CmekServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + future> + CreateEncryptionConfig( + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + StatusOr CreateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + future> + CreateEncryptionConfig( + google::longrunning::Operation const& operation) override; + + future> + UpdateEncryptionConfig( + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + StatusOr UpdateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + future> + UpdateEncryptionConfig( + google::longrunning::Operation const& operation) override; + + future> + DeleteEncryptionConfig( + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + StatusOr DeleteEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + future> + DeleteEncryptionConfig( + google::longrunning::Operation const& operation) override; + + StreamRange + ListEncryptionConfigs( + google::cloud::dataplex::v1::ListEncryptionConfigsRequest request) + override; + + StatusOr GetEncryptionConfig( + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& request) + override; + + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request) override; + + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest 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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_CONNECTION_IMPL_H diff --git a/google/cloud/dataplex/v1/internal/cmek_logging_decorator.cc b/google/cloud/dataplex/v1/internal/cmek_logging_decorator.cc new file mode 100644 index 0000000000000..107ce2e9c18b5 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_logging_decorator.cc @@ -0,0 +1,305 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#include "google/cloud/dataplex/v1/internal/cmek_logging_decorator.h" +#include "google/cloud/dataplex/v1/cmek.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +CmekServiceLogging::CmekServiceLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +future> +CmekServiceLogging::AsyncCreateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& + request) { + return child_->AsyncCreateEncryptionConfig(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +CmekServiceLogging::CreateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& + request) { + return child_->CreateEncryptionConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +CmekServiceLogging::AsyncUpdateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& + request) { + return child_->AsyncUpdateEncryptionConfig(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +CmekServiceLogging::UpdateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& + request) { + return child_->UpdateEncryptionConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +CmekServiceLogging::AsyncDeleteEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& + request) { + return child_->AsyncDeleteEncryptionConfig(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +CmekServiceLogging::DeleteEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& + request) { + return child_->DeleteEncryptionConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +CmekServiceLogging::ListEncryptionConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListEncryptionConfigsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListEncryptionConfigsRequest const& + request) { + return child_->ListEncryptionConfigs(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +CmekServiceLogging::GetEncryptionConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& + request) { + return child_->GetEncryptionConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +CmekServiceLogging::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 CmekServiceLogging::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 CmekServiceLogging::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + return child_->SetIamPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr CmekServiceLogging::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + return child_->GetIamPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +CmekServiceLogging::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + return child_->TestIamPermissions(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +CmekServiceLogging::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 CmekServiceLogging::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 CmekServiceLogging::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 CmekServiceLogging::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> +CmekServiceLogging::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 CmekServiceLogging::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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/cmek_logging_decorator.h b/google/cloud/dataplex/v1/internal/cmek_logging_decorator.h new file mode 100644 index 0000000000000..b958083d82191 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_logging_decorator.h @@ -0,0 +1,152 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_LOGGING_DECORATOR_H + +#include "google/cloud/dataplex/v1/internal/cmek_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class CmekServiceLogging : public CmekServiceStub { + public: + ~CmekServiceLogging() override = default; + CmekServiceLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + future> AsyncCreateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + StatusOr CreateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + future> AsyncUpdateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + StatusOr UpdateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + future> AsyncDeleteEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + StatusOr DeleteEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + StatusOr + ListEncryptionConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListEncryptionConfigsRequest const& request) + override; + + StatusOr GetEncryptionConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetEncryptionConfigRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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_; +}; // CmekServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_LOGGING_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/cmek_metadata_decorator.cc b/google/cloud/dataplex/v1/internal/cmek_metadata_decorator.cc new file mode 100644 index 0000000000000..16abc1580a2df --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_metadata_decorator.cc @@ -0,0 +1,255 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#include "google/cloud/dataplex/v1/internal/cmek_metadata_decorator.h" +#include "google/cloud/dataplex/v1/cmek.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +CmekServiceMetadata::CmekServiceMetadata( + 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)) {} + +future> +CmekServiceMetadata::AsyncCreateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateEncryptionConfig(cq, std::move(context), + std::move(options), request); +} + +StatusOr +CmekServiceMetadata::CreateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateEncryptionConfig(context, options, request); +} + +future> +CmekServiceMetadata::AsyncUpdateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) { + SetMetadata( + *context, *options, + absl::StrCat("encryption_config.name=", + internal::UrlEncode(request.encryption_config().name()))); + return child_->AsyncUpdateEncryptionConfig(cq, std::move(context), + std::move(options), request); +} + +StatusOr +CmekServiceMetadata::UpdateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("encryption_config.name=", + internal::UrlEncode(request.encryption_config().name()))); + return child_->UpdateEncryptionConfig(context, options, request); +} + +future> +CmekServiceMetadata::AsyncDeleteEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteEncryptionConfig(cq, std::move(context), + std::move(options), request); +} + +StatusOr +CmekServiceMetadata::DeleteEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteEncryptionConfig(context, options, request); +} + +StatusOr +CmekServiceMetadata::ListEncryptionConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListEncryptionConfigsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListEncryptionConfigs(context, options, request); +} + +StatusOr +CmekServiceMetadata::GetEncryptionConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetEncryptionConfig(context, options, request); +} + +StatusOr +CmekServiceMetadata::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 CmekServiceMetadata::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 CmekServiceMetadata::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("resource=", internal::UrlEncode(request.resource()))); + return child_->SetIamPolicy(context, options, request); +} + +StatusOr CmekServiceMetadata::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("resource=", internal::UrlEncode(request.resource()))); + return child_->GetIamPolicy(context, options, request); +} + +StatusOr +CmekServiceMetadata::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("resource=", internal::UrlEncode(request.resource()))); + return child_->TestIamPermissions(context, options, request); +} + +StatusOr +CmekServiceMetadata::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 CmekServiceMetadata::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 CmekServiceMetadata::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 CmekServiceMetadata::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> +CmekServiceMetadata::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 CmekServiceMetadata::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 CmekServiceMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void CmekServiceMetadata::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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/cmek_metadata_decorator.h b/google/cloud/dataplex/v1/internal/cmek_metadata_decorator.h new file mode 100644 index 0000000000000..9141e563cba79 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_metadata_decorator.h @@ -0,0 +1,157 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_METADATA_DECORATOR_H + +#include "google/cloud/dataplex/v1/internal/cmek_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class CmekServiceMetadata : public CmekServiceStub { + public: + ~CmekServiceMetadata() override = default; + CmekServiceMetadata(std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + future> AsyncCreateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + StatusOr CreateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + future> AsyncUpdateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + StatusOr UpdateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + future> AsyncDeleteEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + StatusOr DeleteEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + StatusOr + ListEncryptionConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListEncryptionConfigsRequest const& request) + override; + + StatusOr GetEncryptionConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetEncryptionConfigRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_METADATA_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/cmek_option_defaults.cc b/google/cloud/dataplex/v1/internal/cmek_option_defaults.cc new file mode 100644 index 0000000000000..52bc2c9a0e9e9 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_option_defaults.cc @@ -0,0 +1,75 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#include "google/cloud/dataplex/v1/internal/cmek_option_defaults.h" +#include "google/cloud/dataplex/v1/cmek_connection.h" +#include "google/cloud/dataplex/v1/cmek_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 dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options CmekServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_CMEK_SERVICE_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_CMEK_SERVICE_AUTHORITY", "dataplex.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + dataplex_v1::CmekServiceLimitedTimeRetryPolicy(std::chrono::minutes(10)) + .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( + options.get()->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } + if (!options + .has()) { + options.set( + dataplex_v1::MakeDefaultCmekServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/internal/cmek_option_defaults.h b/google/cloud/dataplex/v1/internal/cmek_option_defaults.h new file mode 100644 index 0000000000000..bf47a234a0c51 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options CmekServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_OPTION_DEFAULTS_H diff --git a/google/cloud/dataplex/v1/internal/cmek_retry_traits.h b/google/cloud/dataplex/v1/internal/cmek_retry_traits.h new file mode 100644 index 0000000000000..33712417fda2e --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct CmekServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_RETRY_TRAITS_H diff --git a/google/cloud/dataplex/v1/internal/cmek_sources.cc b/google/cloud/dataplex/v1/internal/cmek_sources.cc new file mode 100644 index 0000000000000..04c1e2fcbe644 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/dataplex/v1/cmek_client.cc" +#include "google/cloud/dataplex/v1/cmek_connection.cc" +#include "google/cloud/dataplex/v1/cmek_connection_idempotency_policy.cc" +#include "google/cloud/dataplex/v1/internal/cmek_auth_decorator.cc" +#include "google/cloud/dataplex/v1/internal/cmek_connection_impl.cc" +#include "google/cloud/dataplex/v1/internal/cmek_logging_decorator.cc" +#include "google/cloud/dataplex/v1/internal/cmek_metadata_decorator.cc" +#include "google/cloud/dataplex/v1/internal/cmek_option_defaults.cc" +#include "google/cloud/dataplex/v1/internal/cmek_stub.cc" +#include "google/cloud/dataplex/v1/internal/cmek_stub_factory.cc" +#include "google/cloud/dataplex/v1/internal/cmek_tracing_connection.cc" +#include "google/cloud/dataplex/v1/internal/cmek_tracing_stub.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/dataplex/v1/internal/cmek_stub.cc b/google/cloud/dataplex/v1/internal/cmek_stub.cc new file mode 100644 index 0000000000000..aff06fc8c87aa --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_stub.cc @@ -0,0 +1,304 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#include "google/cloud/dataplex/v1/internal/cmek_stub.h" +#include "google/cloud/dataplex/v1/cmek.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +CmekServiceStub::~CmekServiceStub() = default; + +future> +DefaultCmekServiceStub::AsyncCreateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::CreateEncryptionConfigRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateEncryptionConfig(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultCmekServiceStub::CreateEncryptionConfig( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->CreateEncryptionConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultCmekServiceStub::AsyncUpdateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateEncryptionConfig(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultCmekServiceStub::UpdateEncryptionConfig( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->UpdateEncryptionConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultCmekServiceStub::AsyncDeleteEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteEncryptionConfig(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultCmekServiceStub::DeleteEncryptionConfig( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->DeleteEncryptionConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultCmekServiceStub::ListEncryptionConfigs( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::ListEncryptionConfigsRequest const& request) { + google::cloud::dataplex::v1::ListEncryptionConfigsResponse response; + auto status = grpc_stub_->ListEncryptionConfigs(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultCmekServiceStub::GetEncryptionConfig( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& request) { + google::cloud::dataplex::v1::EncryptionConfig response; + auto status = grpc_stub_->GetEncryptionConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultCmekServiceStub::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 DefaultCmekServiceStub::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 DefaultCmekServiceStub::SetIamPolicy( + grpc::ClientContext& context, Options const&, + google::iam::v1::SetIamPolicyRequest const& request) { + google::iam::v1::Policy response; + auto status = iampolicy_stub_->SetIamPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultCmekServiceStub::GetIamPolicy( + grpc::ClientContext& context, Options const&, + google::iam::v1::GetIamPolicyRequest const& request) { + google::iam::v1::Policy response; + auto status = iampolicy_stub_->GetIamPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultCmekServiceStub::TestIamPermissions( + grpc::ClientContext& context, Options const&, + google::iam::v1::TestIamPermissionsRequest const& request) { + google::iam::v1::TestIamPermissionsResponse response; + auto status = + iampolicy_stub_->TestIamPermissions(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultCmekServiceStub::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 DefaultCmekServiceStub::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 DefaultCmekServiceStub::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 DefaultCmekServiceStub::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> +DefaultCmekServiceStub::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 DefaultCmekServiceStub::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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/cmek_stub.h b/google/cloud/dataplex/v1/internal/cmek_stub.h new file mode 100644 index 0000000000000..2dccc4bbb268a --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_stub.h @@ -0,0 +1,275 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_STUB_H + +#include "google/cloud/dataplex/v1/cmek.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.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 "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class CmekServiceStub { + public: + virtual ~CmekServiceStub() = 0; + + virtual future> + AsyncCreateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& + request) = 0; + + virtual StatusOr CreateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& + request) = 0; + + virtual future> + AsyncUpdateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& + request) = 0; + + virtual StatusOr UpdateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& + request) = 0; + + virtual future> + AsyncDeleteEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& + request) = 0; + + virtual StatusOr DeleteEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& + request) = 0; + + virtual StatusOr + ListEncryptionConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListEncryptionConfigsRequest const& + request) = 0; + + virtual StatusOr + GetEncryptionConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetEncryptionConfigRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) = 0; + + virtual StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) = 0; + + virtual StatusOr + TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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 DefaultCmekServiceStub : public CmekServiceStub { + public: + DefaultCmekServiceStub( + std::unique_ptr + grpc_stub, + std::unique_ptr iampolicy_stub, + std::unique_ptr + locations_stub, + std::unique_ptr + operations_stub) + : grpc_stub_(std::move(grpc_stub)), + iampolicy_stub_(std::move(iampolicy_stub)), + locations_stub_(std::move(locations_stub)), + operations_stub_(std::move(operations_stub)) {} + + future> AsyncCreateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + StatusOr CreateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + future> AsyncUpdateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + StatusOr UpdateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + future> AsyncDeleteEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + StatusOr DeleteEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + StatusOr + ListEncryptionConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListEncryptionConfigsRequest const& request) + override; + + StatusOr GetEncryptionConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetEncryptionConfigRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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 + grpc_stub_; + std::unique_ptr iampolicy_stub_; + std::unique_ptr + locations_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_STUB_H diff --git a/google/cloud/dataplex/v1/internal/cmek_stub_factory.cc b/google/cloud/dataplex/v1/internal/cmek_stub_factory.cc new file mode 100644 index 0000000000000..58c849667c1cd --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_stub_factory.cc @@ -0,0 +1,84 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#include "google/cloud/dataplex/v1/internal/cmek_stub_factory.h" +#include "google/cloud/dataplex/v1/cmek.grpc.pb.h" +#include "google/cloud/dataplex/v1/internal/cmek_auth_decorator.h" +#include "google/cloud/dataplex/v1/internal/cmek_logging_decorator.h" +#include "google/cloud/dataplex/v1/internal/cmek_metadata_decorator.h" +#include "google/cloud/dataplex/v1/internal/cmek_stub.h" +#include "google/cloud/dataplex/v1/internal/cmek_tracing_stub.h" +#include "google/cloud/location/locations.grpc.pb.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 "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultCmekServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::dataplex::v1::CmekService::NewStub(channel); + auto service_iampolicy_stub = google::iam::v1::IAMPolicy::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_iampolicy_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 = MakeCmekServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/cmek_stub_factory.h b/google/cloud/dataplex/v1/internal/cmek_stub_factory.h new file mode 100644 index 0000000000000..65ba56431b770 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_STUB_FACTORY_H + +#include "google/cloud/dataplex/v1/internal/cmek_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultCmekServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_STUB_FACTORY_H diff --git a/google/cloud/dataplex/v1/internal/cmek_tracing_connection.cc b/google/cloud/dataplex/v1/internal/cmek_tracing_connection.cc new file mode 100644 index 0000000000000..a3276e6d24916 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_tracing_connection.cc @@ -0,0 +1,241 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#include "google/cloud/dataplex/v1/internal/cmek_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +CmekServiceTracingConnection::CmekServiceTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +future> +CmekServiceTracingConnection::CreateEncryptionConfig( + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CmekServiceConnection::CreateEncryptionConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateEncryptionConfig(request)); +} + +StatusOr +CmekServiceTracingConnection::CreateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CmekServiceConnection::CreateEncryptionConfig"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->CreateEncryptionConfig(NoAwaitTag{}, request)); +} + +future> +CmekServiceTracingConnection::CreateEncryptionConfig( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::CmekServiceConnection::CreateEncryptionConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateEncryptionConfig(operation)); +} + +future> +CmekServiceTracingConnection::UpdateEncryptionConfig( + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CmekServiceConnection::UpdateEncryptionConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateEncryptionConfig(request)); +} + +StatusOr +CmekServiceTracingConnection::UpdateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CmekServiceConnection::UpdateEncryptionConfig"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->UpdateEncryptionConfig(NoAwaitTag{}, request)); +} + +future> +CmekServiceTracingConnection::UpdateEncryptionConfig( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::CmekServiceConnection::UpdateEncryptionConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateEncryptionConfig(operation)); +} + +future> +CmekServiceTracingConnection::DeleteEncryptionConfig( + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CmekServiceConnection::DeleteEncryptionConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteEncryptionConfig(request)); +} + +StatusOr +CmekServiceTracingConnection::DeleteEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CmekServiceConnection::DeleteEncryptionConfig"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->DeleteEncryptionConfig(NoAwaitTag{}, request)); +} + +future> +CmekServiceTracingConnection::DeleteEncryptionConfig( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::CmekServiceConnection::DeleteEncryptionConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteEncryptionConfig(operation)); +} + +StreamRange +CmekServiceTracingConnection::ListEncryptionConfigs( + google::cloud::dataplex::v1::ListEncryptionConfigsRequest request) { + auto span = internal::MakeSpan( + "dataplex_v1::CmekServiceConnection::ListEncryptionConfigs"); + internal::OTelScope scope(span); + auto sr = child_->ListEncryptionConfigs(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::dataplex::v1::EncryptionConfig>(std::move(span), + std::move(sr)); +} + +StatusOr +CmekServiceTracingConnection::GetEncryptionConfig( + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CmekServiceConnection::GetEncryptionConfig"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetEncryptionConfig(request)); +} + +StreamRange +CmekServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = + internal::MakeSpan("dataplex_v1::CmekServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +CmekServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = + internal::MakeSpan("dataplex_v1::CmekServiceConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StatusOr CmekServiceTracingConnection::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { + auto span = + internal::MakeSpan("dataplex_v1::CmekServiceConnection::SetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->SetIamPolicy(request)); +} + +StatusOr CmekServiceTracingConnection::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) { + auto span = + internal::MakeSpan("dataplex_v1::CmekServiceConnection::GetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetIamPolicy(request)); +} + +StatusOr +CmekServiceTracingConnection::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::CmekServiceConnection::TestIamPermissions"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->TestIamPermissions(request)); +} + +StreamRange +CmekServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = + internal::MakeSpan("dataplex_v1::CmekServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +CmekServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = + internal::MakeSpan("dataplex_v1::CmekServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status CmekServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = + internal::MakeSpan("dataplex_v1::CmekServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status CmekServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = + internal::MakeSpan("dataplex_v1::CmekServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeCmekServiceTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/internal/cmek_tracing_connection.h b/google/cloud/dataplex/v1/internal/cmek_tracing_connection.h new file mode 100644 index 0000000000000..5a8a21397f7ec --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_tracing_connection.h @@ -0,0 +1,137 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_TRACING_CONNECTION_H + +#include "google/cloud/dataplex/v1/cmek_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class CmekServiceTracingConnection : public dataplex_v1::CmekServiceConnection { + public: + ~CmekServiceTracingConnection() override = default; + + explicit CmekServiceTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + future> + CreateEncryptionConfig( + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + StatusOr CreateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + future> + CreateEncryptionConfig( + google::longrunning::Operation const& operation) override; + + future> + UpdateEncryptionConfig( + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + StatusOr UpdateEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + future> + UpdateEncryptionConfig( + google::longrunning::Operation const& operation) override; + + future> + DeleteEncryptionConfig( + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + StatusOr DeleteEncryptionConfig( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + future> + DeleteEncryptionConfig( + google::longrunning::Operation const& operation) override; + + StreamRange + ListEncryptionConfigs( + google::cloud::dataplex::v1::ListEncryptionConfigsRequest request) + override; + + StatusOr GetEncryptionConfig( + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& request) + override; + + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request) override; + + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest 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_; +}; + +/** + * 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 +MakeCmekServiceTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_TRACING_CONNECTION_H diff --git a/google/cloud/dataplex/v1/internal/cmek_tracing_stub.cc b/google/cloud/dataplex/v1/internal/cmek_tracing_stub.cc new file mode 100644 index 0000000000000..176a1b5ed04c8 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_tracing_stub.cc @@ -0,0 +1,284 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#include "google/cloud/dataplex/v1/internal/cmek_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +CmekServiceTracingStub::CmekServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +future> +CmekServiceTracingStub::AsyncCreateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "CreateEncryptionConfig"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateEncryptionConfig(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +CmekServiceTracingStub::CreateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "CreateEncryptionConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->CreateEncryptionConfig(context, options, request)); +} + +future> +CmekServiceTracingStub::AsyncUpdateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "UpdateEncryptionConfig"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateEncryptionConfig(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +CmekServiceTracingStub::UpdateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "UpdateEncryptionConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->UpdateEncryptionConfig(context, options, request)); +} + +future> +CmekServiceTracingStub::AsyncDeleteEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "DeleteEncryptionConfig"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteEncryptionConfig(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +CmekServiceTracingStub::DeleteEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "DeleteEncryptionConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->DeleteEncryptionConfig(context, options, request)); +} + +StatusOr +CmekServiceTracingStub::ListEncryptionConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListEncryptionConfigsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "ListEncryptionConfigs"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListEncryptionConfigs(context, options, request)); +} + +StatusOr +CmekServiceTracingStub::GetEncryptionConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetEncryptionConfigRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "GetEncryptionConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->GetEncryptionConfig(context, options, request)); +} + +StatusOr +CmekServiceTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr CmekServiceTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr CmekServiceTracingStub::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "SetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->SetIamPolicy(context, options, request)); +} + +StatusOr CmekServiceTracingStub::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "GetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetIamPolicy(context, options, request)); +} + +StatusOr +CmekServiceTracingStub::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "TestIamPermissions"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->TestIamPermissions(context, options, request)); +} + +StatusOr +CmekServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr CmekServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status CmekServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status CmekServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.CmekService", + "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +CmekServiceTracingStub::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 CmekServiceTracingStub::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)); +} + +std::shared_ptr MakeCmekServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/cmek_tracing_stub.h b/google/cloud/dataplex/v1/internal/cmek_tracing_stub.h new file mode 100644 index 0000000000000..4a6f3d534e4e1 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/cmek_tracing_stub.h @@ -0,0 +1,159 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_TRACING_STUB_H + +#include "google/cloud/dataplex/v1/internal/cmek_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class CmekServiceTracingStub : public CmekServiceStub { + public: + ~CmekServiceTracingStub() override = default; + + explicit CmekServiceTracingStub(std::shared_ptr child); + + future> AsyncCreateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + StatusOr CreateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& request) + override; + + future> AsyncUpdateEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + StatusOr UpdateEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& request) + override; + + future> AsyncDeleteEncryptionConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + StatusOr DeleteEncryptionConfig( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& request) + override; + + StatusOr + ListEncryptionConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListEncryptionConfigsRequest const& request) + override; + + StatusOr GetEncryptionConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetEncryptionConfigRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeCmekServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_CMEK_TRACING_STUB_H diff --git a/google/cloud/dataplex/v1/internal/content_auth_decorator.cc b/google/cloud/dataplex/v1/internal/content_auth_decorator.cc index 755af384da048..5e404e8cf3611 100644 --- a/google/cloud/dataplex/v1/internal/content_auth_decorator.cc +++ b/google/cloud/dataplex/v1/internal/content_auth_decorator.cc @@ -34,38 +34,29 @@ ContentServiceAuth::ContentServiceAuth( std::shared_ptr child) : auth_(std::move(auth)), child_(std::move(child)) {} -StatusOr -ContentServiceAuth::CreateContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateContentRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->CreateContent(context, options, request); -} - -StatusOr -ContentServiceAuth::UpdateContent( +StatusOr +ContentServiceAuth::ListLocations( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateContentRequest const& request) { + google::cloud::location::ListLocationsRequest const& request) { auto status = auth_->ConfigureContext(context); if (!status.ok()) return status; - return child_->UpdateContent(context, options, request); + return child_->ListLocations(context, options, request); } -Status ContentServiceAuth::DeleteContent( +StatusOr ContentServiceAuth::GetLocation( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteContentRequest const& request) { + google::cloud::location::GetLocationRequest const& request) { auto status = auth_->ConfigureContext(context); if (!status.ok()) return status; - return child_->DeleteContent(context, options, request); + return child_->GetLocation(context, options, request); } -StatusOr ContentServiceAuth::GetContent( +StatusOr ContentServiceAuth::SetIamPolicy( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetContentRequest const& request) { + google::iam::v1::SetIamPolicyRequest const& request) { auto status = auth_->ConfigureContext(context); if (!status.ok()) return status; - return child_->GetContent(context, options, request); + return child_->SetIamPolicy(context, options, request); } StatusOr ContentServiceAuth::GetIamPolicy( @@ -76,14 +67,6 @@ StatusOr ContentServiceAuth::GetIamPolicy( return child_->GetIamPolicy(context, options, request); } -StatusOr ContentServiceAuth::SetIamPolicy( - grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->SetIamPolicy(context, options, request); -} - StatusOr ContentServiceAuth::TestIamPermissions( grpc::ClientContext& context, Options const& options, @@ -93,32 +76,6 @@ ContentServiceAuth::TestIamPermissions( return child_->TestIamPermissions(context, options, request); } -StatusOr -ContentServiceAuth::ListContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListContentRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->ListContent(context, options, request); -} - -StatusOr -ContentServiceAuth::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 ContentServiceAuth::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 ContentServiceAuth::ListOperations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/dataplex/v1/internal/content_auth_decorator.h b/google/cloud/dataplex/v1/internal/content_auth_decorator.h index db54fd6e8aee1..40baaac775492 100644 --- a/google/cloud/dataplex/v1/internal/content_auth_decorator.h +++ b/google/cloud/dataplex/v1/internal/content_auth_decorator.h @@ -41,48 +41,26 @@ class ContentServiceAuth : public ContentServiceStub { std::shared_ptr auth, std::shared_ptr child); - StatusOr CreateContent( + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateContentRequest const& request) - override; + google::cloud::location::ListLocationsRequest const& request) override; - StatusOr UpdateContent( + StatusOr GetLocation( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateContentRequest const& request) - override; - - Status DeleteContent(grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteContentRequest const& - request) override; + google::cloud::location::GetLocationRequest const& request) override; - StatusOr GetContent( + StatusOr SetIamPolicy( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetContentRequest const& request) override; + google::iam::v1::SetIamPolicyRequest const& request) override; StatusOr GetIamPolicy( grpc::ClientContext& context, Options const& options, google::iam::v1::GetIamPolicyRequest const& request) override; - StatusOr SetIamPolicy( - grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) override; - StatusOr TestIamPermissions( grpc::ClientContext& context, Options const& options, google::iam::v1::TestIamPermissionsRequest const& request) override; - StatusOr ListContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListContentRequest 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; diff --git a/google/cloud/dataplex/v1/internal/content_connection_impl.cc b/google/cloud/dataplex/v1/internal/content_connection_impl.cc index 1240a8888a465..498fb56891b59 100644 --- a/google/cloud/dataplex/v1/internal/content_connection_impl.cc +++ b/google/cloud/dataplex/v1/internal/content_connection_impl.cc @@ -59,135 +59,6 @@ ContentServiceConnectionImpl::ContentServiceConnectionImpl( options_(internal::MergeOptions(std::move(options), ContentServiceConnection::options())) {} -StatusOr -ContentServiceConnectionImpl::CreateContent( - google::cloud::dataplex::v1::CreateContentRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->CreateContent(request), - [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateContentRequest const& request) { - return stub_->CreateContent(context, options, request); - }, - *current, request, __func__); -} - -StatusOr -ContentServiceConnectionImpl::UpdateContent( - google::cloud::dataplex::v1::UpdateContentRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->UpdateContent(request), - [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateContentRequest const& request) { - return stub_->UpdateContent(context, options, request); - }, - *current, request, __func__); -} - -Status ContentServiceConnectionImpl::DeleteContent( - google::cloud::dataplex::v1::DeleteContentRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->DeleteContent(request), - [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteContentRequest const& request) { - return stub_->DeleteContent(context, options, request); - }, - *current, request, __func__); -} - -StatusOr -ContentServiceConnectionImpl::GetContent( - google::cloud::dataplex::v1::GetContentRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->GetContent(request), - [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetContentRequest const& request) { - return stub_->GetContent(context, options, request); - }, - *current, request, __func__); -} - -StatusOr ContentServiceConnectionImpl::GetIamPolicy( - google::iam::v1::GetIamPolicyRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->GetIamPolicy(request), - [this](grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) { - return stub_->GetIamPolicy(context, options, request); - }, - *current, request, __func__); -} - -StatusOr ContentServiceConnectionImpl::SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->SetIamPolicy(request), - [this](grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { - return stub_->SetIamPolicy(context, options, request); - }, - *current, request, __func__); -} - -StatusOr -ContentServiceConnectionImpl::TestIamPermissions( - google::iam::v1::TestIamPermissionsRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->TestIamPermissions(request), - [this](grpc::ClientContext& context, Options const& options, - google::iam::v1::TestIamPermissionsRequest const& request) { - return stub_->TestIamPermissions(context, options, request); - }, - *current, request, __func__); -} - -StreamRange -ContentServiceConnectionImpl::ListContent( - google::cloud::dataplex::v1::ListContentRequest request) { - request.clear_page_token(); - auto current = google::cloud::internal::SaveCurrentOptions(); - auto idempotency = idempotency_policy(*current)->ListContent(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::dataplex::v1::ListContentRequest const& r) { - return google::cloud::internal::RetryLoop( - retry->clone(), backoff->clone(), idempotency, - [stub](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListContentRequest const& - request) { - return stub->ListContent(context, options, request); - }, - options, r, function_name); - }, - [](google::cloud::dataplex::v1::ListContentResponse r) { - std::vector result( - r.content().size()); - auto& messages = *r.mutable_content(); - std::move(messages.begin(), messages.end(), result.begin()); - return result; - }); -} - StreamRange ContentServiceConnectionImpl::ListLocations( google::cloud::location::ListLocationsRequest request) { @@ -236,6 +107,46 @@ ContentServiceConnectionImpl::GetLocation( *current, request, __func__); } +StatusOr ContentServiceConnectionImpl::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->SetIamPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + return stub_->SetIamPolicy(context, options, request); + }, + *current, request, __func__); +} + +StatusOr ContentServiceConnectionImpl::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetIamPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + return stub_->GetIamPolicy(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +ContentServiceConnectionImpl::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->TestIamPermissions(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + return stub_->TestIamPermissions(context, options, request); + }, + *current, request, __func__); +} + StreamRange ContentServiceConnectionImpl::ListOperations( google::longrunning::ListOperationsRequest request) { diff --git a/google/cloud/dataplex/v1/internal/content_connection_impl.h b/google/cloud/dataplex/v1/internal/content_connection_impl.h index 095a63f8328a8..8edb85a682847 100644 --- a/google/cloud/dataplex/v1/internal/content_connection_impl.h +++ b/google/cloud/dataplex/v1/internal/content_connection_impl.h @@ -49,38 +49,21 @@ class ContentServiceConnectionImpl Options options() override { return options_; } - StatusOr CreateContent( - google::cloud::dataplex::v1::CreateContentRequest const& request) - override; - - StatusOr UpdateContent( - google::cloud::dataplex::v1::UpdateContentRequest const& request) - override; + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request) override; - Status DeleteContent(google::cloud::dataplex::v1::DeleteContentRequest const& - request) override; + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request) override; - StatusOr GetContent( - google::cloud::dataplex::v1::GetContentRequest const& request) override; + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) override; StatusOr GetIamPolicy( google::iam::v1::GetIamPolicyRequest const& request) override; - StatusOr SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request) override; - StatusOr TestIamPermissions( google::iam::v1::TestIamPermissionsRequest const& request) override; - StreamRange ListContent( - google::cloud::dataplex::v1::ListContentRequest request) 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; diff --git a/google/cloud/dataplex/v1/internal/content_logging_decorator.cc b/google/cloud/dataplex/v1/internal/content_logging_decorator.cc index 1830eaca16b02..162f49b490330 100644 --- a/google/cloud/dataplex/v1/internal/content_logging_decorator.cc +++ b/google/cloud/dataplex/v1/internal/content_logging_decorator.cc @@ -38,49 +38,36 @@ ContentServiceLogging::ContentServiceLogging( std::set const&) : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} -StatusOr -ContentServiceLogging::CreateContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateContentRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateContentRequest const& request) { - return child_->CreateContent(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -ContentServiceLogging::UpdateContent( +StatusOr +ContentServiceLogging::ListLocations( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateContentRequest const& request) { + google::cloud::location::ListLocationsRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateContentRequest const& request) { - return child_->UpdateContent(context, options, request); + google::cloud::location::ListLocationsRequest const& request) { + return child_->ListLocations(context, options, request); }, context, options, request, __func__, tracing_options_); } -Status ContentServiceLogging::DeleteContent( +StatusOr ContentServiceLogging::GetLocation( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteContentRequest const& request) { + google::cloud::location::GetLocationRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteContentRequest const& request) { - return child_->DeleteContent(context, options, request); + google::cloud::location::GetLocationRequest const& request) { + return child_->GetLocation(context, options, request); }, context, options, request, __func__, tracing_options_); } -StatusOr -ContentServiceLogging::GetContent( +StatusOr ContentServiceLogging::SetIamPolicy( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetContentRequest const& request) { + google::iam::v1::SetIamPolicyRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetContentRequest const& request) { - return child_->GetContent(context, options, request); + google::iam::v1::SetIamPolicyRequest const& request) { + return child_->SetIamPolicy(context, options, request); }, context, options, request, __func__, tracing_options_); } @@ -96,17 +83,6 @@ StatusOr ContentServiceLogging::GetIamPolicy( context, options, request, __func__, tracing_options_); } -StatusOr ContentServiceLogging::SetIamPolicy( - grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { - return child_->SetIamPolicy(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - StatusOr ContentServiceLogging::TestIamPermissions( grpc::ClientContext& context, Options const& options, @@ -119,41 +95,6 @@ ContentServiceLogging::TestIamPermissions( context, options, request, __func__, tracing_options_); } -StatusOr -ContentServiceLogging::ListContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListContentRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListContentRequest const& request) { - return child_->ListContent(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -ContentServiceLogging::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 ContentServiceLogging::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 ContentServiceLogging::ListOperations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/dataplex/v1/internal/content_logging_decorator.h b/google/cloud/dataplex/v1/internal/content_logging_decorator.h index 51d7850d86b2e..d59f536e75c3b 100644 --- a/google/cloud/dataplex/v1/internal/content_logging_decorator.h +++ b/google/cloud/dataplex/v1/internal/content_logging_decorator.h @@ -41,48 +41,26 @@ class ContentServiceLogging : public ContentServiceStub { TracingOptions tracing_options, std::set const& components); - StatusOr CreateContent( + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateContentRequest const& request) - override; + google::cloud::location::ListLocationsRequest const& request) override; - StatusOr UpdateContent( + StatusOr GetLocation( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateContentRequest const& request) - override; - - Status DeleteContent(grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteContentRequest const& - request) override; + google::cloud::location::GetLocationRequest const& request) override; - StatusOr GetContent( + StatusOr SetIamPolicy( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetContentRequest const& request) override; + google::iam::v1::SetIamPolicyRequest const& request) override; StatusOr GetIamPolicy( grpc::ClientContext& context, Options const& options, google::iam::v1::GetIamPolicyRequest const& request) override; - StatusOr SetIamPolicy( - grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) override; - StatusOr TestIamPermissions( grpc::ClientContext& context, Options const& options, google::iam::v1::TestIamPermissionsRequest const& request) override; - StatusOr ListContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListContentRequest 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; diff --git a/google/cloud/dataplex/v1/internal/content_metadata_decorator.cc b/google/cloud/dataplex/v1/internal/content_metadata_decorator.cc index 0aaa6ab53c796..576e1d3e15d0a 100644 --- a/google/cloud/dataplex/v1/internal/content_metadata_decorator.cc +++ b/google/cloud/dataplex/v1/internal/content_metadata_decorator.cc @@ -48,58 +48,39 @@ ContentServiceMetadata::ContentServiceMetadata( ? google::cloud::internal::GeneratedLibClientHeader() : std::move(api_client_header)) {} -StatusOr -ContentServiceMetadata::CreateContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateContentRequest const& request) { - SetMetadata(context, options, - absl::StrCat("parent=", internal::UrlEncode(request.parent()))); - return child_->CreateContent(context, options, request); -} - -StatusOr -ContentServiceMetadata::UpdateContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateContentRequest const& request) { - SetMetadata(context, options, - absl::StrCat("content.name=", - internal::UrlEncode(request.content().name()))); - return child_->UpdateContent(context, options, request); -} - -Status ContentServiceMetadata::DeleteContent( +StatusOr +ContentServiceMetadata::ListLocations( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteContentRequest const& request) { + google::cloud::location::ListLocationsRequest const& request) { SetMetadata(context, options, absl::StrCat("name=", internal::UrlEncode(request.name()))); - return child_->DeleteContent(context, options, request); + return child_->ListLocations(context, options, request); } -StatusOr -ContentServiceMetadata::GetContent( +StatusOr ContentServiceMetadata::GetLocation( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetContentRequest const& request) { + google::cloud::location::GetLocationRequest const& request) { SetMetadata(context, options, absl::StrCat("name=", internal::UrlEncode(request.name()))); - return child_->GetContent(context, options, request); + return child_->GetLocation(context, options, request); } -StatusOr ContentServiceMetadata::GetIamPolicy( +StatusOr ContentServiceMetadata::SetIamPolicy( grpc::ClientContext& context, Options const& options, - google::iam::v1::GetIamPolicyRequest const& request) { + google::iam::v1::SetIamPolicyRequest const& request) { SetMetadata( context, options, absl::StrCat("resource=", internal::UrlEncode(request.resource()))); - return child_->GetIamPolicy(context, options, request); + return child_->SetIamPolicy(context, options, request); } -StatusOr ContentServiceMetadata::SetIamPolicy( +StatusOr ContentServiceMetadata::GetIamPolicy( grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { + google::iam::v1::GetIamPolicyRequest const& request) { SetMetadata( context, options, absl::StrCat("resource=", internal::UrlEncode(request.resource()))); - return child_->SetIamPolicy(context, options, request); + return child_->GetIamPolicy(context, options, request); } StatusOr @@ -112,32 +93,6 @@ ContentServiceMetadata::TestIamPermissions( return child_->TestIamPermissions(context, options, request); } -StatusOr -ContentServiceMetadata::ListContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListContentRequest const& request) { - SetMetadata(context, options, - absl::StrCat("parent=", internal::UrlEncode(request.parent()))); - return child_->ListContent(context, options, request); -} - -StatusOr -ContentServiceMetadata::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 ContentServiceMetadata::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 ContentServiceMetadata::ListOperations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/dataplex/v1/internal/content_metadata_decorator.h b/google/cloud/dataplex/v1/internal/content_metadata_decorator.h index e534bbeda8126..61793dad4a354 100644 --- a/google/cloud/dataplex/v1/internal/content_metadata_decorator.h +++ b/google/cloud/dataplex/v1/internal/content_metadata_decorator.h @@ -41,48 +41,26 @@ class ContentServiceMetadata : public ContentServiceStub { std::multimap fixed_metadata, std::string api_client_header = ""); - StatusOr CreateContent( + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateContentRequest const& request) - override; + google::cloud::location::ListLocationsRequest const& request) override; - StatusOr UpdateContent( + StatusOr GetLocation( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateContentRequest const& request) - override; - - Status DeleteContent(grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteContentRequest const& - request) override; + google::cloud::location::GetLocationRequest const& request) override; - StatusOr GetContent( + StatusOr SetIamPolicy( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetContentRequest const& request) override; + google::iam::v1::SetIamPolicyRequest const& request) override; StatusOr GetIamPolicy( grpc::ClientContext& context, Options const& options, google::iam::v1::GetIamPolicyRequest const& request) override; - StatusOr SetIamPolicy( - grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) override; - StatusOr TestIamPermissions( grpc::ClientContext& context, Options const& options, google::iam::v1::TestIamPermissionsRequest const& request) override; - StatusOr ListContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListContentRequest 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; diff --git a/google/cloud/dataplex/v1/internal/content_stub.cc b/google/cloud/dataplex/v1/internal/content_stub.cc index f652271af7d9a..6c9567fe1cf98 100644 --- a/google/cloud/dataplex/v1/internal/content_stub.cc +++ b/google/cloud/dataplex/v1/internal/content_stub.cc @@ -33,47 +33,35 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN ContentServiceStub::~ContentServiceStub() = default; -StatusOr -DefaultContentServiceStub::CreateContent( +StatusOr +DefaultContentServiceStub::ListLocations( grpc::ClientContext& context, Options const&, - google::cloud::dataplex::v1::CreateContentRequest const& request) { - google::cloud::dataplex::v1::Content response; - auto status = grpc_stub_->CreateContent(&context, request, &response); + 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 -DefaultContentServiceStub::UpdateContent( +StatusOr +DefaultContentServiceStub::GetLocation( grpc::ClientContext& context, Options const&, - google::cloud::dataplex::v1::UpdateContentRequest const& request) { - google::cloud::dataplex::v1::Content response; - auto status = grpc_stub_->UpdateContent(&context, request, &response); + 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; } -Status DefaultContentServiceStub::DeleteContent( - grpc::ClientContext& context, Options const&, - google::cloud::dataplex::v1::DeleteContentRequest const& request) { - google::protobuf::Empty response; - auto status = grpc_stub_->DeleteContent(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return google::cloud::Status(); -} - -StatusOr -DefaultContentServiceStub::GetContent( +StatusOr DefaultContentServiceStub::SetIamPolicy( grpc::ClientContext& context, Options const&, - google::cloud::dataplex::v1::GetContentRequest const& request) { - google::cloud::dataplex::v1::Content response; - auto status = grpc_stub_->GetContent(&context, request, &response); + google::iam::v1::SetIamPolicyRequest const& request) { + google::iam::v1::Policy response; + auto status = iampolicy_stub_->SetIamPolicy(&context, request, &response); if (!status.ok()) { return google::cloud::MakeStatusFromRpcError(status); } @@ -84,18 +72,7 @@ StatusOr DefaultContentServiceStub::GetIamPolicy( grpc::ClientContext& context, Options const&, google::iam::v1::GetIamPolicyRequest const& request) { google::iam::v1::Policy response; - auto status = grpc_stub_->GetIamPolicy(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr DefaultContentServiceStub::SetIamPolicy( - grpc::ClientContext& context, Options const&, - google::iam::v1::SetIamPolicyRequest const& request) { - google::iam::v1::Policy response; - auto status = grpc_stub_->SetIamPolicy(&context, request, &response); + auto status = iampolicy_stub_->GetIamPolicy(&context, request, &response); if (!status.ok()) { return google::cloud::MakeStatusFromRpcError(status); } @@ -107,43 +84,8 @@ DefaultContentServiceStub::TestIamPermissions( grpc::ClientContext& context, Options const&, google::iam::v1::TestIamPermissionsRequest const& request) { google::iam::v1::TestIamPermissionsResponse response; - auto status = grpc_stub_->TestIamPermissions(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultContentServiceStub::ListContent( - grpc::ClientContext& context, Options const&, - google::cloud::dataplex::v1::ListContentRequest const& request) { - google::cloud::dataplex::v1::ListContentResponse response; - auto status = grpc_stub_->ListContent(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultContentServiceStub::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 -DefaultContentServiceStub::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); + auto status = + iampolicy_stub_->TestIamPermissions(&context, request, &response); if (!status.ok()) { return google::cloud::MakeStatusFromRpcError(status); } diff --git a/google/cloud/dataplex/v1/internal/content_stub.h b/google/cloud/dataplex/v1/internal/content_stub.h index d0336000a16f5..c8bad2a3ce84a 100644 --- a/google/cloud/dataplex/v1/internal/content_stub.h +++ b/google/cloud/dataplex/v1/internal/content_stub.h @@ -24,6 +24,7 @@ #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" +#include "google/iam/v1/iam_policy.grpc.pb.h" #include "google/longrunning/operations.grpc.pb.h" #include #include @@ -40,49 +41,28 @@ class ContentServiceStub { public: virtual ~ContentServiceStub() = 0; - virtual StatusOr CreateContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateContentRequest const& request) = 0; - - virtual StatusOr UpdateContent( + virtual StatusOr + ListLocations( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateContentRequest const& request) = 0; + google::cloud::location::ListLocationsRequest const& request) = 0; - virtual Status DeleteContent( + virtual StatusOr GetLocation( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteContentRequest const& request) = 0; + google::cloud::location::GetLocationRequest const& request) = 0; - virtual StatusOr GetContent( + virtual StatusOr SetIamPolicy( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetContentRequest const& request) = 0; + google::iam::v1::SetIamPolicyRequest const& request) = 0; virtual StatusOr GetIamPolicy( grpc::ClientContext& context, Options const& options, google::iam::v1::GetIamPolicyRequest const& request) = 0; - virtual StatusOr SetIamPolicy( - grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) = 0; - virtual StatusOr TestIamPermissions( grpc::ClientContext& context, Options const& options, google::iam::v1::TestIamPermissionsRequest const& request) = 0; - virtual StatusOr - ListContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListContentRequest 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; @@ -108,54 +88,34 @@ class DefaultContentServiceStub : public ContentServiceStub { grpc_stub, std::unique_ptr operations_stub, + std::unique_ptr iampolicy_stub, std::unique_ptr locations_stub) : grpc_stub_(std::move(grpc_stub)), operations_stub_(std::move(operations_stub)), + iampolicy_stub_(std::move(iampolicy_stub)), locations_stub_(std::move(locations_stub)) {} - StatusOr CreateContent( + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateContentRequest const& request) - override; + google::cloud::location::ListLocationsRequest const& request) override; - StatusOr UpdateContent( + StatusOr GetLocation( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateContentRequest const& request) - override; - - Status DeleteContent(grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteContentRequest const& - request) override; + google::cloud::location::GetLocationRequest const& request) override; - StatusOr GetContent( + StatusOr SetIamPolicy( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetContentRequest const& request) override; + google::iam::v1::SetIamPolicyRequest const& request) override; StatusOr GetIamPolicy( grpc::ClientContext& context, Options const& options, google::iam::v1::GetIamPolicyRequest const& request) override; - StatusOr SetIamPolicy( - grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) override; - StatusOr TestIamPermissions( grpc::ClientContext& context, Options const& options, google::iam::v1::TestIamPermissionsRequest const& request) override; - StatusOr ListContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListContentRequest 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; @@ -177,6 +137,7 @@ class DefaultContentServiceStub : public ContentServiceStub { grpc_stub_; std::unique_ptr operations_stub_; + std::unique_ptr iampolicy_stub_; std::unique_ptr locations_stub_; }; diff --git a/google/cloud/dataplex/v1/internal/content_stub_factory.cc b/google/cloud/dataplex/v1/internal/content_stub_factory.cc index 3fccdef898b79..2b24323129179 100644 --- a/google/cloud/dataplex/v1/internal/content_stub_factory.cc +++ b/google/cloud/dataplex/v1/internal/content_stub_factory.cc @@ -30,6 +30,7 @@ #include "google/cloud/internal/opentelemetry.h" #include "google/cloud/log.h" #include "google/cloud/options.h" +#include "google/iam/v1/iam_policy.grpc.pb.h" #include "google/longrunning/operations.grpc.pb.h" #include #include @@ -51,12 +52,13 @@ std::shared_ptr CreateDefaultContentServiceStub( google::cloud::dataplex::v1::ContentService::NewStub(channel); auto service_operations_stub = google::longrunning::Operations::NewStub(channel); + auto service_iampolicy_stub = google::iam::v1::IAMPolicy::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_operations_stub), - std::move(service_locations_stub)); + std::move(service_iampolicy_stub), std::move(service_locations_stub)); if (auth->RequiresConfigureContext()) { stub = diff --git a/google/cloud/dataplex/v1/internal/content_tracing_connection.cc b/google/cloud/dataplex/v1/internal/content_tracing_connection.cc index cf64f1fe0f323..b6a78bd80603e 100644 --- a/google/cloud/dataplex/v1/internal/content_tracing_connection.cc +++ b/google/cloud/dataplex/v1/internal/content_tracing_connection.cc @@ -31,39 +31,32 @@ ContentServiceTracingConnection::ContentServiceTracingConnection( std::shared_ptr child) : child_(std::move(child)) {} -StatusOr -ContentServiceTracingConnection::CreateContent( - google::cloud::dataplex::v1::CreateContentRequest const& request) { - auto span = internal::MakeSpan( - "dataplex_v1::ContentServiceConnection::CreateContent"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->CreateContent(request)); -} - -StatusOr -ContentServiceTracingConnection::UpdateContent( - google::cloud::dataplex::v1::UpdateContentRequest const& request) { +StreamRange +ContentServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { auto span = internal::MakeSpan( - "dataplex_v1::ContentServiceConnection::UpdateContent"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->UpdateContent(request)); + "dataplex_v1::ContentServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); } -Status ContentServiceTracingConnection::DeleteContent( - google::cloud::dataplex::v1::DeleteContentRequest const& request) { - auto span = internal::MakeSpan( - "dataplex_v1::ContentServiceConnection::DeleteContent"); +StatusOr +ContentServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = + internal::MakeSpan("dataplex_v1::ContentServiceConnection::GetLocation"); auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->DeleteContent(request)); + return internal::EndSpan(*span, child_->GetLocation(request)); } -StatusOr -ContentServiceTracingConnection::GetContent( - google::cloud::dataplex::v1::GetContentRequest const& request) { +StatusOr ContentServiceTracingConnection::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { auto span = - internal::MakeSpan("dataplex_v1::ContentServiceConnection::GetContent"); + internal::MakeSpan("dataplex_v1::ContentServiceConnection::SetIamPolicy"); auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->GetContent(request)); + return internal::EndSpan(*span, child_->SetIamPolicy(request)); } StatusOr ContentServiceTracingConnection::GetIamPolicy( @@ -74,14 +67,6 @@ StatusOr ContentServiceTracingConnection::GetIamPolicy( return internal::EndSpan(*span, child_->GetIamPolicy(request)); } -StatusOr ContentServiceTracingConnection::SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request) { - auto span = - internal::MakeSpan("dataplex_v1::ContentServiceConnection::SetIamPolicy"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->SetIamPolicy(request)); -} - StatusOr ContentServiceTracingConnection::TestIamPermissions( google::iam::v1::TestIamPermissionsRequest const& request) { @@ -91,37 +76,6 @@ ContentServiceTracingConnection::TestIamPermissions( return internal::EndSpan(*span, child_->TestIamPermissions(request)); } -StreamRange -ContentServiceTracingConnection::ListContent( - google::cloud::dataplex::v1::ListContentRequest request) { - auto span = - internal::MakeSpan("dataplex_v1::ContentServiceConnection::ListContent"); - internal::OTelScope scope(span); - auto sr = child_->ListContent(std::move(request)); - return internal::MakeTracedStreamRange( - std::move(span), std::move(sr)); -} - -StreamRange -ContentServiceTracingConnection::ListLocations( - google::cloud::location::ListLocationsRequest request) { - auto span = internal::MakeSpan( - "dataplex_v1::ContentServiceConnection::ListLocations"); - internal::OTelScope scope(span); - auto sr = child_->ListLocations(std::move(request)); - return internal::MakeTracedStreamRange( - std::move(span), std::move(sr)); -} - -StatusOr -ContentServiceTracingConnection::GetLocation( - google::cloud::location::GetLocationRequest const& request) { - auto span = - internal::MakeSpan("dataplex_v1::ContentServiceConnection::GetLocation"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->GetLocation(request)); -} - StreamRange ContentServiceTracingConnection::ListOperations( google::longrunning::ListOperationsRequest request) { diff --git a/google/cloud/dataplex/v1/internal/content_tracing_connection.h b/google/cloud/dataplex/v1/internal/content_tracing_connection.h index 7e0b8a8b60fa7..f38e1d0f5181d 100644 --- a/google/cloud/dataplex/v1/internal/content_tracing_connection.h +++ b/google/cloud/dataplex/v1/internal/content_tracing_connection.h @@ -38,38 +38,21 @@ class ContentServiceTracingConnection Options options() override { return child_->options(); } - StatusOr CreateContent( - google::cloud::dataplex::v1::CreateContentRequest const& request) - override; - - StatusOr UpdateContent( - google::cloud::dataplex::v1::UpdateContentRequest const& request) - override; + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request) override; - Status DeleteContent(google::cloud::dataplex::v1::DeleteContentRequest const& - request) override; + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request) override; - StatusOr GetContent( - google::cloud::dataplex::v1::GetContentRequest const& request) override; + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) override; StatusOr GetIamPolicy( google::iam::v1::GetIamPolicyRequest const& request) override; - StatusOr SetIamPolicy( - google::iam::v1::SetIamPolicyRequest const& request) override; - StatusOr TestIamPermissions( google::iam::v1::TestIamPermissionsRequest const& request) override; - StreamRange ListContent( - google::cloud::dataplex::v1::ListContentRequest request) 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; diff --git a/google/cloud/dataplex/v1/internal/content_tracing_stub.cc b/google/cloud/dataplex/v1/internal/content_tracing_stub.cc index 0861e9c0d533c..a800704ece68c 100644 --- a/google/cloud/dataplex/v1/internal/content_tracing_stub.cc +++ b/google/cloud/dataplex/v1/internal/content_tracing_stub.cc @@ -33,51 +33,39 @@ ContentServiceTracingStub::ContentServiceTracingStub( std::shared_ptr child) : child_(std::move(child)), propagator_(internal::MakePropagator()) {} -StatusOr -ContentServiceTracingStub::CreateContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateContentRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.ContentService", - "CreateContent"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->CreateContent(context, options, request)); -} - -StatusOr -ContentServiceTracingStub::UpdateContent( +StatusOr +ContentServiceTracingStub::ListLocations( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateContentRequest const& request) { + google::cloud::location::ListLocationsRequest const& request) { auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.ContentService", - "UpdateContent"); + "ListLocations"); auto scope = opentelemetry::trace::Scope(span); internal::InjectTraceContext(context, *propagator_); return internal::EndSpan(context, *span, - child_->UpdateContent(context, options, request)); + child_->ListLocations(context, options, request)); } -Status ContentServiceTracingStub::DeleteContent( +StatusOr +ContentServiceTracingStub::GetLocation( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteContentRequest const& request) { + google::cloud::location::GetLocationRequest const& request) { auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.ContentService", - "DeleteContent"); + "GetLocation"); auto scope = opentelemetry::trace::Scope(span); internal::InjectTraceContext(context, *propagator_); return internal::EndSpan(context, *span, - child_->DeleteContent(context, options, request)); + child_->GetLocation(context, options, request)); } -StatusOr -ContentServiceTracingStub::GetContent( +StatusOr ContentServiceTracingStub::SetIamPolicy( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetContentRequest const& request) { + google::iam::v1::SetIamPolicyRequest const& request) { auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.ContentService", - "GetContent"); + "SetIamPolicy"); auto scope = opentelemetry::trace::Scope(span); internal::InjectTraceContext(context, *propagator_); return internal::EndSpan(context, *span, - child_->GetContent(context, options, request)); + child_->SetIamPolicy(context, options, request)); } StatusOr ContentServiceTracingStub::GetIamPolicy( @@ -91,17 +79,6 @@ StatusOr ContentServiceTracingStub::GetIamPolicy( child_->GetIamPolicy(context, options, request)); } -StatusOr ContentServiceTracingStub::SetIamPolicy( - grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.ContentService", - "SetIamPolicy"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->SetIamPolicy(context, options, request)); -} - StatusOr ContentServiceTracingStub::TestIamPermissions( grpc::ClientContext& context, Options const& options, @@ -114,42 +91,6 @@ ContentServiceTracingStub::TestIamPermissions( context, *span, child_->TestIamPermissions(context, options, request)); } -StatusOr -ContentServiceTracingStub::ListContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListContentRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.ContentService", - "ListContent"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->ListContent(context, options, request)); -} - -StatusOr -ContentServiceTracingStub::ListLocations( - grpc::ClientContext& context, Options const& options, - google::cloud::location::ListLocationsRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.ContentService", - "ListLocations"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->ListLocations(context, options, request)); -} - -StatusOr -ContentServiceTracingStub::GetLocation( - grpc::ClientContext& context, Options const& options, - google::cloud::location::GetLocationRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.ContentService", - "GetLocation"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->GetLocation(context, options, request)); -} - StatusOr ContentServiceTracingStub::ListOperations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/dataplex/v1/internal/content_tracing_stub.h b/google/cloud/dataplex/v1/internal/content_tracing_stub.h index 7f824737ba8f3..564b13deb87a3 100644 --- a/google/cloud/dataplex/v1/internal/content_tracing_stub.h +++ b/google/cloud/dataplex/v1/internal/content_tracing_stub.h @@ -39,48 +39,26 @@ class ContentServiceTracingStub : public ContentServiceStub { explicit ContentServiceTracingStub(std::shared_ptr child); - StatusOr CreateContent( + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateContentRequest const& request) - override; + google::cloud::location::ListLocationsRequest const& request) override; - StatusOr UpdateContent( + StatusOr GetLocation( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateContentRequest const& request) - override; - - Status DeleteContent(grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteContentRequest const& - request) override; + google::cloud::location::GetLocationRequest const& request) override; - StatusOr GetContent( + StatusOr SetIamPolicy( grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetContentRequest const& request) override; + google::iam::v1::SetIamPolicyRequest const& request) override; StatusOr GetIamPolicy( grpc::ClientContext& context, Options const& options, google::iam::v1::GetIamPolicyRequest const& request) override; - StatusOr SetIamPolicy( - grpc::ClientContext& context, Options const& options, - google::iam::v1::SetIamPolicyRequest const& request) override; - StatusOr TestIamPermissions( grpc::ClientContext& context, Options const& options, google::iam::v1::TestIamPermissionsRequest const& request) override; - StatusOr ListContent( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListContentRequest 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; diff --git a/google/cloud/dataplex/v1/internal/data_product_auth_decorator.cc b/google/cloud/dataplex/v1/internal/data_product_auth_decorator.cc new file mode 100644 index 0000000000000..180ce67f3e67a --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_auth_decorator.cc @@ -0,0 +1,363 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#include "google/cloud/dataplex/v1/internal/data_product_auth_decorator.h" +#include "google/cloud/dataplex/v1/data_products.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataProductServiceAuth::DataProductServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +future> +DataProductServiceAuth::AsyncCreateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataProductRequest 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->AsyncCreateDataProduct(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +DataProductServiceAuth::CreateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateDataProduct(context, options, request); +} + +future> +DataProductServiceAuth::AsyncDeleteDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataProductRequest 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->AsyncDeleteDataProduct(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +DataProductServiceAuth::DeleteDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteDataProduct(context, options, request); +} + +StatusOr +DataProductServiceAuth::GetDataProduct( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataProductRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetDataProduct(context, options, request); +} + +StatusOr +DataProductServiceAuth::ListDataProducts( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataProductsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListDataProducts(context, options, request); +} + +future> +DataProductServiceAuth::AsyncUpdateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataProductRequest 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->AsyncUpdateDataProduct(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +DataProductServiceAuth::UpdateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateDataProduct(context, options, request); +} + +future> +DataProductServiceAuth::AsyncCreateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataAssetRequest 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->AsyncCreateDataAsset(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +DataProductServiceAuth::CreateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateDataAsset(context, options, request); +} + +future> +DataProductServiceAuth::AsyncUpdateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataAssetRequest 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->AsyncUpdateDataAsset(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +DataProductServiceAuth::UpdateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateDataAsset(context, options, request); +} + +future> +DataProductServiceAuth::AsyncDeleteDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataAssetRequest 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->AsyncDeleteDataAsset(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +DataProductServiceAuth::DeleteDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteDataAsset(context, options, request); +} + +StatusOr +DataProductServiceAuth::GetDataAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataAssetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetDataAsset(context, options, request); +} + +StatusOr +DataProductServiceAuth::ListDataAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataAssetsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListDataAssets(context, options, request); +} + +StatusOr +DataProductServiceAuth::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 DataProductServiceAuth::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 DataProductServiceAuth::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->SetIamPolicy(context, options, request); +} + +StatusOr DataProductServiceAuth::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetIamPolicy(context, options, request); +} + +StatusOr +DataProductServiceAuth::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->TestIamPermissions(context, options, request); +} + +StatusOr +DataProductServiceAuth::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 DataProductServiceAuth::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 DataProductServiceAuth::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 DataProductServiceAuth::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> +DataProductServiceAuth::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 DataProductServiceAuth::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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/data_product_auth_decorator.h b/google/cloud/dataplex/v1/internal/data_product_auth_decorator.h new file mode 100644 index 0000000000000..d16e059c25b97 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_auth_decorator.h @@ -0,0 +1,196 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_AUTH_DECORATOR_H + +#include "google/cloud/dataplex/v1/internal/data_product_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataProductServiceAuth : public DataProductServiceStub { + public: + ~DataProductServiceAuth() override = default; + DataProductServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + future> AsyncCreateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + StatusOr CreateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + future> AsyncDeleteDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) + override; + + StatusOr DeleteDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) + override; + + StatusOr GetDataProduct( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataProductRequest const& request) + override; + + StatusOr + ListDataProducts(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataProductsRequest const& + request) override; + + future> AsyncUpdateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + StatusOr UpdateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + future> AsyncCreateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + StatusOr CreateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + future> AsyncUpdateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + StatusOr UpdateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + future> AsyncDeleteDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) + override; + + StatusOr DeleteDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) + override; + + StatusOr GetDataAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataAssetRequest const& request) override; + + StatusOr ListDataAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataAssetsRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_AUTH_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/data_product_connection_impl.cc b/google/cloud/dataplex/v1/internal/data_product_connection_impl.cc new file mode 100644 index 0000000000000..56806416e52f0 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_connection_impl.cc @@ -0,0 +1,886 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#include "google/cloud/dataplex/v1/internal/data_product_connection_impl.h" +#include "google/cloud/dataplex/v1/internal/data_product_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 dataplex_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 + +DataProductServiceConnectionImpl::DataProductServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions( + std::move(options), DataProductServiceConnection::options())) {} + +future> +DataProductServiceConnectionImpl::CreateDataProduct( + google::cloud::dataplex::v1::CreateDataProductRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateDataProduct(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::v1::DataProduct>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataProductRequest const& + request) { + return stub->AsyncCreateDataProduct(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::dataplex::v1::DataProduct>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +DataProductServiceConnectionImpl::CreateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateDataProduct(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateDataProductRequest const& + request) { + return stub_->CreateDataProduct(context, options, request); + }, + *current, request, __func__); +} + +future> +DataProductServiceConnectionImpl::CreateDataProduct( + 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 CreateDataProduct", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::v1::DataProduct>( + 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::dataplex::v1::DataProduct>, + polling_policy(*current), __func__); +} + +future> +DataProductServiceConnectionImpl::DeleteDataProduct( + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteDataProduct(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::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::dataplex::v1::DeleteDataProductRequest const& + request) { + return stub->AsyncDeleteDataProduct(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::dataplex::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +DataProductServiceConnectionImpl::DeleteDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteDataProduct(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& + request) { + return stub_->DeleteDataProduct(context, options, request); + }, + *current, request, __func__); +} + +future> +DataProductServiceConnectionImpl::DeleteDataProduct( + 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 DeleteDataProduct", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::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::dataplex::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StatusOr +DataProductServiceConnectionImpl::GetDataProduct( + google::cloud::dataplex::v1::GetDataProductRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetDataProduct(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataProductRequest const& request) { + return stub_->GetDataProduct(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +DataProductServiceConnectionImpl::ListDataProducts( + google::cloud::dataplex::v1::ListDataProductsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListDataProducts(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::dataplex::v1::ListDataProductsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataProductsRequest const& + request) { + return stub->ListDataProducts(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::dataplex::v1::ListDataProductsResponse r) { + std::vector result( + r.data_products().size()); + auto& messages = *r.mutable_data_products(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +future> +DataProductServiceConnectionImpl::UpdateDataProduct( + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateDataProduct(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::v1::DataProduct>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& + request) { + return stub->AsyncUpdateDataProduct(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::dataplex::v1::DataProduct>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +DataProductServiceConnectionImpl::UpdateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateDataProduct(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& + request) { + return stub_->UpdateDataProduct(context, options, request); + }, + *current, request, __func__); +} + +future> +DataProductServiceConnectionImpl::UpdateDataProduct( + 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 UpdateDataProduct", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::v1::DataProduct>( + 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::dataplex::v1::DataProduct>, + polling_policy(*current), __func__); +} + +future> +DataProductServiceConnectionImpl::CreateDataAsset( + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateDataAsset(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::v1::DataAsset>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + return stub->AsyncCreateDataAsset(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::dataplex::v1::DataAsset>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +DataProductServiceConnectionImpl::CreateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateDataAsset(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + return stub_->CreateDataAsset(context, options, request); + }, + *current, request, __func__); +} + +future> +DataProductServiceConnectionImpl::CreateDataAsset( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateDataAsset", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::v1::DataAsset>( + 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::dataplex::v1::DataAsset>, + polling_policy(*current), __func__); +} + +future> +DataProductServiceConnectionImpl::UpdateDataAsset( + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateDataAsset(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::v1::DataAsset>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + return stub->AsyncUpdateDataAsset(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::dataplex::v1::DataAsset>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +DataProductServiceConnectionImpl::UpdateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateDataAsset(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + return stub_->UpdateDataAsset(context, options, request); + }, + *current, request, __func__); +} + +future> +DataProductServiceConnectionImpl::UpdateDataAsset( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateDataAsset", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::v1::DataAsset>( + 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::dataplex::v1::DataAsset>, + polling_policy(*current), __func__); +} + +future> +DataProductServiceConnectionImpl::DeleteDataAsset( + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteDataAsset(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::dataplex::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::dataplex::v1::DeleteDataAssetRequest const& request) { + return stub->AsyncDeleteDataAsset(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::dataplex::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +DataProductServiceConnectionImpl::DeleteDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteDataAsset(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + return stub_->DeleteDataAsset(context, options, request); + }, + *current, request, __func__); +} + +future> +DataProductServiceConnectionImpl::DeleteDataAsset( + 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 DeleteDataAsset", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::dataplex::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::dataplex::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StatusOr +DataProductServiceConnectionImpl::GetDataAsset( + google::cloud::dataplex::v1::GetDataAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetDataAsset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataAssetRequest const& request) { + return stub_->GetDataAsset(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +DataProductServiceConnectionImpl::ListDataAssets( + google::cloud::dataplex::v1::ListDataAssetsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListDataAssets(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::dataplex::v1::ListDataAssetsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataAssetsRequest const& + request) { + return stub->ListDataAssets(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::dataplex::v1::ListDataAssetsResponse r) { + std::vector result( + r.data_assets().size()); + auto& messages = *r.mutable_data_assets(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StreamRange +DataProductServiceConnectionImpl::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 +DataProductServiceConnectionImpl::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__); +} + +StatusOr +DataProductServiceConnectionImpl::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->SetIamPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + return stub_->SetIamPolicy(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +DataProductServiceConnectionImpl::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetIamPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + return stub_->GetIamPolicy(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +DataProductServiceConnectionImpl::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->TestIamPermissions(request), + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + return stub_->TestIamPermissions(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +DataProductServiceConnectionImpl::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 +DataProductServiceConnectionImpl::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 DataProductServiceConnectionImpl::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 DataProductServiceConnectionImpl::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 dataplex_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/internal/data_product_connection_impl.h b/google/cloud/dataplex/v1/internal/data_product_connection_impl.h new file mode 100644 index 0000000000000..c198848f86cc3 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_connection_impl.h @@ -0,0 +1,178 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_CONNECTION_IMPL_H + +#include "google/cloud/dataplex/v1/data_product_connection.h" +#include "google/cloud/dataplex/v1/data_product_connection_idempotency_policy.h" +#include "google/cloud/dataplex/v1/data_product_options.h" +#include "google/cloud/dataplex/v1/internal/data_product_retry_traits.h" +#include "google/cloud/dataplex/v1/internal/data_product_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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataProductServiceConnectionImpl + : public dataplex_v1::DataProductServiceConnection { + public: + ~DataProductServiceConnectionImpl() override = default; + + DataProductServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + future> CreateDataProduct( + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + StatusOr CreateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + future> CreateDataProduct( + google::longrunning::Operation const& operation) override; + + future> + DeleteDataProduct(google::cloud::dataplex::v1::DeleteDataProductRequest const& + request) override; + + StatusOr DeleteDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) + override; + + future> + DeleteDataProduct(google::longrunning::Operation const& operation) override; + + StatusOr GetDataProduct( + google::cloud::dataplex::v1::GetDataProductRequest const& request) + override; + + StreamRange ListDataProducts( + google::cloud::dataplex::v1::ListDataProductsRequest request) override; + + future> UpdateDataProduct( + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + StatusOr UpdateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + future> UpdateDataProduct( + google::longrunning::Operation const& operation) override; + + future> CreateDataAsset( + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + StatusOr CreateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + future> CreateDataAsset( + google::longrunning::Operation const& operation) override; + + future> UpdateDataAsset( + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + StatusOr UpdateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + future> UpdateDataAsset( + google::longrunning::Operation const& operation) override; + + future> + DeleteDataAsset(google::cloud::dataplex::v1::DeleteDataAssetRequest const& + request) override; + + StatusOr DeleteDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) + override; + + future> + DeleteDataAsset(google::longrunning::Operation const& operation) override; + + StatusOr GetDataAsset( + google::cloud::dataplex::v1::GetDataAssetRequest const& request) override; + + StreamRange ListDataAssets( + google::cloud::dataplex::v1::ListDataAssetsRequest request) override; + + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request) override; + + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest 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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_CONNECTION_IMPL_H diff --git a/google/cloud/dataplex/v1/internal/data_product_logging_decorator.cc b/google/cloud/dataplex/v1/internal/data_product_logging_decorator.cc new file mode 100644 index 0000000000000..227c8c444a967 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_logging_decorator.cc @@ -0,0 +1,428 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#include "google/cloud/dataplex/v1/internal/data_product_logging_decorator.h" +#include "google/cloud/dataplex/v1/data_products.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataProductServiceLogging::DataProductServiceLogging( + std::shared_ptr child, + TracingOptions tracing_options, std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +future> +DataProductServiceLogging::AsyncCreateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataProductRequest const& + request) { + return child_->AsyncCreateDataProduct(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +DataProductServiceLogging::CreateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateDataProductRequest const& + request) { + return child_->CreateDataProduct(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +DataProductServiceLogging::AsyncDeleteDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& + request) { + return child_->AsyncDeleteDataProduct(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +DataProductServiceLogging::DeleteDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& + request) { + return child_->DeleteDataProduct(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataProductServiceLogging::GetDataProduct( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataProductRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataProductRequest const& request) { + return child_->GetDataProduct(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataProductServiceLogging::ListDataProducts( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataProductsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataProductsRequest const& request) { + return child_->ListDataProducts(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +DataProductServiceLogging::AsyncUpdateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& + request) { + return child_->AsyncUpdateDataProduct(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +DataProductServiceLogging::UpdateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& + request) { + return child_->UpdateDataProduct(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +DataProductServiceLogging::AsyncCreateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + return child_->AsyncCreateDataAsset(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +DataProductServiceLogging::CreateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + return child_->CreateDataAsset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +DataProductServiceLogging::AsyncUpdateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + return child_->AsyncUpdateDataAsset(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +DataProductServiceLogging::UpdateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + return child_->UpdateDataAsset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +DataProductServiceLogging::AsyncDeleteDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + return child_->AsyncDeleteDataAsset(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +DataProductServiceLogging::DeleteDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + return child_->DeleteDataAsset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataProductServiceLogging::GetDataAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataAssetRequest const& request) { + return child_->GetDataAsset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataProductServiceLogging::ListDataAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataAssetsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataAssetsRequest const& request) { + return child_->ListDataAssets(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataProductServiceLogging::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 +DataProductServiceLogging::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 DataProductServiceLogging::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + return child_->SetIamPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr DataProductServiceLogging::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + return child_->GetIamPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataProductServiceLogging::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + return child_->TestIamPermissions(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataProductServiceLogging::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 +DataProductServiceLogging::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 DataProductServiceLogging::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 DataProductServiceLogging::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> +DataProductServiceLogging::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 DataProductServiceLogging::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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/data_product_logging_decorator.h b/google/cloud/dataplex/v1/internal/data_product_logging_decorator.h new file mode 100644 index 0000000000000..8f91d09635ab1 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_logging_decorator.h @@ -0,0 +1,196 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_LOGGING_DECORATOR_H + +#include "google/cloud/dataplex/v1/internal/data_product_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataProductServiceLogging : public DataProductServiceStub { + public: + ~DataProductServiceLogging() override = default; + DataProductServiceLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + future> AsyncCreateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + StatusOr CreateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + future> AsyncDeleteDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) + override; + + StatusOr DeleteDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) + override; + + StatusOr GetDataProduct( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataProductRequest const& request) + override; + + StatusOr + ListDataProducts(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataProductsRequest const& + request) override; + + future> AsyncUpdateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + StatusOr UpdateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + future> AsyncCreateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + StatusOr CreateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + future> AsyncUpdateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + StatusOr UpdateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + future> AsyncDeleteDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) + override; + + StatusOr DeleteDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) + override; + + StatusOr GetDataAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataAssetRequest const& request) override; + + StatusOr ListDataAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataAssetsRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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_; +}; // DataProductServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_LOGGING_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/data_product_metadata_decorator.cc b/google/cloud/dataplex/v1/internal/data_product_metadata_decorator.cc new file mode 100644 index 0000000000000..19cab20131d83 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_metadata_decorator.cc @@ -0,0 +1,338 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#include "google/cloud/dataplex/v1/internal/data_product_metadata_decorator.h" +#include "google/cloud/dataplex/v1/data_products.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataProductServiceMetadata::DataProductServiceMetadata( + 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)) {} + +future> +DataProductServiceMetadata::AsyncCreateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateDataProduct(cq, std::move(context), + std::move(options), request); +} + +StatusOr +DataProductServiceMetadata::CreateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateDataProduct(context, options, request); +} + +future> +DataProductServiceMetadata::AsyncDeleteDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteDataProduct(cq, std::move(context), + std::move(options), request); +} + +StatusOr +DataProductServiceMetadata::DeleteDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteDataProduct(context, options, request); +} + +StatusOr +DataProductServiceMetadata::GetDataProduct( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataProductRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetDataProduct(context, options, request); +} + +StatusOr +DataProductServiceMetadata::ListDataProducts( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataProductsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListDataProducts(context, options, request); +} + +future> +DataProductServiceMetadata::AsyncUpdateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("data_product.name=", + internal::UrlEncode(request.data_product().name()))); + return child_->AsyncUpdateDataProduct(cq, std::move(context), + std::move(options), request); +} + +StatusOr +DataProductServiceMetadata::UpdateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) { + SetMetadata(context, options, + absl::StrCat("data_product.name=", + internal::UrlEncode(request.data_product().name()))); + return child_->UpdateDataProduct(context, options, request); +} + +future> +DataProductServiceMetadata::AsyncCreateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateDataAsset(cq, std::move(context), + std::move(options), request); +} + +StatusOr +DataProductServiceMetadata::CreateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateDataAsset(context, options, request); +} + +future> +DataProductServiceMetadata::AsyncUpdateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("data_asset.name=", + internal::UrlEncode(request.data_asset().name()))); + return child_->AsyncUpdateDataAsset(cq, std::move(context), + std::move(options), request); +} + +StatusOr +DataProductServiceMetadata::UpdateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("data_asset.name=", + internal::UrlEncode(request.data_asset().name()))); + return child_->UpdateDataAsset(context, options, request); +} + +future> +DataProductServiceMetadata::AsyncDeleteDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteDataAsset(cq, std::move(context), + std::move(options), request); +} + +StatusOr +DataProductServiceMetadata::DeleteDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteDataAsset(context, options, request); +} + +StatusOr +DataProductServiceMetadata::GetDataAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataAssetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetDataAsset(context, options, request); +} + +StatusOr +DataProductServiceMetadata::ListDataAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataAssetsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListDataAssets(context, options, request); +} + +StatusOr +DataProductServiceMetadata::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 +DataProductServiceMetadata::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 DataProductServiceMetadata::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("resource=", internal::UrlEncode(request.resource()))); + return child_->SetIamPolicy(context, options, request); +} + +StatusOr DataProductServiceMetadata::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("resource=", internal::UrlEncode(request.resource()))); + return child_->GetIamPolicy(context, options, request); +} + +StatusOr +DataProductServiceMetadata::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("resource=", internal::UrlEncode(request.resource()))); + return child_->TestIamPermissions(context, options, request); +} + +StatusOr +DataProductServiceMetadata::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 +DataProductServiceMetadata::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 DataProductServiceMetadata::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 DataProductServiceMetadata::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> +DataProductServiceMetadata::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 DataProductServiceMetadata::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 DataProductServiceMetadata::SetMetadata( + grpc::ClientContext& context, Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void DataProductServiceMetadata::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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/data_product_metadata_decorator.h b/google/cloud/dataplex/v1/internal/data_product_metadata_decorator.h new file mode 100644 index 0000000000000..b7d106849c445 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_metadata_decorator.h @@ -0,0 +1,202 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_METADATA_DECORATOR_H + +#include "google/cloud/dataplex/v1/internal/data_product_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataProductServiceMetadata : public DataProductServiceStub { + public: + ~DataProductServiceMetadata() override = default; + DataProductServiceMetadata( + std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + future> AsyncCreateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + StatusOr CreateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + future> AsyncDeleteDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) + override; + + StatusOr DeleteDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) + override; + + StatusOr GetDataProduct( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataProductRequest const& request) + override; + + StatusOr + ListDataProducts(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataProductsRequest const& + request) override; + + future> AsyncUpdateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + StatusOr UpdateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + future> AsyncCreateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + StatusOr CreateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + future> AsyncUpdateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + StatusOr UpdateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + future> AsyncDeleteDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) + override; + + StatusOr DeleteDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) + override; + + StatusOr GetDataAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataAssetRequest const& request) override; + + StatusOr ListDataAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataAssetsRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_METADATA_DECORATOR_H diff --git a/google/cloud/dataplex/v1/internal/data_product_option_defaults.cc b/google/cloud/dataplex/v1/internal/data_product_option_defaults.cc new file mode 100644 index 0000000000000..8b56bc6f8a2ce --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_option_defaults.cc @@ -0,0 +1,81 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#include "google/cloud/dataplex/v1/internal/data_product_option_defaults.h" +#include "google/cloud/dataplex/v1/data_product_connection.h" +#include "google/cloud/dataplex/v1/data_product_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 dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options DataProductServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_DATA_PRODUCT_SERVICE_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_DATA_PRODUCT_SERVICE_AUTHORITY", + "dataplex.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + dataplex_v1::DataProductServiceLimitedTimeRetryPolicy( + std::chrono::minutes(10)) + .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< + dataplex_v1::DataProductServiceRetryPolicyOption::Type, + dataplex_v1::DataProductServiceBackoffPolicyOption::Type>( + options.get() + ->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } + if (!options.has< + dataplex_v1::DataProductServiceConnectionIdempotencyPolicyOption>()) { + options + .set( + dataplex_v1:: + MakeDefaultDataProductServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/internal/data_product_option_defaults.h b/google/cloud/dataplex/v1/internal/data_product_option_defaults.h new file mode 100644 index 0000000000000..751d08e336adb --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options DataProductServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_OPTION_DEFAULTS_H diff --git a/google/cloud/dataplex/v1/internal/data_product_retry_traits.h b/google/cloud/dataplex/v1/internal/data_product_retry_traits.h new file mode 100644 index 0000000000000..d39c5dca62618 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct DataProductServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_RETRY_TRAITS_H diff --git a/google/cloud/dataplex/v1/internal/data_product_sources.cc b/google/cloud/dataplex/v1/internal/data_product_sources.cc new file mode 100644 index 0000000000000..3d0d023632064 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/dataplex/v1/data_product_client.cc" +#include "google/cloud/dataplex/v1/data_product_connection.cc" +#include "google/cloud/dataplex/v1/data_product_connection_idempotency_policy.cc" +#include "google/cloud/dataplex/v1/internal/data_product_auth_decorator.cc" +#include "google/cloud/dataplex/v1/internal/data_product_connection_impl.cc" +#include "google/cloud/dataplex/v1/internal/data_product_logging_decorator.cc" +#include "google/cloud/dataplex/v1/internal/data_product_metadata_decorator.cc" +#include "google/cloud/dataplex/v1/internal/data_product_option_defaults.cc" +#include "google/cloud/dataplex/v1/internal/data_product_stub.cc" +#include "google/cloud/dataplex/v1/internal/data_product_stub_factory.cc" +#include "google/cloud/dataplex/v1/internal/data_product_tracing_connection.cc" +#include "google/cloud/dataplex/v1/internal/data_product_tracing_stub.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/dataplex/v1/internal/data_product_stub.cc b/google/cloud/dataplex/v1/internal/data_product_stub.cc new file mode 100644 index 0000000000000..6ea2e47f4159c --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_stub.cc @@ -0,0 +1,417 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#include "google/cloud/dataplex/v1/internal/data_product_stub.h" +#include "google/cloud/dataplex/v1/data_products.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataProductServiceStub::~DataProductServiceStub() = default; + +future> +DefaultDataProductServiceStub::AsyncCreateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::CreateDataProductRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::dataplex::v1::CreateDataProductRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateDataProduct(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultDataProductServiceStub::CreateDataProduct( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateDataProduct(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultDataProductServiceStub::AsyncDeleteDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::DeleteDataProductRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteDataProduct(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultDataProductServiceStub::DeleteDataProduct( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteDataProduct(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataProductServiceStub::GetDataProduct( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::GetDataProductRequest const& request) { + google::cloud::dataplex::v1::DataProduct response; + auto status = grpc_stub_->GetDataProduct(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataProductServiceStub::ListDataProducts( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::ListDataProductsRequest const& request) { + google::cloud::dataplex::v1::ListDataProductsResponse response; + auto status = grpc_stub_->ListDataProducts(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultDataProductServiceStub::AsyncUpdateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::UpdateDataProductRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateDataProduct(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultDataProductServiceStub::UpdateDataProduct( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateDataProduct(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultDataProductServiceStub::AsyncCreateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::CreateDataAssetRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateDataAsset(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultDataProductServiceStub::CreateDataAsset( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateDataAsset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultDataProductServiceStub::AsyncUpdateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::UpdateDataAssetRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateDataAsset(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultDataProductServiceStub::UpdateDataAsset( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateDataAsset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultDataProductServiceStub::AsyncDeleteDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::dataplex::v1::DeleteDataAssetRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteDataAsset(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultDataProductServiceStub::DeleteDataAsset( + grpc::ClientContext& context, Options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteDataAsset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataProductServiceStub::GetDataAsset( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::GetDataAssetRequest const& request) { + google::cloud::dataplex::v1::DataAsset response; + auto status = grpc_stub_->GetDataAsset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataProductServiceStub::ListDataAssets( + grpc::ClientContext& context, Options const&, + google::cloud::dataplex::v1::ListDataAssetsRequest const& request) { + google::cloud::dataplex::v1::ListDataAssetsResponse response; + auto status = grpc_stub_->ListDataAssets(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataProductServiceStub::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 +DefaultDataProductServiceStub::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 DefaultDataProductServiceStub::SetIamPolicy( + grpc::ClientContext& context, Options const&, + google::iam::v1::SetIamPolicyRequest const& request) { + google::iam::v1::Policy response; + auto status = iampolicy_stub_->SetIamPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultDataProductServiceStub::GetIamPolicy( + grpc::ClientContext& context, Options const&, + google::iam::v1::GetIamPolicyRequest const& request) { + google::iam::v1::Policy response; + auto status = iampolicy_stub_->GetIamPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataProductServiceStub::TestIamPermissions( + grpc::ClientContext& context, Options const&, + google::iam::v1::TestIamPermissionsRequest const& request) { + google::iam::v1::TestIamPermissionsResponse response; + auto status = + iampolicy_stub_->TestIamPermissions(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataProductServiceStub::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 +DefaultDataProductServiceStub::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 DefaultDataProductServiceStub::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 DefaultDataProductServiceStub::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> +DefaultDataProductServiceStub::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 DefaultDataProductServiceStub::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 dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/data_product_stub.h b/google/cloud/dataplex/v1/internal/data_product_stub.h new file mode 100644 index 0000000000000..e13811f083368 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_stub.h @@ -0,0 +1,351 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_STUB_H + +#include "google/cloud/dataplex/v1/data_products.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.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 "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataProductServiceStub { + public: + virtual ~DataProductServiceStub() = 0; + + virtual future> + AsyncCreateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) = 0; + + virtual StatusOr CreateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) = 0; + + virtual future> + AsyncDeleteDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) = 0; + + virtual StatusOr DeleteDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) = 0; + + virtual StatusOr GetDataProduct( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataProductRequest const& request) = 0; + + virtual StatusOr + ListDataProducts( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataProductsRequest const& request) = 0; + + virtual future> + AsyncUpdateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) = 0; + + virtual StatusOr UpdateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) = 0; + + virtual future> AsyncCreateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) = 0; + + virtual StatusOr CreateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) = 0; + + virtual future> AsyncUpdateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) = 0; + + virtual StatusOr UpdateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) = 0; + + virtual future> AsyncDeleteDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) = 0; + + virtual StatusOr DeleteDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) = 0; + + virtual StatusOr GetDataAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataAssetRequest const& request) = 0; + + virtual StatusOr + ListDataAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataAssetsRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) = 0; + + virtual StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) = 0; + + virtual StatusOr + TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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 DefaultDataProductServiceStub : public DataProductServiceStub { + public: + DefaultDataProductServiceStub( + std::unique_ptr< + google::cloud::dataplex::v1::DataProductService::StubInterface> + grpc_stub, + std::unique_ptr iampolicy_stub, + std::unique_ptr + locations_stub, + std::unique_ptr + operations_stub) + : grpc_stub_(std::move(grpc_stub)), + iampolicy_stub_(std::move(iampolicy_stub)), + locations_stub_(std::move(locations_stub)), + operations_stub_(std::move(operations_stub)) {} + + future> AsyncCreateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + StatusOr CreateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + future> AsyncDeleteDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) + override; + + StatusOr DeleteDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) + override; + + StatusOr GetDataProduct( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataProductRequest const& request) + override; + + StatusOr + ListDataProducts(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataProductsRequest const& + request) override; + + future> AsyncUpdateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + StatusOr UpdateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + future> AsyncCreateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + StatusOr CreateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + future> AsyncUpdateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + StatusOr UpdateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + future> AsyncDeleteDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) + override; + + StatusOr DeleteDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) + override; + + StatusOr GetDataAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataAssetRequest const& request) override; + + StatusOr ListDataAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataAssetsRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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::dataplex::v1::DataProductService::StubInterface> + grpc_stub_; + std::unique_ptr iampolicy_stub_; + std::unique_ptr + locations_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_STUB_H diff --git a/google/cloud/dataplex/v1/internal/data_product_stub_factory.cc b/google/cloud/dataplex/v1/internal/data_product_stub_factory.cc new file mode 100644 index 0000000000000..9ca47146be784 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_stub_factory.cc @@ -0,0 +1,85 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#include "google/cloud/dataplex/v1/internal/data_product_stub_factory.h" +#include "google/cloud/dataplex/v1/data_products.grpc.pb.h" +#include "google/cloud/dataplex/v1/internal/data_product_auth_decorator.h" +#include "google/cloud/dataplex/v1/internal/data_product_logging_decorator.h" +#include "google/cloud/dataplex/v1/internal/data_product_metadata_decorator.h" +#include "google/cloud/dataplex/v1/internal/data_product_stub.h" +#include "google/cloud/dataplex/v1/internal/data_product_tracing_stub.h" +#include "google/cloud/location/locations.grpc.pb.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 "google/iam/v1/iam_policy.grpc.pb.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultDataProductServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::dataplex::v1::DataProductService::NewStub(channel); + auto service_iampolicy_stub = google::iam::v1::IAMPolicy::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_iampolicy_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 = MakeDataProductServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/data_product_stub_factory.h b/google/cloud/dataplex/v1/internal/data_product_stub_factory.h new file mode 100644 index 0000000000000..c1f8333e82a36 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_STUB_FACTORY_H + +#include "google/cloud/dataplex/v1/internal/data_product_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultDataProductServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_STUB_FACTORY_H diff --git a/google/cloud/dataplex/v1/internal/data_product_tracing_connection.cc b/google/cloud/dataplex/v1/internal/data_product_tracing_connection.cc new file mode 100644 index 0000000000000..7bbfb3539f032 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_tracing_connection.cc @@ -0,0 +1,347 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#include "google/cloud/dataplex/v1/internal/data_product_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataProductServiceTracingConnection::DataProductServiceTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +future> +DataProductServiceTracingConnection::CreateDataProduct( + google::cloud::dataplex::v1::CreateDataProductRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::CreateDataProduct"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateDataProduct(request)); +} + +StatusOr +DataProductServiceTracingConnection::CreateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::CreateDataProduct"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateDataProduct(NoAwaitTag{}, request)); +} + +future> +DataProductServiceTracingConnection::CreateDataProduct( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::CreateDataProduct"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateDataProduct(operation)); +} + +future> +DataProductServiceTracingConnection::DeleteDataProduct( + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::DeleteDataProduct"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteDataProduct(request)); +} + +StatusOr +DataProductServiceTracingConnection::DeleteDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::DeleteDataProduct"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteDataProduct(NoAwaitTag{}, request)); +} + +future> +DataProductServiceTracingConnection::DeleteDataProduct( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::DeleteDataProduct"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteDataProduct(operation)); +} + +StatusOr +DataProductServiceTracingConnection::GetDataProduct( + google::cloud::dataplex::v1::GetDataProductRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::GetDataProduct"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetDataProduct(request)); +} + +StreamRange +DataProductServiceTracingConnection::ListDataProducts( + google::cloud::dataplex::v1::ListDataProductsRequest request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::ListDataProducts"); + internal::OTelScope scope(span); + auto sr = child_->ListDataProducts(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::dataplex::v1::DataProduct>(std::move(span), std::move(sr)); +} + +future> +DataProductServiceTracingConnection::UpdateDataProduct( + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::UpdateDataProduct"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateDataProduct(request)); +} + +StatusOr +DataProductServiceTracingConnection::UpdateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::UpdateDataProduct"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateDataProduct(NoAwaitTag{}, request)); +} + +future> +DataProductServiceTracingConnection::UpdateDataProduct( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::UpdateDataProduct"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateDataProduct(operation)); +} + +future> +DataProductServiceTracingConnection::CreateDataAsset( + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::CreateDataAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateDataAsset(request)); +} + +StatusOr +DataProductServiceTracingConnection::CreateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::CreateDataAsset"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateDataAsset(NoAwaitTag{}, request)); +} + +future> +DataProductServiceTracingConnection::CreateDataAsset( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::CreateDataAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateDataAsset(operation)); +} + +future> +DataProductServiceTracingConnection::UpdateDataAsset( + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::UpdateDataAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateDataAsset(request)); +} + +StatusOr +DataProductServiceTracingConnection::UpdateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::UpdateDataAsset"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateDataAsset(NoAwaitTag{}, request)); +} + +future> +DataProductServiceTracingConnection::UpdateDataAsset( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::UpdateDataAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateDataAsset(operation)); +} + +future> +DataProductServiceTracingConnection::DeleteDataAsset( + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::DeleteDataAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteDataAsset(request)); +} + +StatusOr +DataProductServiceTracingConnection::DeleteDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::DeleteDataAsset"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteDataAsset(NoAwaitTag{}, request)); +} + +future> +DataProductServiceTracingConnection::DeleteDataAsset( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::DeleteDataAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteDataAsset(operation)); +} + +StatusOr +DataProductServiceTracingConnection::GetDataAsset( + google::cloud::dataplex::v1::GetDataAssetRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::GetDataAsset"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetDataAsset(request)); +} + +StreamRange +DataProductServiceTracingConnection::ListDataAssets( + google::cloud::dataplex::v1::ListDataAssetsRequest request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::ListDataAssets"); + internal::OTelScope scope(span); + auto sr = child_->ListDataAssets(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::dataplex::v1::DataAsset>(std::move(span), std::move(sr)); +} + +StreamRange +DataProductServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +DataProductServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StatusOr +DataProductServiceTracingConnection::SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::SetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->SetIamPolicy(request)); +} + +StatusOr +DataProductServiceTracingConnection::GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::GetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetIamPolicy(request)); +} + +StatusOr +DataProductServiceTracingConnection::TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::TestIamPermissions"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->TestIamPermissions(request)); +} + +StreamRange +DataProductServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +DataProductServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status DataProductServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status DataProductServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "dataplex_v1::DataProductServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeDataProductServiceTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = + std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/dataplex/v1/internal/data_product_tracing_connection.h b/google/cloud/dataplex/v1/internal/data_product_tracing_connection.h new file mode 100644 index 0000000000000..c4051716c9d99 --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_tracing_connection.h @@ -0,0 +1,172 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_TRACING_CONNECTION_H + +#include "google/cloud/dataplex/v1/data_product_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataProductServiceTracingConnection + : public dataplex_v1::DataProductServiceConnection { + public: + ~DataProductServiceTracingConnection() override = default; + + explicit DataProductServiceTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + future> CreateDataProduct( + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + StatusOr CreateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + future> CreateDataProduct( + google::longrunning::Operation const& operation) override; + + future> + DeleteDataProduct(google::cloud::dataplex::v1::DeleteDataProductRequest const& + request) override; + + StatusOr DeleteDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) + override; + + future> + DeleteDataProduct(google::longrunning::Operation const& operation) override; + + StatusOr GetDataProduct( + google::cloud::dataplex::v1::GetDataProductRequest const& request) + override; + + StreamRange ListDataProducts( + google::cloud::dataplex::v1::ListDataProductsRequest request) override; + + future> UpdateDataProduct( + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + StatusOr UpdateDataProduct( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + future> UpdateDataProduct( + google::longrunning::Operation const& operation) override; + + future> CreateDataAsset( + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + StatusOr CreateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + future> CreateDataAsset( + google::longrunning::Operation const& operation) override; + + future> UpdateDataAsset( + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + StatusOr UpdateDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + future> UpdateDataAsset( + google::longrunning::Operation const& operation) override; + + future> + DeleteDataAsset(google::cloud::dataplex::v1::DeleteDataAssetRequest const& + request) override; + + StatusOr DeleteDataAsset( + NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) + override; + + future> + DeleteDataAsset(google::longrunning::Operation const& operation) override; + + StatusOr GetDataAsset( + google::cloud::dataplex::v1::GetDataAssetRequest const& request) override; + + StreamRange ListDataAssets( + google::cloud::dataplex::v1::ListDataAssetsRequest request) override; + + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request) override; + + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr SetIamPolicy( + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + google::iam::v1::TestIamPermissionsRequest 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_; +}; + +/** + * 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 +MakeDataProductServiceTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_TRACING_CONNECTION_H diff --git a/google/cloud/dataplex/v1/internal/data_product_tracing_stub.cc b/google/cloud/dataplex/v1/internal/data_product_tracing_stub.cc new file mode 100644 index 0000000000000..f2428466d80ec --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_tracing_stub.cc @@ -0,0 +1,388 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#include "google/cloud/dataplex/v1/internal/data_product_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataProductServiceTracingStub::DataProductServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +future> +DataProductServiceTracingStub::AsyncCreateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "CreateDataProduct"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateDataProduct(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +DataProductServiceTracingStub::CreateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "CreateDataProduct"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->CreateDataProduct(context, options, request)); +} + +future> +DataProductServiceTracingStub::AsyncDeleteDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "DeleteDataProduct"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteDataProduct(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +DataProductServiceTracingStub::DeleteDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "DeleteDataProduct"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteDataProduct(context, options, request)); +} + +StatusOr +DataProductServiceTracingStub::GetDataProduct( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataProductRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "GetDataProduct"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetDataProduct(context, options, request)); +} + +StatusOr +DataProductServiceTracingStub::ListDataProducts( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataProductsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "ListDataProducts"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListDataProducts(context, options, request)); +} + +future> +DataProductServiceTracingStub::AsyncUpdateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "UpdateDataProduct"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateDataProduct(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +DataProductServiceTracingStub::UpdateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "UpdateDataProduct"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UpdateDataProduct(context, options, request)); +} + +future> +DataProductServiceTracingStub::AsyncCreateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "CreateDataAsset"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateDataAsset(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +DataProductServiceTracingStub::CreateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "CreateDataAsset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateDataAsset(context, options, request)); +} + +future> +DataProductServiceTracingStub::AsyncUpdateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "UpdateDataAsset"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateDataAsset(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +DataProductServiceTracingStub::UpdateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "UpdateDataAsset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateDataAsset(context, options, request)); +} + +future> +DataProductServiceTracingStub::AsyncDeleteDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "DeleteDataAsset"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteDataAsset(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +DataProductServiceTracingStub::DeleteDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "DeleteDataAsset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteDataAsset(context, options, request)); +} + +StatusOr +DataProductServiceTracingStub::GetDataAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataAssetRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "GetDataAsset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetDataAsset(context, options, request)); +} + +StatusOr +DataProductServiceTracingStub::ListDataAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataAssetsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "ListDataAssets"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListDataAssets(context, options, request)); +} + +StatusOr +DataProductServiceTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +DataProductServiceTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr DataProductServiceTracingStub::SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "SetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->SetIamPolicy(context, options, request)); +} + +StatusOr DataProductServiceTracingStub::GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "GetIamPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetIamPolicy(context, options, request)); +} + +StatusOr +DataProductServiceTracingStub::TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "TestIamPermissions"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->TestIamPermissions(context, options, request)); +} + +StatusOr +DataProductServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +DataProductServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status DataProductServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status DataProductServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.dataplex.v1.DataProductService", "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +DataProductServiceTracingStub::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 DataProductServiceTracingStub::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)); +} + +std::shared_ptr MakeDataProductServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/dataplex/v1/internal/data_product_tracing_stub.h b/google/cloud/dataplex/v1/internal/data_product_tracing_stub.h new file mode 100644 index 0000000000000..b4d66f3e7961b --- /dev/null +++ b/google/cloud/dataplex/v1/internal/data_product_tracing_stub.h @@ -0,0 +1,204 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_TRACING_STUB_H + +#include "google/cloud/dataplex/v1/internal/data_product_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace dataplex_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataProductServiceTracingStub : public DataProductServiceStub { + public: + ~DataProductServiceTracingStub() override = default; + + explicit DataProductServiceTracingStub( + std::shared_ptr child); + + future> AsyncCreateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + StatusOr CreateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataProductRequest const& request) + override; + + future> AsyncDeleteDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) + override; + + StatusOr DeleteDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request) + override; + + StatusOr GetDataProduct( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataProductRequest const& request) + override; + + StatusOr + ListDataProducts(grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataProductsRequest const& + request) override; + + future> AsyncUpdateDataProduct( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + StatusOr UpdateDataProduct( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request) + override; + + future> AsyncCreateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + StatusOr CreateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request) + override; + + future> AsyncUpdateDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + StatusOr UpdateDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request) + override; + + future> AsyncDeleteDataAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) + override; + + StatusOr DeleteDataAsset( + grpc::ClientContext& context, Options options, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request) + override; + + StatusOr GetDataAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::GetDataAssetRequest const& request) override; + + StatusOr ListDataAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::dataplex::v1::ListDataAssetsRequest 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 SetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::SetIamPolicyRequest const& request) override; + + StatusOr GetIamPolicy( + grpc::ClientContext& context, Options const& options, + google::iam::v1::GetIamPolicyRequest const& request) override; + + StatusOr TestIamPermissions( + grpc::ClientContext& context, Options const& options, + google::iam::v1::TestIamPermissionsRequest 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_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeDataProductServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace dataplex_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_INTERNAL_DATA_PRODUCT_TRACING_STUB_H diff --git a/google/cloud/dataplex/v1/internal/dataplex_auth_decorator.cc b/google/cloud/dataplex/v1/internal/dataplex_auth_decorator.cc index a6f7adffeff9b..c28ff02a9e375 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_auth_decorator.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_auth_decorator.cc @@ -499,117 +499,6 @@ Status DataplexServiceAuth::CancelJob( return child_->CancelJob(context, options, request); } -future> -DataplexServiceAuth::AsyncCreateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::CreateEnvironmentRequest 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->AsyncCreateEnvironment(cq, *std::move(context), - std::move(options), request); - }); -} - -StatusOr DataplexServiceAuth::CreateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->CreateEnvironment(context, options, request); -} - -future> -DataplexServiceAuth::AsyncUpdateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest 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->AsyncUpdateEnvironment(cq, *std::move(context), - std::move(options), request); - }); -} - -StatusOr DataplexServiceAuth::UpdateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->UpdateEnvironment(context, options, request); -} - -future> -DataplexServiceAuth::AsyncDeleteEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest 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->AsyncDeleteEnvironment(cq, *std::move(context), - std::move(options), request); - }); -} - -StatusOr DataplexServiceAuth::DeleteEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->DeleteEnvironment(context, options, request); -} - -StatusOr -DataplexServiceAuth::ListEnvironments( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListEnvironmentsRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->ListEnvironments(context, options, request); -} - -StatusOr -DataplexServiceAuth::GetEnvironment( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->GetEnvironment(context, options, request); -} - -StatusOr -DataplexServiceAuth::ListSessions( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListSessionsRequest const& request) { - auto status = auth_->ConfigureContext(context); - if (!status.ok()) return status; - return child_->ListSessions(context, options, request); -} - StatusOr DataplexServiceAuth::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/dataplex/v1/internal/dataplex_auth_decorator.h b/google/cloud/dataplex/v1/internal/dataplex_auth_decorator.h index 3acaf9c024d28..6acdd86a58cea 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_auth_decorator.h +++ b/google/cloud/dataplex/v1/internal/dataplex_auth_decorator.h @@ -225,56 +225,6 @@ class DataplexServiceAuth : public DataplexServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::CancelJobRequest const& request) override; - future> AsyncCreateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - StatusOr CreateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - future> AsyncUpdateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - StatusOr UpdateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - future> AsyncDeleteEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) - override; - - StatusOr DeleteEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) - override; - - StatusOr - ListEnvironments(grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListEnvironmentsRequest const& - request) override; - - StatusOr GetEnvironment( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) - override; - - StatusOr ListSessions( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListSessionsRequest const& request) override; - StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/dataplex/v1/internal/dataplex_connection_impl.cc b/google/cloud/dataplex/v1/internal/dataplex_connection_impl.cc index ab84aa1bd50ed..49b1d61d7ef35 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_connection_impl.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_connection_impl.cc @@ -1506,368 +1506,6 @@ Status DataplexServiceConnectionImpl::CancelJob( *current, request, __func__); } -future> -DataplexServiceConnectionImpl::CreateEnvironment( - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - auto request_copy = request; - auto const idempotent = - idempotency_policy(*current)->CreateEnvironment(request_copy); - return google::cloud::internal::AsyncLongRunningOperation< - google::cloud::dataplex::v1::Environment>( - background_->cq(), current, std::move(request_copy), - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& - request) { - return stub->AsyncCreateEnvironment(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::dataplex::v1::Environment>, - retry_policy(*current), backoff_policy(*current), idempotent, - polling_policy(*current), __func__); -} - -StatusOr -DataplexServiceConnectionImpl::CreateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->CreateEnvironment(request), - [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& - request) { - return stub_->CreateEnvironment(context, options, request); - }, - *current, request, __func__); -} - -future> -DataplexServiceConnectionImpl::CreateEnvironment( - 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 CreateEnvironment", - GCP_ERROR_INFO().WithMetadata("operation", - operation.metadata().DebugString()))); - } - - return google::cloud::internal::AsyncAwaitLongRunningOperation< - google::cloud::dataplex::v1::Environment>( - 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::dataplex::v1::Environment>, - polling_policy(*current), __func__); -} - -future> -DataplexServiceConnectionImpl::UpdateEnvironment( - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - auto request_copy = request; - auto const idempotent = - idempotency_policy(*current)->UpdateEnvironment(request_copy); - return google::cloud::internal::AsyncLongRunningOperation< - google::cloud::dataplex::v1::Environment>( - background_->cq(), current, std::move(request_copy), - [stub = stub_]( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& - request) { - return stub->AsyncUpdateEnvironment(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::dataplex::v1::Environment>, - retry_policy(*current), backoff_policy(*current), idempotent, - polling_policy(*current), __func__); -} - -StatusOr -DataplexServiceConnectionImpl::UpdateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->UpdateEnvironment(request), - [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& - request) { - return stub_->UpdateEnvironment(context, options, request); - }, - *current, request, __func__); -} - -future> -DataplexServiceConnectionImpl::UpdateEnvironment( - 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 UpdateEnvironment", - GCP_ERROR_INFO().WithMetadata("operation", - operation.metadata().DebugString()))); - } - - return google::cloud::internal::AsyncAwaitLongRunningOperation< - google::cloud::dataplex::v1::Environment>( - 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::dataplex::v1::Environment>, - polling_policy(*current), __func__); -} - -future> -DataplexServiceConnectionImpl::DeleteEnvironment( - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - auto request_copy = request; - auto const idempotent = - idempotency_policy(*current)->DeleteEnvironment(request_copy); - return google::cloud::internal::AsyncLongRunningOperation< - google::cloud::dataplex::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::dataplex::v1::DeleteEnvironmentRequest const& - request) { - return stub->AsyncDeleteEnvironment(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::dataplex::v1::OperationMetadata>, - retry_policy(*current), backoff_policy(*current), idempotent, - polling_policy(*current), __func__); -} - -StatusOr -DataplexServiceConnectionImpl::DeleteEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->DeleteEnvironment(request), - [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& - request) { - return stub_->DeleteEnvironment(context, options, request); - }, - *current, request, __func__); -} - -future> -DataplexServiceConnectionImpl::DeleteEnvironment( - 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 DeleteEnvironment", - GCP_ERROR_INFO().WithMetadata("operation", - operation.metadata().DebugString()))); - } - - return google::cloud::internal::AsyncAwaitLongRunningOperation< - google::cloud::dataplex::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::dataplex::v1::OperationMetadata>, - polling_policy(*current), __func__); -} - -StreamRange -DataplexServiceConnectionImpl::ListEnvironments( - google::cloud::dataplex::v1::ListEnvironmentsRequest request) { - request.clear_page_token(); - auto current = google::cloud::internal::SaveCurrentOptions(); - auto idempotency = idempotency_policy(*current)->ListEnvironments(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::dataplex::v1::ListEnvironmentsRequest const& r) { - return google::cloud::internal::RetryLoop( - retry->clone(), backoff->clone(), idempotency, - [stub](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListEnvironmentsRequest const& - request) { - return stub->ListEnvironments(context, options, request); - }, - options, r, function_name); - }, - [](google::cloud::dataplex::v1::ListEnvironmentsResponse r) { - std::vector result( - r.environments().size()); - auto& messages = *r.mutable_environments(); - std::move(messages.begin(), messages.end(), result.begin()); - return result; - }); -} - -StatusOr -DataplexServiceConnectionImpl::GetEnvironment( - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) { - auto current = google::cloud::internal::SaveCurrentOptions(); - return google::cloud::internal::RetryLoop( - retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->GetEnvironment(request), - [this]( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) { - return stub_->GetEnvironment(context, options, request); - }, - *current, request, __func__); -} - -StreamRange -DataplexServiceConnectionImpl::ListSessions( - google::cloud::dataplex::v1::ListSessionsRequest request) { - request.clear_page_token(); - auto current = google::cloud::internal::SaveCurrentOptions(); - auto idempotency = idempotency_policy(*current)->ListSessions(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::dataplex::v1::ListSessionsRequest const& r) { - return google::cloud::internal::RetryLoop( - retry->clone(), backoff->clone(), idempotency, - [stub](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListSessionsRequest const& - request) { - return stub->ListSessions(context, options, request); - }, - options, r, function_name); - }, - [](google::cloud::dataplex::v1::ListSessionsResponse r) { - std::vector result( - r.sessions().size()); - auto& messages = *r.mutable_sessions(); - std::move(messages.begin(), messages.end(), result.begin()); - return result; - }); -} - StreamRange DataplexServiceConnectionImpl::ListLocations( google::cloud::location::ListLocationsRequest request) { diff --git a/google/cloud/dataplex/v1/internal/dataplex_connection_impl.h b/google/cloud/dataplex/v1/internal/dataplex_connection_impl.h index 675c010be6415..18ecbadb5400f 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_connection_impl.h +++ b/google/cloud/dataplex/v1/internal/dataplex_connection_impl.h @@ -217,52 +217,6 @@ class DataplexServiceConnectionImpl Status CancelJob( google::cloud::dataplex::v1::CancelJobRequest const& request) override; - future> CreateEnvironment( - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - StatusOr CreateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - future> CreateEnvironment( - google::longrunning::Operation const& operation) override; - - future> UpdateEnvironment( - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - StatusOr UpdateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - future> UpdateEnvironment( - google::longrunning::Operation const& operation) override; - - future> - DeleteEnvironment(google::cloud::dataplex::v1::DeleteEnvironmentRequest const& - request) override; - - StatusOr DeleteEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) - override; - - future> - DeleteEnvironment(google::longrunning::Operation const& operation) override; - - StreamRange ListEnvironments( - google::cloud::dataplex::v1::ListEnvironmentsRequest request) override; - - StatusOr GetEnvironment( - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) - override; - - StreamRange ListSessions( - google::cloud::dataplex::v1::ListSessionsRequest request) override; - StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; diff --git a/google/cloud/dataplex/v1/internal/dataplex_logging_decorator.cc b/google/cloud/dataplex/v1/internal/dataplex_logging_decorator.cc index 1a477124bcf9a..4bd547d224b0a 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_logging_decorator.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_logging_decorator.cc @@ -563,140 +563,6 @@ Status DataplexServiceLogging::CancelJob( context, options, request, __func__, tracing_options_); } -future> -DataplexServiceLogging::AsyncCreateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& - request) { - return child_->AsyncCreateEnvironment(cq, std::move(context), - std::move(options), request); - }, - cq, std::move(context), std::move(options), request, __func__, - tracing_options_); -} - -StatusOr -DataplexServiceLogging::CreateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& - request) { - return child_->CreateEnvironment(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -future> -DataplexServiceLogging::AsyncUpdateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& - request) { - return child_->AsyncUpdateEnvironment(cq, std::move(context), - std::move(options), request); - }, - cq, std::move(context), std::move(options), request, __func__, - tracing_options_); -} - -StatusOr -DataplexServiceLogging::UpdateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& - request) { - return child_->UpdateEnvironment(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -future> -DataplexServiceLogging::AsyncDeleteEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& - request) { - return child_->AsyncDeleteEnvironment(cq, std::move(context), - std::move(options), request); - }, - cq, std::move(context), std::move(options), request, __func__, - tracing_options_); -} - -StatusOr -DataplexServiceLogging::DeleteEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& - request) { - return child_->DeleteEnvironment(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -DataplexServiceLogging::ListEnvironments( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListEnvironmentsRequest const& request) { - return google::cloud::internal::LogWrapper( - [this]( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListEnvironmentsRequest const& request) { - return child_->ListEnvironments(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -DataplexServiceLogging::GetEnvironment( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) { - return google::cloud::internal::LogWrapper( - [this]( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) { - return child_->GetEnvironment(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - -StatusOr -DataplexServiceLogging::ListSessions( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListSessionsRequest const& request) { - return google::cloud::internal::LogWrapper( - [this](grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListSessionsRequest const& request) { - return child_->ListSessions(context, options, request); - }, - context, options, request, __func__, tracing_options_); -} - StatusOr DataplexServiceLogging::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/dataplex/v1/internal/dataplex_logging_decorator.h b/google/cloud/dataplex/v1/internal/dataplex_logging_decorator.h index dc4850ec69668..2e6007e2b0a42 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_logging_decorator.h +++ b/google/cloud/dataplex/v1/internal/dataplex_logging_decorator.h @@ -225,56 +225,6 @@ class DataplexServiceLogging : public DataplexServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::CancelJobRequest const& request) override; - future> AsyncCreateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - StatusOr CreateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - future> AsyncUpdateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - StatusOr UpdateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - future> AsyncDeleteEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) - override; - - StatusOr DeleteEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) - override; - - StatusOr - ListEnvironments(grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListEnvironmentsRequest const& - request) override; - - StatusOr GetEnvironment( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) - override; - - StatusOr ListSessions( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListSessionsRequest const& request) override; - StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.cc b/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.cc index 93757caecf4b2..c45d9c58f5d41 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.cc @@ -425,98 +425,6 @@ Status DataplexServiceMetadata::CancelJob( return child_->CancelJob(context, options, request); } -future> -DataplexServiceMetadata::AsyncCreateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) { - SetMetadata(*context, *options, - absl::StrCat("parent=", internal::UrlEncode(request.parent()))); - return child_->AsyncCreateEnvironment(cq, std::move(context), - std::move(options), request); -} - -StatusOr -DataplexServiceMetadata::CreateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) { - SetMetadata(context, options, - absl::StrCat("parent=", internal::UrlEncode(request.parent()))); - return child_->CreateEnvironment(context, options, request); -} - -future> -DataplexServiceMetadata::AsyncUpdateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) { - SetMetadata(*context, *options, - absl::StrCat("environment.name=", - internal::UrlEncode(request.environment().name()))); - return child_->AsyncUpdateEnvironment(cq, std::move(context), - std::move(options), request); -} - -StatusOr -DataplexServiceMetadata::UpdateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) { - SetMetadata(context, options, - absl::StrCat("environment.name=", - internal::UrlEncode(request.environment().name()))); - return child_->UpdateEnvironment(context, options, request); -} - -future> -DataplexServiceMetadata::AsyncDeleteEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) { - SetMetadata(*context, *options, - absl::StrCat("name=", internal::UrlEncode(request.name()))); - return child_->AsyncDeleteEnvironment(cq, std::move(context), - std::move(options), request); -} - -StatusOr -DataplexServiceMetadata::DeleteEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) { - SetMetadata(context, options, - absl::StrCat("name=", internal::UrlEncode(request.name()))); - return child_->DeleteEnvironment(context, options, request); -} - -StatusOr -DataplexServiceMetadata::ListEnvironments( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListEnvironmentsRequest const& request) { - SetMetadata(context, options, - absl::StrCat("parent=", internal::UrlEncode(request.parent()))); - return child_->ListEnvironments(context, options, request); -} - -StatusOr -DataplexServiceMetadata::GetEnvironment( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) { - SetMetadata(context, options, - absl::StrCat("name=", internal::UrlEncode(request.name()))); - return child_->GetEnvironment(context, options, request); -} - -StatusOr -DataplexServiceMetadata::ListSessions( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListSessionsRequest const& request) { - SetMetadata(context, options, - absl::StrCat("parent=", internal::UrlEncode(request.parent()))); - return child_->ListSessions(context, options, request); -} - StatusOr DataplexServiceMetadata::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.h b/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.h index 2217fc01527c6..ed34a890b77c2 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.h +++ b/google/cloud/dataplex/v1/internal/dataplex_metadata_decorator.h @@ -226,56 +226,6 @@ class DataplexServiceMetadata : public DataplexServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::CancelJobRequest const& request) override; - future> AsyncCreateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - StatusOr CreateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - future> AsyncUpdateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - StatusOr UpdateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - future> AsyncDeleteEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) - override; - - StatusOr DeleteEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) - override; - - StatusOr - ListEnvironments(grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListEnvironmentsRequest const& - request) override; - - StatusOr GetEnvironment( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) - override; - - StatusOr ListSessions( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListSessionsRequest const& request) override; - StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/dataplex/v1/internal/dataplex_stub.cc b/google/cloud/dataplex/v1/internal/dataplex_stub.cc index f2a33bbc55925..fed71186762cc 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_stub.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_stub.cc @@ -560,135 +560,6 @@ Status DefaultDataplexServiceStub::CancelJob( return google::cloud::Status(); } -future> -DefaultDataplexServiceStub::AsyncCreateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) { - return internal::MakeUnaryRpcImpl< - google::cloud::dataplex::v1::CreateEnvironmentRequest, - google::longrunning::Operation>( - cq, - [this]( - grpc::ClientContext* context, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request, - grpc::CompletionQueue* cq) { - return grpc_stub_->AsyncCreateEnvironment(context, request, cq); - }, - request, std::move(context)); -} - -StatusOr -DefaultDataplexServiceStub::CreateEnvironment( - grpc::ClientContext& context, Options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) { - google::longrunning::Operation response; - auto status = grpc_stub_->CreateEnvironment(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -future> -DefaultDataplexServiceStub::AsyncUpdateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) { - return internal::MakeUnaryRpcImpl< - google::cloud::dataplex::v1::UpdateEnvironmentRequest, - google::longrunning::Operation>( - cq, - [this]( - grpc::ClientContext* context, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request, - grpc::CompletionQueue* cq) { - return grpc_stub_->AsyncUpdateEnvironment(context, request, cq); - }, - request, std::move(context)); -} - -StatusOr -DefaultDataplexServiceStub::UpdateEnvironment( - grpc::ClientContext& context, Options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) { - google::longrunning::Operation response; - auto status = grpc_stub_->UpdateEnvironment(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -future> -DefaultDataplexServiceStub::AsyncDeleteEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) { - return internal::MakeUnaryRpcImpl< - google::cloud::dataplex::v1::DeleteEnvironmentRequest, - google::longrunning::Operation>( - cq, - [this]( - grpc::ClientContext* context, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request, - grpc::CompletionQueue* cq) { - return grpc_stub_->AsyncDeleteEnvironment(context, request, cq); - }, - request, std::move(context)); -} - -StatusOr -DefaultDataplexServiceStub::DeleteEnvironment( - grpc::ClientContext& context, Options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) { - google::longrunning::Operation response; - auto status = grpc_stub_->DeleteEnvironment(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultDataplexServiceStub::ListEnvironments( - grpc::ClientContext& context, Options const&, - google::cloud::dataplex::v1::ListEnvironmentsRequest const& request) { - google::cloud::dataplex::v1::ListEnvironmentsResponse response; - auto status = grpc_stub_->ListEnvironments(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultDataplexServiceStub::GetEnvironment( - grpc::ClientContext& context, Options const&, - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) { - google::cloud::dataplex::v1::Environment response; - auto status = grpc_stub_->GetEnvironment(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - -StatusOr -DefaultDataplexServiceStub::ListSessions( - grpc::ClientContext& context, Options const&, - google::cloud::dataplex::v1::ListSessionsRequest const& request) { - google::cloud::dataplex::v1::ListSessionsResponse response; - auto status = grpc_stub_->ListSessions(&context, request, &response); - if (!status.ok()) { - return google::cloud::MakeStatusFromRpcError(status); - } - return response; -} - StatusOr DefaultDataplexServiceStub::ListLocations( grpc::ClientContext& context, Options const&, diff --git a/google/cloud/dataplex/v1/internal/dataplex_stub.h b/google/cloud/dataplex/v1/internal/dataplex_stub.h index a2802f1c858b9..22275af06d423 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_stub.h +++ b/google/cloud/dataplex/v1/internal/dataplex_stub.h @@ -226,53 +226,6 @@ class DataplexServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::CancelJobRequest const& request) = 0; - virtual future> - AsyncCreateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) = 0; - - virtual StatusOr CreateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) = 0; - - virtual future> - AsyncUpdateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) = 0; - - virtual StatusOr UpdateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) = 0; - - virtual future> - AsyncDeleteEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) = 0; - - virtual StatusOr DeleteEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) = 0; - - virtual StatusOr - ListEnvironments( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListEnvironmentsRequest const& request) = 0; - - virtual StatusOr GetEnvironment( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) = 0; - - virtual StatusOr - ListSessions( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListSessionsRequest const& request) = 0; - virtual StatusOr ListLocations( grpc::ClientContext& context, Options const& options, @@ -523,56 +476,6 @@ class DefaultDataplexServiceStub : public DataplexServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::CancelJobRequest const& request) override; - future> AsyncCreateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - StatusOr CreateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - future> AsyncUpdateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - StatusOr UpdateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - future> AsyncDeleteEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) - override; - - StatusOr DeleteEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) - override; - - StatusOr - ListEnvironments(grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListEnvironmentsRequest const& - request) override; - - StatusOr GetEnvironment( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) - override; - - StatusOr ListSessions( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListSessionsRequest const& request) override; - StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.cc b/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.cc index ec6045b2380bc..1962716efcb97 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.cc @@ -508,127 +508,6 @@ Status DataplexServiceTracingConnection::CancelJob( return internal::EndSpan(*span, child_->CancelJob(request)); } -future> -DataplexServiceTracingConnection::CreateEnvironment( - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) { - auto span = internal::MakeSpan( - "dataplex_v1::DataplexServiceConnection::CreateEnvironment"); - internal::OTelScope scope(span); - return internal::EndSpan(std::move(span), child_->CreateEnvironment(request)); -} - -StatusOr -DataplexServiceTracingConnection::CreateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) { - auto span = internal::MakeSpan( - "dataplex_v1::DataplexServiceConnection::CreateEnvironment"); - opentelemetry::trace::Scope scope(span); - return internal::EndSpan(*span, - child_->CreateEnvironment(NoAwaitTag{}, request)); -} - -future> -DataplexServiceTracingConnection::CreateEnvironment( - google::longrunning::Operation const& operation) { - auto span = internal::MakeSpan( - "dataplex_v1::DataplexServiceConnection::CreateEnvironment"); - internal::OTelScope scope(span); - return internal::EndSpan(std::move(span), - child_->CreateEnvironment(operation)); -} - -future> -DataplexServiceTracingConnection::UpdateEnvironment( - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) { - auto span = internal::MakeSpan( - "dataplex_v1::DataplexServiceConnection::UpdateEnvironment"); - internal::OTelScope scope(span); - return internal::EndSpan(std::move(span), child_->UpdateEnvironment(request)); -} - -StatusOr -DataplexServiceTracingConnection::UpdateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) { - auto span = internal::MakeSpan( - "dataplex_v1::DataplexServiceConnection::UpdateEnvironment"); - opentelemetry::trace::Scope scope(span); - return internal::EndSpan(*span, - child_->UpdateEnvironment(NoAwaitTag{}, request)); -} - -future> -DataplexServiceTracingConnection::UpdateEnvironment( - google::longrunning::Operation const& operation) { - auto span = internal::MakeSpan( - "dataplex_v1::DataplexServiceConnection::UpdateEnvironment"); - internal::OTelScope scope(span); - return internal::EndSpan(std::move(span), - child_->UpdateEnvironment(operation)); -} - -future> -DataplexServiceTracingConnection::DeleteEnvironment( - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) { - auto span = internal::MakeSpan( - "dataplex_v1::DataplexServiceConnection::DeleteEnvironment"); - internal::OTelScope scope(span); - return internal::EndSpan(std::move(span), child_->DeleteEnvironment(request)); -} - -StatusOr -DataplexServiceTracingConnection::DeleteEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) { - auto span = internal::MakeSpan( - "dataplex_v1::DataplexServiceConnection::DeleteEnvironment"); - opentelemetry::trace::Scope scope(span); - return internal::EndSpan(*span, - child_->DeleteEnvironment(NoAwaitTag{}, request)); -} - -future> -DataplexServiceTracingConnection::DeleteEnvironment( - google::longrunning::Operation const& operation) { - auto span = internal::MakeSpan( - "dataplex_v1::DataplexServiceConnection::DeleteEnvironment"); - internal::OTelScope scope(span); - return internal::EndSpan(std::move(span), - child_->DeleteEnvironment(operation)); -} - -StreamRange -DataplexServiceTracingConnection::ListEnvironments( - google::cloud::dataplex::v1::ListEnvironmentsRequest request) { - auto span = internal::MakeSpan( - "dataplex_v1::DataplexServiceConnection::ListEnvironments"); - internal::OTelScope scope(span); - auto sr = child_->ListEnvironments(std::move(request)); - return internal::MakeTracedStreamRange< - google::cloud::dataplex::v1::Environment>(std::move(span), std::move(sr)); -} - -StatusOr -DataplexServiceTracingConnection::GetEnvironment( - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) { - auto span = internal::MakeSpan( - "dataplex_v1::DataplexServiceConnection::GetEnvironment"); - auto scope = opentelemetry::trace::Scope(span); - return internal::EndSpan(*span, child_->GetEnvironment(request)); -} - -StreamRange -DataplexServiceTracingConnection::ListSessions( - google::cloud::dataplex::v1::ListSessionsRequest request) { - auto span = internal::MakeSpan( - "dataplex_v1::DataplexServiceConnection::ListSessions"); - internal::OTelScope scope(span); - auto sr = child_->ListSessions(std::move(request)); - return internal::MakeTracedStreamRange( - std::move(span), std::move(sr)); -} - StreamRange DataplexServiceTracingConnection::ListLocations( google::cloud::location::ListLocationsRequest request) { diff --git a/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.h b/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.h index 72b25980b9468..faacb0226046a 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.h +++ b/google/cloud/dataplex/v1/internal/dataplex_tracing_connection.h @@ -203,52 +203,6 @@ class DataplexServiceTracingConnection Status CancelJob( google::cloud::dataplex::v1::CancelJobRequest const& request) override; - future> CreateEnvironment( - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - StatusOr CreateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - future> CreateEnvironment( - google::longrunning::Operation const& operation) override; - - future> UpdateEnvironment( - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - StatusOr UpdateEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - future> UpdateEnvironment( - google::longrunning::Operation const& operation) override; - - future> - DeleteEnvironment(google::cloud::dataplex::v1::DeleteEnvironmentRequest const& - request) override; - - StatusOr DeleteEnvironment( - NoAwaitTag, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) - override; - - future> - DeleteEnvironment(google::longrunning::Operation const& operation) override; - - StreamRange ListEnvironments( - google::cloud::dataplex::v1::ListEnvironmentsRequest request) override; - - StatusOr GetEnvironment( - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) - override; - - StreamRange ListSessions( - google::cloud::dataplex::v1::ListSessionsRequest request) override; - StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; diff --git a/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.cc b/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.cc index 730d01172bf23..175e22b52a66d 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.cc +++ b/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.cc @@ -511,123 +511,6 @@ Status DataplexServiceTracingStub::CancelJob( child_->CancelJob(context, options, request)); } -future> -DataplexServiceTracingStub::AsyncCreateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.DataplexService", - "CreateEnvironment"); - internal::OTelScope scope(span); - internal::InjectTraceContext(*context, *propagator_); - auto f = - child_->AsyncCreateEnvironment(cq, context, std::move(options), request); - return internal::EndSpan(std::move(context), std::move(span), std::move(f)); -} - -StatusOr -DataplexServiceTracingStub::CreateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.DataplexService", - "CreateEnvironment"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan( - context, *span, child_->CreateEnvironment(context, options, request)); -} - -future> -DataplexServiceTracingStub::AsyncUpdateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.DataplexService", - "UpdateEnvironment"); - internal::OTelScope scope(span); - internal::InjectTraceContext(*context, *propagator_); - auto f = - child_->AsyncUpdateEnvironment(cq, context, std::move(options), request); - return internal::EndSpan(std::move(context), std::move(span), std::move(f)); -} - -StatusOr -DataplexServiceTracingStub::UpdateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.DataplexService", - "UpdateEnvironment"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan( - context, *span, child_->UpdateEnvironment(context, options, request)); -} - -future> -DataplexServiceTracingStub::AsyncDeleteEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.DataplexService", - "DeleteEnvironment"); - internal::OTelScope scope(span); - internal::InjectTraceContext(*context, *propagator_); - auto f = - child_->AsyncDeleteEnvironment(cq, context, std::move(options), request); - return internal::EndSpan(std::move(context), std::move(span), std::move(f)); -} - -StatusOr -DataplexServiceTracingStub::DeleteEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.DataplexService", - "DeleteEnvironment"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan( - context, *span, child_->DeleteEnvironment(context, options, request)); -} - -StatusOr -DataplexServiceTracingStub::ListEnvironments( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListEnvironmentsRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.DataplexService", - "ListEnvironments"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->ListEnvironments(context, options, request)); -} - -StatusOr -DataplexServiceTracingStub::GetEnvironment( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.DataplexService", - "GetEnvironment"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->GetEnvironment(context, options, request)); -} - -StatusOr -DataplexServiceTracingStub::ListSessions( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListSessionsRequest const& request) { - auto span = internal::MakeSpanGrpc("google.cloud.dataplex.v1.DataplexService", - "ListSessions"); - auto scope = opentelemetry::trace::Scope(span); - internal::InjectTraceContext(context, *propagator_); - return internal::EndSpan(context, *span, - child_->ListSessions(context, options, request)); -} - StatusOr DataplexServiceTracingStub::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.h b/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.h index 4dd95d5458185..826e6cb62b3d0 100644 --- a/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.h +++ b/google/cloud/dataplex/v1/internal/dataplex_tracing_stub.h @@ -223,56 +223,6 @@ class DataplexServiceTracingStub : public DataplexServiceStub { grpc::ClientContext& context, Options const& options, google::cloud::dataplex::v1::CancelJobRequest const& request) override; - future> AsyncCreateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - StatusOr CreateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request) - override; - - future> AsyncUpdateEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - StatusOr UpdateEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request) - override; - - future> AsyncDeleteEnvironment( - google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) - override; - - StatusOr DeleteEnvironment( - grpc::ClientContext& context, Options options, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request) - override; - - StatusOr - ListEnvironments(grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListEnvironmentsRequest const& - request) override; - - StatusOr GetEnvironment( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::GetEnvironmentRequest const& request) - override; - - StatusOr ListSessions( - grpc::ClientContext& context, Options const& options, - google::cloud::dataplex::v1::ListSessionsRequest const& request) override; - StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/dataplex/v1/metadata_client.h b/google/cloud/dataplex/v1/metadata_client.h index c654dbef1e75f..ea28a2dc6f4f0 100644 --- a/google/cloud/dataplex/v1/metadata_client.h +++ b/google/cloud/dataplex/v1/metadata_client.h @@ -998,7 +998,7 @@ class MetadataServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1037,7 +1037,7 @@ class MetadataServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataplex/v1/mocks/mock_business_glossary_connection.h b/google/cloud/dataplex/v1/mocks/mock_business_glossary_connection.h new file mode 100644 index 0000000000000..4045268f1cfe9 --- /dev/null +++ b/google/cloud/dataplex/v1/mocks/mock_business_glossary_connection.h @@ -0,0 +1,270 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_MOCKS_MOCK_BUSINESS_GLOSSARY_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_MOCKS_MOCK_BUSINESS_GLOSSARY_CONNECTION_H + +#include "google/cloud/dataplex/v1/business_glossary_connection.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `BusinessGlossaryServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `BusinessGlossaryServiceClient`. To + * do so, construct an object of type `BusinessGlossaryServiceClient` 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 MockBusinessGlossaryServiceConnection + : public dataplex_v1::BusinessGlossaryServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateGlossary(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, CreateGlossary, + (google::cloud::dataplex::v1::CreateGlossaryRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateGlossary(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateGlossary, + (NoAwaitTag, + google::cloud::dataplex::v1::CreateGlossaryRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateGlossary(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateGlossary, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateGlossary(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, UpdateGlossary, + (google::cloud::dataplex::v1::UpdateGlossaryRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateGlossary(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateGlossary, + (NoAwaitTag, + google::cloud::dataplex::v1::UpdateGlossaryRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateGlossary(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateGlossary, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteGlossary(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteGlossary, + (google::cloud::dataplex::v1::DeleteGlossaryRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteGlossary(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteGlossary, + (NoAwaitTag, + google::cloud::dataplex::v1::DeleteGlossaryRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteGlossary(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteGlossary, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD(StatusOr, GetGlossary, + (google::cloud::dataplex::v1::GetGlossaryRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListGlossaries, + (google::cloud::dataplex::v1::ListGlossariesRequest request), + (override)); + + MOCK_METHOD(StatusOr, + CreateGlossaryCategory, + (google::cloud::dataplex::v1::CreateGlossaryCategoryRequest const& + request), + (override)); + + MOCK_METHOD(StatusOr, + UpdateGlossaryCategory, + (google::cloud::dataplex::v1::UpdateGlossaryCategoryRequest const& + request), + (override)); + + MOCK_METHOD(Status, DeleteGlossaryCategory, + (google::cloud::dataplex::v1::DeleteGlossaryCategoryRequest const& + request), + (override)); + + MOCK_METHOD( + StatusOr, + GetGlossaryCategory, + (google::cloud::dataplex::v1::GetGlossaryCategoryRequest const& request), + (override)); + + MOCK_METHOD( + (StreamRange), + ListGlossaryCategories, + (google::cloud::dataplex::v1::ListGlossaryCategoriesRequest request), + (override)); + + MOCK_METHOD( + StatusOr, CreateGlossaryTerm, + (google::cloud::dataplex::v1::CreateGlossaryTermRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, UpdateGlossaryTerm, + (google::cloud::dataplex::v1::UpdateGlossaryTermRequest const& request), + (override)); + + MOCK_METHOD( + Status, DeleteGlossaryTerm, + (google::cloud::dataplex::v1::DeleteGlossaryTermRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, GetGlossaryTerm, + (google::cloud::dataplex::v1::GetGlossaryTermRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListGlossaryTerms, + (google::cloud::dataplex::v1::ListGlossaryTermsRequest request), + (override)); + + MOCK_METHOD((StreamRange), ListLocations, + (google::cloud::location::ListLocationsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetLocation, + (google::cloud::location::GetLocationRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, SetIamPolicy, + (google::iam::v1::SetIamPolicyRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, GetIamPolicy, + (google::iam::v1::GetIamPolicyRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, + TestIamPermissions, + (google::iam::v1::TestIamPermissionsRequest 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 dataplex_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_MOCKS_MOCK_BUSINESS_GLOSSARY_CONNECTION_H diff --git a/google/cloud/dataplex/v1/mocks/mock_catalog_connection.h b/google/cloud/dataplex/v1/mocks/mock_catalog_connection.h index 25b4d0ba1254c..6261b0f3093eb 100644 --- a/google/cloud/dataplex/v1/mocks/mock_catalog_connection.h +++ b/google/cloud/dataplex/v1/mocks/mock_catalog_connection.h @@ -513,15 +513,158 @@ class MockCatalogServiceConnection (google::cloud::dataplex::v1::CreateEntryLinkRequest const& request), (override)); + MOCK_METHOD( + StatusOr, UpdateEntryLink, + (google::cloud::dataplex::v1::UpdateEntryLinkRequest const& request), + (override)); + MOCK_METHOD( StatusOr, DeleteEntryLink, (google::cloud::dataplex::v1::DeleteEntryLinkRequest const& request), (override)); + MOCK_METHOD((StreamRange), + LookupEntryLinks, + (google::cloud::dataplex::v1::LookupEntryLinksRequest request), + (override)); + + MOCK_METHOD( + StatusOr, + LookupContext, + (google::cloud::dataplex::v1::LookupContextRequest const& request), + (override)); + MOCK_METHOD(StatusOr, GetEntryLink, (google::cloud::dataplex::v1::GetEntryLinkRequest const& request), (override)); + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateMetadataFeed(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateMetadataFeed, + (google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateMetadataFeed(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateMetadataFeed, + (NoAwaitTag, + google::cloud::dataplex::v1::CreateMetadataFeedRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateMetadataFeed(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateMetadataFeed, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD( + StatusOr, GetMetadataFeed, + (google::cloud::dataplex::v1::GetMetadataFeedRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListMetadataFeeds, + (google::cloud::dataplex::v1::ListMetadataFeedsRequest request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteMetadataFeed(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteMetadataFeed, + (google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteMetadataFeed(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteMetadataFeed, + (NoAwaitTag, + google::cloud::dataplex::v1::DeleteMetadataFeedRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteMetadataFeed(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteMetadataFeed, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateMetadataFeed(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateMetadataFeed, + (google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateMetadataFeed(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateMetadataFeed, + (NoAwaitTag, + google::cloud::dataplex::v1::UpdateMetadataFeedRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateMetadataFeed(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateMetadataFeed, + (google::longrunning::Operation const& operation), (override)); + MOCK_METHOD((StreamRange), ListLocations, (google::cloud::location::ListLocationsRequest request), (override)); diff --git a/google/cloud/dataplex/v1/mocks/mock_cmek_connection.h b/google/cloud/dataplex/v1/mocks/mock_cmek_connection.h new file mode 100644 index 0000000000000..eb77cfc26622d --- /dev/null +++ b/google/cloud/dataplex/v1/mocks/mock_cmek_connection.h @@ -0,0 +1,220 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_MOCKS_MOCK_CMEK_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_MOCKS_MOCK_CMEK_CONNECTION_H + +#include "google/cloud/dataplex/v1/cmek_connection.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `CmekServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `CmekServiceClient`. To do so, + * construct an object of type `CmekServiceClient` 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 MockCmekServiceConnection : public dataplex_v1::CmekServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateEncryptionConfig(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateEncryptionConfig, + (google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateEncryptionConfig(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, CreateEncryptionConfig, + (NoAwaitTag, + google::cloud::dataplex::v1::CreateEncryptionConfigRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateEncryptionConfig(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateEncryptionConfig, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateEncryptionConfig(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateEncryptionConfig, + (google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateEncryptionConfig(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, UpdateEncryptionConfig, + (NoAwaitTag, + google::cloud::dataplex::v1::UpdateEncryptionConfigRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateEncryptionConfig(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateEncryptionConfig, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteEncryptionConfig(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteEncryptionConfig, + (google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteEncryptionConfig(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteEncryptionConfig, + (NoAwaitTag, + google::cloud::dataplex::v1::DeleteEncryptionConfigRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteEncryptionConfig(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteEncryptionConfig, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD( + (StreamRange), + ListEncryptionConfigs, + (google::cloud::dataplex::v1::ListEncryptionConfigsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, + GetEncryptionConfig, + (google::cloud::dataplex::v1::GetEncryptionConfigRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), ListLocations, + (google::cloud::location::ListLocationsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetLocation, + (google::cloud::location::GetLocationRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, SetIamPolicy, + (google::iam::v1::SetIamPolicyRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, GetIamPolicy, + (google::iam::v1::GetIamPolicyRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, + TestIamPermissions, + (google::iam::v1::TestIamPermissionsRequest 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 dataplex_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_MOCKS_MOCK_CMEK_CONNECTION_H diff --git a/google/cloud/dataplex/v1/mocks/mock_content_connection.h b/google/cloud/dataplex/v1/mocks/mock_content_connection.h index 998e0d3122b62..cb95f394a2abf 100644 --- a/google/cloud/dataplex/v1/mocks/mock_content_connection.h +++ b/google/cloud/dataplex/v1/mocks/mock_content_connection.h @@ -47,50 +47,27 @@ class MockContentServiceConnection public: MOCK_METHOD(Options, options, (), (override)); - MOCK_METHOD( - StatusOr, CreateContent, - (google::cloud::dataplex::v1::CreateContentRequest const& request), - (override)); - - MOCK_METHOD( - StatusOr, UpdateContent, - (google::cloud::dataplex::v1::UpdateContentRequest const& request), - (override)); - - MOCK_METHOD( - Status, DeleteContent, - (google::cloud::dataplex::v1::DeleteContentRequest const& request), - (override)); - - MOCK_METHOD(StatusOr, GetContent, - (google::cloud::dataplex::v1::GetContentRequest const& request), + MOCK_METHOD((StreamRange), ListLocations, + (google::cloud::location::ListLocationsRequest request), (override)); - MOCK_METHOD(StatusOr, GetIamPolicy, - (google::iam::v1::GetIamPolicyRequest const& request), + MOCK_METHOD(StatusOr, GetLocation, + (google::cloud::location::GetLocationRequest const& request), (override)); MOCK_METHOD(StatusOr, SetIamPolicy, (google::iam::v1::SetIamPolicyRequest const& request), (override)); + MOCK_METHOD(StatusOr, GetIamPolicy, + (google::iam::v1::GetIamPolicyRequest const& request), + (override)); + MOCK_METHOD(StatusOr, TestIamPermissions, (google::iam::v1::TestIamPermissionsRequest const& request), (override)); - MOCK_METHOD((StreamRange), ListContent, - (google::cloud::dataplex::v1::ListContentRequest request), - (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)); diff --git a/google/cloud/dataplex/v1/mocks/mock_data_product_connection.h b/google/cloud/dataplex/v1/mocks/mock_data_product_connection.h new file mode 100644 index 0000000000000..c4cb8a5a92b3c --- /dev/null +++ b/google/cloud/dataplex/v1/mocks/mock_data_product_connection.h @@ -0,0 +1,343 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_MOCKS_MOCK_DATA_PRODUCT_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_MOCKS_MOCK_DATA_PRODUCT_CONNECTION_H + +#include "google/cloud/dataplex/v1/data_product_connection.h" +#include + +namespace google { +namespace cloud { +namespace dataplex_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `DataProductServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `DataProductServiceClient`. To do + * so, construct an object of type `DataProductServiceClient` 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 MockDataProductServiceConnection + : public dataplex_v1::DataProductServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateDataProduct(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateDataProduct, + (google::cloud::dataplex::v1::CreateDataProductRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateDataProduct(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateDataProduct, + (NoAwaitTag, + google::cloud::dataplex::v1::CreateDataProductRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateDataProduct(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateDataProduct, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteDataProduct(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteDataProduct, + (google::cloud::dataplex::v1::DeleteDataProductRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteDataProduct(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteDataProduct, + (NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataProductRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteDataProduct(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteDataProduct, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD( + StatusOr, GetDataProduct, + (google::cloud::dataplex::v1::GetDataProductRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListDataProducts, + (google::cloud::dataplex::v1::ListDataProductsRequest request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateDataProduct(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateDataProduct, + (google::cloud::dataplex::v1::UpdateDataProductRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateDataProduct(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateDataProduct, + (NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataProductRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateDataProduct(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateDataProduct, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateDataAsset(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, CreateDataAsset, + (google::cloud::dataplex::v1::CreateDataAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateDataAsset(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateDataAsset, + (NoAwaitTag, + google::cloud::dataplex::v1::CreateDataAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateDataAsset(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateDataAsset, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateDataAsset(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, UpdateDataAsset, + (google::cloud::dataplex::v1::UpdateDataAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateDataAsset(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateDataAsset, + (NoAwaitTag, + google::cloud::dataplex::v1::UpdateDataAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateDataAsset(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateDataAsset, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteDataAsset(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteDataAsset, + (google::cloud::dataplex::v1::DeleteDataAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteDataAsset(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteDataAsset, + (NoAwaitTag, + google::cloud::dataplex::v1::DeleteDataAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteDataAsset(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteDataAsset, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD(StatusOr, GetDataAsset, + (google::cloud::dataplex::v1::GetDataAssetRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListDataAssets, + (google::cloud::dataplex::v1::ListDataAssetsRequest request), + (override)); + + MOCK_METHOD((StreamRange), ListLocations, + (google::cloud::location::ListLocationsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetLocation, + (google::cloud::location::GetLocationRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, SetIamPolicy, + (google::iam::v1::SetIamPolicyRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, GetIamPolicy, + (google::iam::v1::GetIamPolicyRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, + TestIamPermissions, + (google::iam::v1::TestIamPermissionsRequest 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 dataplex_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DATAPLEX_V1_MOCKS_MOCK_DATA_PRODUCT_CONNECTION_H diff --git a/google/cloud/dataplex/v1/mocks/mock_dataplex_connection.h b/google/cloud/dataplex/v1/mocks/mock_dataplex_connection.h index d513d5740ecc9..ec13917a99670 100644 --- a/google/cloud/dataplex/v1/mocks/mock_dataplex_connection.h +++ b/google/cloud/dataplex/v1/mocks/mock_dataplex_connection.h @@ -538,137 +538,6 @@ class MockDataplexServiceConnection (google::cloud::dataplex::v1::CancelJobRequest const& request), (override)); - /// To disambiguate calls, use: - /// - /// @code - /// using ::testing::_; - /// using ::testing::Matcher; - /// EXPECT_CALL(*mock, - /// CreateEnvironment(Matcher(_))) - /// @endcode - MOCK_METHOD( - future>, - CreateEnvironment, - (google::cloud::dataplex::v1::CreateEnvironmentRequest const& request), - (override)); - - /// To disambiguate calls, use: - /// - /// @code - /// using ::testing::_; - /// EXPECT_CALL(*mock, CreateEnvironment(_, _)) - /// @endcode - MOCK_METHOD( - StatusOr, CreateEnvironment, - (NoAwaitTag, - google::cloud::dataplex::v1::CreateEnvironmentRequest const& request), - (override)); - - /// To disambiguate calls, use: - /// - /// @code - /// using ::testing::_; - /// using ::testing::Matcher; - /// EXPECT_CALL(*mock, - /// CreateEnvironment(Matcher(_))) - /// @endcode - MOCK_METHOD(future>, - CreateEnvironment, - (google::longrunning::Operation const& operation), (override)); - - /// To disambiguate calls, use: - /// - /// @code - /// using ::testing::_; - /// using ::testing::Matcher; - /// EXPECT_CALL(*mock, - /// UpdateEnvironment(Matcher(_))) - /// @endcode - MOCK_METHOD( - future>, - UpdateEnvironment, - (google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request), - (override)); - - /// To disambiguate calls, use: - /// - /// @code - /// using ::testing::_; - /// EXPECT_CALL(*mock, UpdateEnvironment(_, _)) - /// @endcode - MOCK_METHOD( - StatusOr, UpdateEnvironment, - (NoAwaitTag, - google::cloud::dataplex::v1::UpdateEnvironmentRequest const& request), - (override)); - - /// To disambiguate calls, use: - /// - /// @code - /// using ::testing::_; - /// using ::testing::Matcher; - /// EXPECT_CALL(*mock, - /// UpdateEnvironment(Matcher(_))) - /// @endcode - MOCK_METHOD(future>, - UpdateEnvironment, - (google::longrunning::Operation const& operation), (override)); - - /// To disambiguate calls, use: - /// - /// @code - /// using ::testing::_; - /// using ::testing::Matcher; - /// EXPECT_CALL(*mock, - /// DeleteEnvironment(Matcher(_))) - /// @endcode - MOCK_METHOD( - future>, - DeleteEnvironment, - (google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request), - (override)); - - /// To disambiguate calls, use: - /// - /// @code - /// using ::testing::_; - /// EXPECT_CALL(*mock, DeleteEnvironment(_, _)) - /// @endcode - MOCK_METHOD( - StatusOr, DeleteEnvironment, - (NoAwaitTag, - google::cloud::dataplex::v1::DeleteEnvironmentRequest const& request), - (override)); - - /// To disambiguate calls, use: - /// - /// @code - /// using ::testing::_; - /// using ::testing::Matcher; - /// EXPECT_CALL(*mock, - /// DeleteEnvironment(Matcher(_))) - /// @endcode - MOCK_METHOD(future>, - DeleteEnvironment, - (google::longrunning::Operation const& operation), (override)); - - MOCK_METHOD((StreamRange), - ListEnvironments, - (google::cloud::dataplex::v1::ListEnvironmentsRequest request), - (override)); - - MOCK_METHOD( - StatusOr, GetEnvironment, - (google::cloud::dataplex::v1::GetEnvironmentRequest const& request), - (override)); - - MOCK_METHOD((StreamRange), ListSessions, - (google::cloud::dataplex::v1::ListSessionsRequest request), - (override)); - MOCK_METHOD((StreamRange), ListLocations, (google::cloud::location::ListLocationsRequest request), (override)); diff --git a/google/cloud/dataplex/v1/samples/business_glossary_client_samples.cc b/google/cloud/dataplex/v1/samples/business_glossary_client_samples.cc new file mode 100644 index 0000000000000..145a569e04c59 --- /dev/null +++ b/google/cloud/dataplex/v1/samples/business_glossary_client_samples.cc @@ -0,0 +1,240 @@ +// Copyright 2026 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/dataplex/v1/business_glossary.proto + +#include "google/cloud/dataplex/v1/business_glossary_client.h" +#include "google/cloud/dataplex/v1/business_glossary_connection_idempotency_policy.h" +#include "google/cloud/dataplex/v1/business_glossary_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 "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: dataplex_v1::BusinessGlossaryServiceClient +// 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::dataplex_v1::BusinessGlossaryServiceClient( + google::cloud::dataplex_v1::MakeBusinessGlossaryServiceConnection( + options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::dataplex_v1::BusinessGlossaryServiceClient( + google::cloud::dataplex_v1::MakeBusinessGlossaryServiceConnection( + *ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::dataplex_v1:: + BusinessGlossaryServiceConnectionIdempotencyPolicy { + 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::dataplex_v1:: + BusinessGlossaryServiceLimitedErrorCountRetryPolicy(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::dataplex_v1::MakeBusinessGlossaryServiceConnection( + options); + + // c1 and c2 share the same retry policies + auto c1 = + google::cloud::dataplex_v1::BusinessGlossaryServiceClient(connection); + auto c2 = + google::cloud::dataplex_v1::BusinessGlossaryServiceClient(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::dataplex_v1::BusinessGlossaryServiceClient( + connection, google::cloud::Options{} + .set( + google::cloud::dataplex_v1:: + BusinessGlossaryServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::dataplex_v1::BusinessGlossaryServiceLimitedErrorCountRetryPolicy(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::dataplex_v1:: + BusinessGlossaryServiceRetryPolicyOption::Type, + google::cloud::dataplex_v1:: + BusinessGlossaryServiceBackoffPolicyOption::Type>( + google::cloud::dataplex_v1:: + BusinessGlossaryServiceLimitedTimeRetryPolicy( + /*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::dataplex_v1::MakeBusinessGlossaryServiceConnection( + options); + + // c1 and c2 share the same polling policies. + auto c1 = + google::cloud::dataplex_v1::BusinessGlossaryServiceClient(connection); + auto c2 = + google::cloud::dataplex_v1::BusinessGlossaryServiceClient(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::dataplex_v1::BusinessGlossaryServiceClient( + google::cloud::dataplex_v1::MakeBusinessGlossaryServiceConnection( + 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}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dataplex/v1/samples/cmek_client_samples.cc b/google/cloud/dataplex/v1/samples/cmek_client_samples.cc new file mode 100644 index 0000000000000..f1b168be711b4 --- /dev/null +++ b/google/cloud/dataplex/v1/samples/cmek_client_samples.cc @@ -0,0 +1,225 @@ +// Copyright 2026 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/dataplex/v1/cmek.proto + +#include "google/cloud/dataplex/v1/cmek_client.h" +#include "google/cloud/dataplex/v1/cmek_connection_idempotency_policy.h" +#include "google/cloud/dataplex/v1/cmek_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 "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: dataplex_v1::CmekServiceClient +// 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::dataplex_v1::CmekServiceClient( + google::cloud::dataplex_v1::MakeCmekServiceConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::dataplex_v1::CmekServiceClient( + google::cloud::dataplex_v1::MakeCmekServiceConnection(*ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy : public google::cloud::dataplex_v1:: + CmekServiceConnectionIdempotencyPolicy { + public: + ~CustomIdempotencyPolicy() override = default; + std::unique_ptr< + google::cloud::dataplex_v1::CmekServiceConnectionIdempotencyPolicy> + 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::dataplex_v1:: + CmekServiceLimitedErrorCountRetryPolicy(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::dataplex_v1::MakeCmekServiceConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::dataplex_v1::CmekServiceClient(connection); + auto c2 = google::cloud::dataplex_v1::CmekServiceClient(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::dataplex_v1::CmekServiceClient( + connection, + google::cloud::Options{} + .set( + google::cloud::dataplex_v1::CmekServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::dataplex_v1::CmekServiceLimitedErrorCountRetryPolicy(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::dataplex_v1::CmekServiceRetryPolicyOption:: + Type, + google::cloud::dataplex_v1::CmekServiceBackoffPolicyOption:: + Type>( + google::cloud::dataplex_v1::CmekServiceLimitedTimeRetryPolicy( + /*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::dataplex_v1::MakeCmekServiceConnection(options); + + // c1 and c2 share the same polling policies. + auto c1 = google::cloud::dataplex_v1::CmekServiceClient(connection); + auto c2 = google::cloud::dataplex_v1::CmekServiceClient(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::dataplex_v1::CmekServiceClient( + google::cloud::dataplex_v1::MakeCmekServiceConnection(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}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dataplex/v1/samples/data_product_client_samples.cc b/google/cloud/dataplex/v1/samples/data_product_client_samples.cc new file mode 100644 index 0000000000000..b12634c9b6ac6 --- /dev/null +++ b/google/cloud/dataplex/v1/samples/data_product_client_samples.cc @@ -0,0 +1,231 @@ +// Copyright 2026 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/dataplex/v1/data_products.proto + +#include "google/cloud/dataplex/v1/data_product_client.h" +#include "google/cloud/dataplex/v1/data_product_connection_idempotency_policy.h" +#include "google/cloud/dataplex/v1/data_product_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 "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: dataplex_v1::DataProductServiceClient +// 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::dataplex_v1::DataProductServiceClient( + google::cloud::dataplex_v1::MakeDataProductServiceConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::dataplex_v1::DataProductServiceClient( + google::cloud::dataplex_v1::MakeDataProductServiceConnection( + *ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::dataplex_v1:: + DataProductServiceConnectionIdempotencyPolicy { + public: + ~CustomIdempotencyPolicy() override = default; + std::unique_ptr< + google::cloud::dataplex_v1::DataProductServiceConnectionIdempotencyPolicy> + 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::dataplex_v1:: + DataProductServiceLimitedErrorCountRetryPolicy(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::dataplex_v1::MakeDataProductServiceConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::dataplex_v1::DataProductServiceClient(connection); + auto c2 = google::cloud::dataplex_v1::DataProductServiceClient(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::dataplex_v1::DataProductServiceClient( + connection, + google::cloud::Options{} + .set( + google::cloud::dataplex_v1:: + DataProductServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::dataplex_v1::DataProductServiceLimitedErrorCountRetryPolicy(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::dataplex_v1:: + DataProductServiceRetryPolicyOption::Type, + google::cloud::dataplex_v1:: + DataProductServiceBackoffPolicyOption::Type>( + google::cloud::dataplex_v1:: + DataProductServiceLimitedTimeRetryPolicy( + /*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::dataplex_v1::MakeDataProductServiceConnection(options); + + // c1 and c2 share the same polling policies. + auto c1 = google::cloud::dataplex_v1::DataProductServiceClient(connection); + auto c2 = google::cloud::dataplex_v1::DataProductServiceClient(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::dataplex_v1::DataProductServiceClient( + google::cloud::dataplex_v1::MakeDataProductServiceConnection(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}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/dataproc/quickstart/.bazelversion b/google/cloud/dataproc/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/dataproc/quickstart/.bazelversion +++ b/google/cloud/dataproc/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/dataproc/quickstart/WORKSPACE.bazel b/google/cloud/dataproc/quickstart/WORKSPACE.bazel index bace52f43c7ff..229b65b6c62c1 100644 --- a/google/cloud/dataproc/quickstart/WORKSPACE.bazel +++ b/google/cloud/dataproc/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/dataproc/v1/autoscaling_policy_client.h b/google/cloud/dataproc/v1/autoscaling_policy_client.h index fb7c9a7bafc05..6f8ee20004943 100644 --- a/google/cloud/dataproc/v1/autoscaling_policy_client.h +++ b/google/cloud/dataproc/v1/autoscaling_policy_client.h @@ -760,7 +760,7 @@ class AutoscalingPolicyServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -799,7 +799,7 @@ class AutoscalingPolicyServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataproc/v1/batch_controller_client.h b/google/cloud/dataproc/v1/batch_controller_client.h index 3b7e5082d1334..2969dccb5d869 100644 --- a/google/cloud/dataproc/v1/batch_controller_client.h +++ b/google/cloud/dataproc/v1/batch_controller_client.h @@ -716,7 +716,7 @@ class BatchControllerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -755,7 +755,7 @@ class BatchControllerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataproc/v1/cluster_controller_client.h b/google/cloud/dataproc/v1/cluster_controller_client.h index 77edab670b47e..757ff1be9eba7 100644 --- a/google/cloud/dataproc/v1/cluster_controller_client.h +++ b/google/cloud/dataproc/v1/cluster_controller_client.h @@ -1263,7 +1263,7 @@ class ClusterControllerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1302,7 +1302,7 @@ class ClusterControllerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataproc/v1/job_controller_client.h b/google/cloud/dataproc/v1/job_controller_client.h index 888519648d4fe..8ca6f5c2b54e4 100644 --- a/google/cloud/dataproc/v1/job_controller_client.h +++ b/google/cloud/dataproc/v1/job_controller_client.h @@ -926,7 +926,7 @@ class JobControllerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -965,7 +965,7 @@ class JobControllerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataproc/v1/node_group_controller_client.h b/google/cloud/dataproc/v1/node_group_controller_client.h index 7e1f68ef476aa..d821fda576d43 100644 --- a/google/cloud/dataproc/v1/node_group_controller_client.h +++ b/google/cloud/dataproc/v1/node_group_controller_client.h @@ -726,7 +726,7 @@ class NodeGroupControllerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -765,7 +765,7 @@ class NodeGroupControllerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataproc/v1/session_controller_client.h b/google/cloud/dataproc/v1/session_controller_client.h index c0c7899d4761e..f266d396af1aa 100644 --- a/google/cloud/dataproc/v1/session_controller_client.h +++ b/google/cloud/dataproc/v1/session_controller_client.h @@ -889,7 +889,7 @@ class SessionControllerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -928,7 +928,7 @@ class SessionControllerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataproc/v1/session_template_controller_client.h b/google/cloud/dataproc/v1/session_template_controller_client.h index 44bde808302a7..53d2891a911af 100644 --- a/google/cloud/dataproc/v1/session_template_controller_client.h +++ b/google/cloud/dataproc/v1/session_template_controller_client.h @@ -708,7 +708,7 @@ class SessionTemplateControllerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -747,7 +747,7 @@ class SessionTemplateControllerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dataproc/v1/workflow_template_client.h b/google/cloud/dataproc/v1/workflow_template_client.h index 6b5068f653a08..c78b446b1d87b 100644 --- a/google/cloud/dataproc/v1/workflow_template_client.h +++ b/google/cloud/dataproc/v1/workflow_template_client.h @@ -1212,7 +1212,7 @@ class WorkflowTemplateServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1251,7 +1251,7 @@ class WorkflowTemplateServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/datastore/admin/v1/datastore_admin_client.h b/google/cloud/datastore/admin/v1/datastore_admin_client.h index 0187365b0cd68..ceb96c7d6bd42 100644 --- a/google/cloud/datastore/admin/v1/datastore_admin_client.h +++ b/google/cloud/datastore/admin/v1/datastore_admin_client.h @@ -894,7 +894,7 @@ class DatastoreAdminClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -933,7 +933,7 @@ class DatastoreAdminClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/datastore/quickstart/.bazelversion b/google/cloud/datastore/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/datastore/quickstart/.bazelversion +++ b/google/cloud/datastore/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/datastore/quickstart/WORKSPACE.bazel b/google/cloud/datastore/quickstart/WORKSPACE.bazel index 5c52981558c2f..1a614c77c338a 100644 --- a/google/cloud/datastore/quickstart/WORKSPACE.bazel +++ b/google/cloud/datastore/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/datastore/v1/datastore_client.h b/google/cloud/datastore/v1/datastore_client.h index bba0417feb99e..06c7518e2b1cc 100644 --- a/google/cloud/datastore/v1/datastore_client.h +++ b/google/cloud/datastore/v1/datastore_client.h @@ -789,7 +789,7 @@ class DatastoreClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -828,7 +828,7 @@ class DatastoreClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/datastream/quickstart/.bazelversion b/google/cloud/datastream/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/datastream/quickstart/.bazelversion +++ b/google/cloud/datastream/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/datastream/quickstart/WORKSPACE.bazel b/google/cloud/datastream/quickstart/WORKSPACE.bazel index bc3f01f66261c..b9f521593791c 100644 --- a/google/cloud/datastream/quickstart/WORKSPACE.bazel +++ b/google/cloud/datastream/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/datastream/v1/datastream_client.h b/google/cloud/datastream/v1/datastream_client.h index 00348d3b5a124..ede86ff07c9fc 100644 --- a/google/cloud/datastream/v1/datastream_client.h +++ b/google/cloud/datastream/v1/datastream_client.h @@ -2553,7 +2553,7 @@ class DatastreamClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2592,7 +2592,7 @@ class DatastreamClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/deploy/quickstart/.bazelversion b/google/cloud/deploy/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/deploy/quickstart/.bazelversion +++ b/google/cloud/deploy/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/deploy/quickstart/WORKSPACE.bazel b/google/cloud/deploy/quickstart/WORKSPACE.bazel index 8e72e4032d24b..9b340a151e418 100644 --- a/google/cloud/deploy/quickstart/WORKSPACE.bazel +++ b/google/cloud/deploy/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/deploy/v1/cloud_deploy_client.h b/google/cloud/deploy/v1/cloud_deploy_client.h index 859a2c2f6b81d..2f5c1bce61932 100644 --- a/google/cloud/deploy/v1/cloud_deploy_client.h +++ b/google/cloud/deploy/v1/cloud_deploy_client.h @@ -4273,7 +4273,7 @@ class CloudDeployClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -4312,7 +4312,7 @@ class CloudDeployClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/developerconnect/quickstart/.bazelversion b/google/cloud/developerconnect/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/developerconnect/quickstart/.bazelversion +++ b/google/cloud/developerconnect/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/developerconnect/quickstart/WORKSPACE.bazel b/google/cloud/developerconnect/quickstart/WORKSPACE.bazel index e13ac36813047..1388a0feed623 100644 --- a/google/cloud/developerconnect/quickstart/WORKSPACE.bazel +++ b/google/cloud/developerconnect/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/developerconnect/v1/developer_connect_client.h b/google/cloud/developerconnect/v1/developer_connect_client.h index c29ec1d983f62..52be6fb00d5d0 100644 --- a/google/cloud/developerconnect/v1/developer_connect_client.h +++ b/google/cloud/developerconnect/v1/developer_connect_client.h @@ -2634,7 +2634,7 @@ class DeveloperConnectClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2673,7 +2673,7 @@ class DeveloperConnectClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/devicestreaming/quickstart/WORKSPACE.bazel b/google/cloud/devicestreaming/quickstart/WORKSPACE.bazel index 23b4153888242..8d76be278b29c 100644 --- a/google/cloud/devicestreaming/quickstart/WORKSPACE.bazel +++ b/google/cloud/devicestreaming/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/dialogflow_cx/agents_client.h b/google/cloud/dialogflow_cx/agents_client.h index 878c42d016584..9a596a7b87bb9 100644 --- a/google/cloud/dialogflow_cx/agents_client.h +++ b/google/cloud/dialogflow_cx/agents_client.h @@ -1019,7 +1019,7 @@ class AgentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1058,7 +1058,7 @@ class AgentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/changelogs_client.h b/google/cloud/dialogflow_cx/changelogs_client.h index 5bdbb389207a0..6b6b5f0273722 100644 --- a/google/cloud/dialogflow_cx/changelogs_client.h +++ b/google/cloud/dialogflow_cx/changelogs_client.h @@ -455,7 +455,7 @@ class ChangelogsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -494,7 +494,7 @@ class ChangelogsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/deployments_client.h b/google/cloud/dialogflow_cx/deployments_client.h index b4cd315ee8b43..20cc1bee37e70 100644 --- a/google/cloud/dialogflow_cx/deployments_client.h +++ b/google/cloud/dialogflow_cx/deployments_client.h @@ -463,7 +463,7 @@ class DeploymentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -502,7 +502,7 @@ class DeploymentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/entity_types_client.h b/google/cloud/dialogflow_cx/entity_types_client.h index 0ef6f7a8e43c7..35f20b997cf22 100644 --- a/google/cloud/dialogflow_cx/entity_types_client.h +++ b/google/cloud/dialogflow_cx/entity_types_client.h @@ -793,7 +793,7 @@ class EntityTypesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -832,7 +832,7 @@ class EntityTypesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/environments_client.h b/google/cloud/dialogflow_cx/environments_client.h index fec6f85c93c4f..fc55c00496651 100644 --- a/google/cloud/dialogflow_cx/environments_client.h +++ b/google/cloud/dialogflow_cx/environments_client.h @@ -1122,7 +1122,7 @@ class EnvironmentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1161,7 +1161,7 @@ class EnvironmentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/experiments_client.h b/google/cloud/dialogflow_cx/experiments_client.h index c2f258ae7994b..a3862978b512c 100644 --- a/google/cloud/dialogflow_cx/experiments_client.h +++ b/google/cloud/dialogflow_cx/experiments_client.h @@ -763,7 +763,7 @@ class ExperimentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -802,7 +802,7 @@ class ExperimentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/flows_client.h b/google/cloud/dialogflow_cx/flows_client.h index 36aa32e585a8c..2d22e1e8d6ff3 100644 --- a/google/cloud/dialogflow_cx/flows_client.h +++ b/google/cloud/dialogflow_cx/flows_client.h @@ -1042,7 +1042,7 @@ class FlowsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1081,7 +1081,7 @@ class FlowsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/generators_client.h b/google/cloud/dialogflow_cx/generators_client.h index a6ac5ea429bf5..7331e3b14b8af 100644 --- a/google/cloud/dialogflow_cx/generators_client.h +++ b/google/cloud/dialogflow_cx/generators_client.h @@ -625,7 +625,7 @@ class GeneratorsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -664,7 +664,7 @@ class GeneratorsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/intents_client.h b/google/cloud/dialogflow_cx/intents_client.h index 1f5d798fcbf64..a9475c6af854d 100644 --- a/google/cloud/dialogflow_cx/intents_client.h +++ b/google/cloud/dialogflow_cx/intents_client.h @@ -118,7 +118,7 @@ class IntentsClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.cx.v3.Intent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L147} - /// [google.cloud.dialogflow.cx.v3.ListIntentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L288} + /// [google.cloud.dialogflow.cx.v3.ListIntentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L291} /// // clang-format on StreamRange ListIntents( @@ -157,7 +157,7 @@ class IntentsClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.cx.v3.Intent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L147} - /// [google.cloud.dialogflow.cx.v3.ListIntentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L288} + /// [google.cloud.dialogflow.cx.v3.ListIntentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L291} /// // clang-format on StreamRange ListIntents( @@ -184,7 +184,7 @@ class IntentsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.GetIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L335} + /// [google.cloud.dialogflow.cx.v3.GetIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L338} /// [google.cloud.dialogflow.cx.v3.Intent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L147} /// // clang-format on @@ -214,7 +214,7 @@ class IntentsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.GetIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L335} + /// [google.cloud.dialogflow.cx.v3.GetIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L338} /// [google.cloud.dialogflow.cx.v3.Intent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L147} /// // clang-format on @@ -246,7 +246,7 @@ class IntentsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.CreateIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L361} + /// [google.cloud.dialogflow.cx.v3.CreateIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L364} /// [google.cloud.dialogflow.cx.v3.Intent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L147} /// // clang-format on @@ -282,7 +282,7 @@ class IntentsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.CreateIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L361} + /// [google.cloud.dialogflow.cx.v3.CreateIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L364} /// [google.cloud.dialogflow.cx.v3.Intent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L147} /// // clang-format on @@ -315,7 +315,7 @@ class IntentsClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.cx.v3.Intent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L147} - /// [google.cloud.dialogflow.cx.v3.UpdateIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L388} + /// [google.cloud.dialogflow.cx.v3.UpdateIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L391} /// // clang-format on StatusOr UpdateIntent( @@ -350,7 +350,7 @@ class IntentsClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.cx.v3.Intent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L147} - /// [google.cloud.dialogflow.cx.v3.UpdateIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L388} + /// [google.cloud.dialogflow.cx.v3.UpdateIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L391} /// // clang-format on StatusOr UpdateIntent( @@ -379,7 +379,7 @@ class IntentsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.DeleteIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L410} + /// [google.cloud.dialogflow.cx.v3.DeleteIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L413} /// // clang-format on Status DeleteIntent(std::string const& name, Options opts = {}); @@ -409,7 +409,7 @@ class IntentsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.DeleteIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L410} + /// [google.cloud.dialogflow.cx.v3.DeleteIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L413} /// // clang-format on Status DeleteIntent( @@ -455,9 +455,9 @@ class IntentsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.ImportIntentsMetadata]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L531} - /// [google.cloud.dialogflow.cx.v3.ImportIntentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L438} - /// [google.cloud.dialogflow.cx.v3.ImportIntentsResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L503} + /// [google.cloud.dialogflow.cx.v3.ImportIntentsMetadata]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L534} + /// [google.cloud.dialogflow.cx.v3.ImportIntentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L441} + /// [google.cloud.dialogflow.cx.v3.ImportIntentsResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L506} /// // clang-format on future> @@ -533,9 +533,9 @@ class IntentsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.ExportIntentsMetadata]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L608} - /// [google.cloud.dialogflow.cx.v3.ExportIntentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L535} - /// [google.cloud.dialogflow.cx.v3.ExportIntentsResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L590} + /// [google.cloud.dialogflow.cx.v3.ExportIntentsMetadata]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L611} + /// [google.cloud.dialogflow.cx.v3.ExportIntentsRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L538} + /// [google.cloud.dialogflow.cx.v3.ExportIntentsResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/intent.proto#L593} /// // clang-format on future> @@ -807,7 +807,7 @@ class IntentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -846,7 +846,7 @@ class IntentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/pages_client.h b/google/cloud/dialogflow_cx/pages_client.h index a8d0e1ade7cb2..c5004ff6a6a96 100644 --- a/google/cloud/dialogflow_cx/pages_client.h +++ b/google/cloud/dialogflow_cx/pages_client.h @@ -650,7 +650,7 @@ class PagesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -689,7 +689,7 @@ class PagesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/quickstart/.bazelversion b/google/cloud/dialogflow_cx/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/dialogflow_cx/quickstart/.bazelversion +++ b/google/cloud/dialogflow_cx/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/dialogflow_cx/quickstart/WORKSPACE.bazel b/google/cloud/dialogflow_cx/quickstart/WORKSPACE.bazel index ce1add3a3fcc5..e38ae0810537a 100644 --- a/google/cloud/dialogflow_cx/quickstart/WORKSPACE.bazel +++ b/google/cloud/dialogflow_cx/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/dialogflow_cx/security_settings_client.h b/google/cloud/dialogflow_cx/security_settings_client.h index f5590270668f5..085a83d1b62bc 100644 --- a/google/cloud/dialogflow_cx/security_settings_client.h +++ b/google/cloud/dialogflow_cx/security_settings_client.h @@ -652,7 +652,7 @@ class SecuritySettingsServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -691,7 +691,7 @@ class SecuritySettingsServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/session_entity_types_client.h b/google/cloud/dialogflow_cx/session_entity_types_client.h index 52bc5d346b883..2a268dbaa5c3c 100644 --- a/google/cloud/dialogflow_cx/session_entity_types_client.h +++ b/google/cloud/dialogflow_cx/session_entity_types_client.h @@ -665,7 +665,7 @@ class SessionEntityTypesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -704,7 +704,7 @@ class SessionEntityTypesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/sessions_client.h b/google/cloud/dialogflow_cx/sessions_client.h index f7f9c474ec5f5..46bad03cdb42e 100644 --- a/google/cloud/dialogflow_cx/sessions_client.h +++ b/google/cloud/dialogflow_cx/sessions_client.h @@ -64,7 +64,7 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN /// such a copy when using this class from multiple threads. /// /// [google.cloud.dialogflow.cx.v3.Sessions.DetectIntent]: -/// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L75} +/// @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L76} /// class SessionsClient { public: @@ -120,8 +120,8 @@ class SessionsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.DetectIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L218} - /// [google.cloud.dialogflow.cx.v3.DetectIntentResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L260} + /// [google.cloud.dialogflow.cx.v3.DetectIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L219} + /// [google.cloud.dialogflow.cx.v3.DetectIntentResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L261} /// // clang-format on StatusOr @@ -156,8 +156,8 @@ class SessionsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.DetectIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L218} - /// [google.cloud.dialogflow.cx.v3.DetectIntentResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L260} + /// [google.cloud.dialogflow.cx.v3.DetectIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L219} + /// [google.cloud.dialogflow.cx.v3.DetectIntentResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L261} /// // clang-format on StreamRange @@ -192,8 +192,8 @@ class SessionsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L340} - /// [google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L479} + /// [google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L341} + /// [google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L480} /// // clang-format on std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< @@ -225,8 +225,8 @@ class SessionsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.MatchIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L1271} - /// [google.cloud.dialogflow.cx.v3.MatchIntentResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L1303} + /// [google.cloud.dialogflow.cx.v3.MatchIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L1279} + /// [google.cloud.dialogflow.cx.v3.MatchIntentResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L1311} /// // clang-format on StatusOr MatchIntent( @@ -262,10 +262,10 @@ class SessionsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.FulfillIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L1338} - /// [google.cloud.dialogflow.cx.v3.FulfillIntentResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L1351} - /// [google.cloud.dialogflow.cx.v3.MatchIntentResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L1303} - /// [google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L115} + /// [google.cloud.dialogflow.cx.v3.FulfillIntentRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L1346} + /// [google.cloud.dialogflow.cx.v3.FulfillIntentResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L1359} + /// [google.cloud.dialogflow.cx.v3.MatchIntentResponse]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L1311} + /// [google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L116} /// // clang-format on StatusOr @@ -297,8 +297,8 @@ class SessionsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.cx.v3.AnswerFeedback]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L156} - /// [google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L195} + /// [google.cloud.dialogflow.cx.v3.AnswerFeedback]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L157} + /// [google.cloud.dialogflow.cx.v3.SubmitAnswerFeedbackRequest]: @googleapis_reference_link{google/cloud/dialogflow/cx/v3/session.proto#L196} /// // clang-format on StatusOr @@ -542,7 +542,7 @@ class SessionsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -581,7 +581,7 @@ class SessionsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/test_cases_client.h b/google/cloud/dialogflow_cx/test_cases_client.h index 4c73a33d22fe6..43edc1bb5e55d 100644 --- a/google/cloud/dialogflow_cx/test_cases_client.h +++ b/google/cloud/dialogflow_cx/test_cases_client.h @@ -1124,7 +1124,7 @@ class TestCasesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1163,7 +1163,7 @@ class TestCasesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/transition_route_groups_client.h b/google/cloud/dialogflow_cx/transition_route_groups_client.h index 0a1911eb815fc..a4f1e292f83fb 100644 --- a/google/cloud/dialogflow_cx/transition_route_groups_client.h +++ b/google/cloud/dialogflow_cx/transition_route_groups_client.h @@ -691,7 +691,7 @@ class TransitionRouteGroupsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -730,7 +730,7 @@ class TransitionRouteGroupsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/versions_client.h b/google/cloud/dialogflow_cx/versions_client.h index 1d145e1298236..2499019f674bb 100644 --- a/google/cloud/dialogflow_cx/versions_client.h +++ b/google/cloud/dialogflow_cx/versions_client.h @@ -910,7 +910,7 @@ class VersionsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -949,7 +949,7 @@ class VersionsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_cx/webhooks_client.h b/google/cloud/dialogflow_cx/webhooks_client.h index 6d4b2ab8ab931..f3887e0fa5ce8 100644 --- a/google/cloud/dialogflow_cx/webhooks_client.h +++ b/google/cloud/dialogflow_cx/webhooks_client.h @@ -625,7 +625,7 @@ class WebhooksClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -664,7 +664,7 @@ class WebhooksClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/agents_client.h b/google/cloud/dialogflow_es/agents_client.h index 6dd2a5a5a404a..8a74749fe1d68 100644 --- a/google/cloud/dialogflow_es/agents_client.h +++ b/google/cloud/dialogflow_es/agents_client.h @@ -1070,7 +1070,7 @@ class AgentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1109,7 +1109,7 @@ class AgentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/answer_records_client.h b/google/cloud/dialogflow_es/answer_records_client.h index a62172bc61d1b..291db9cefcb76 100644 --- a/google/cloud/dialogflow_es/answer_records_client.h +++ b/google/cloud/dialogflow_es/answer_records_client.h @@ -460,7 +460,7 @@ class AnswerRecordsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -499,7 +499,7 @@ class AnswerRecordsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/contexts_client.h b/google/cloud/dialogflow_es/contexts_client.h index 6341e3073f1f2..77f6217370f35 100644 --- a/google/cloud/dialogflow_es/contexts_client.h +++ b/google/cloud/dialogflow_es/contexts_client.h @@ -689,7 +689,7 @@ class ContextsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -728,7 +728,7 @@ class ContextsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/conversation_datasets_client.h b/google/cloud/dialogflow_es/conversation_datasets_client.h index 7b3fdfdccfcc9..99d528b52707e 100644 --- a/google/cloud/dialogflow_es/conversation_datasets_client.h +++ b/google/cloud/dialogflow_es/conversation_datasets_client.h @@ -832,7 +832,7 @@ class ConversationDatasetsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -871,7 +871,7 @@ class ConversationDatasetsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/conversation_models_client.h b/google/cloud/dialogflow_es/conversation_models_client.h index 7904c8c03b5a2..fb6ce048d935e 100644 --- a/google/cloud/dialogflow_es/conversation_models_client.h +++ b/google/cloud/dialogflow_es/conversation_models_client.h @@ -1172,7 +1172,7 @@ class ConversationModelsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1211,7 +1211,7 @@ class ConversationModelsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/conversation_profiles_client.h b/google/cloud/dialogflow_es/conversation_profiles_client.h index 5b5d2f864c351..e9bd0232a333b 100644 --- a/google/cloud/dialogflow_es/conversation_profiles_client.h +++ b/google/cloud/dialogflow_es/conversation_profiles_client.h @@ -490,8 +490,8 @@ class ConversationProfilesClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.v2.ConversationProfile]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L198} - /// [google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L963} - /// [google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L926} + /// [google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L988} + /// [google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L951} /// // clang-format on future> @@ -559,8 +559,8 @@ class ConversationProfilesClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.v2.ConversationProfile]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L198} - /// [google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L963} - /// [google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L926} + /// [google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L988} + /// [google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L951} /// // clang-format on future> @@ -637,8 +637,8 @@ class ConversationProfilesClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.v2.ConversationProfile]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L198} - /// [google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L963} - /// [google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L926} + /// [google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L988} + /// [google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L951} /// // clang-format on future> @@ -713,8 +713,8 @@ class ConversationProfilesClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L985} - /// [google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L944} + /// [google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L1010} + /// [google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L969} /// [google.cloud.dialogflow.v2.ConversationProfile]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L198} /// // clang-format on @@ -775,8 +775,8 @@ class ConversationProfilesClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L985} - /// [google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L944} + /// [google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L1010} + /// [google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L969} /// [google.cloud.dialogflow.v2.ConversationProfile]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L198} /// // clang-format on @@ -846,8 +846,8 @@ class ConversationProfilesClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L985} - /// [google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L944} + /// [google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L1010} + /// [google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L969} /// [google.cloud.dialogflow.v2.ConversationProfile]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation_profile.proto#L198} /// // clang-format on @@ -1122,7 +1122,7 @@ class ConversationProfilesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1161,7 +1161,7 @@ class ConversationProfilesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/conversations_client.h b/google/cloud/dialogflow_es/conversations_client.h index b44939c58f771..fdea9ecac5811 100644 --- a/google/cloud/dialogflow_es/conversations_client.h +++ b/google/cloud/dialogflow_es/conversations_client.h @@ -131,8 +131,8 @@ class ConversationsClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.v2.Conversation]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L232} - /// [google.cloud.dialogflow.v2.Conversation.conversation_profile]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L386} - /// [google.cloud.dialogflow.v2.CreateConversationRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L436} + /// [google.cloud.dialogflow.v2.Conversation.conversation_profile]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L417} + /// [google.cloud.dialogflow.v2.CreateConversationRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L480} /// [google.cloud.dialogflow.v2.Intent]: @googleapis_reference_link{google/cloud/dialogflow/v2/intent.proto#L197} /// [google.cloud.dialogflow.v2.Intent.live_agent_handoff]: @googleapis_reference_link{google/cloud/dialogflow/v2/intent.proto#L859} /// @@ -186,8 +186,8 @@ class ConversationsClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.v2.Conversation]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L232} - /// [google.cloud.dialogflow.v2.Conversation.conversation_profile]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L386} - /// [google.cloud.dialogflow.v2.CreateConversationRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L436} + /// [google.cloud.dialogflow.v2.Conversation.conversation_profile]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L417} + /// [google.cloud.dialogflow.v2.CreateConversationRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L480} /// [google.cloud.dialogflow.v2.Intent]: @googleapis_reference_link{google/cloud/dialogflow/v2/intent.proto#L197} /// [google.cloud.dialogflow.v2.Intent.live_agent_handoff]: @googleapis_reference_link{google/cloud/dialogflow/v2/intent.proto#L859} /// @@ -225,7 +225,7 @@ class ConversationsClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.v2.Conversation]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L232} - /// [google.cloud.dialogflow.v2.ListConversationsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L464} + /// [google.cloud.dialogflow.v2.ListConversationsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L508} /// // clang-format on StreamRange ListConversations( @@ -264,7 +264,7 @@ class ConversationsClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.v2.Conversation]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L232} - /// [google.cloud.dialogflow.v2.ListConversationsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L464} + /// [google.cloud.dialogflow.v2.ListConversationsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L508} /// // clang-format on StreamRange ListConversations( @@ -291,7 +291,7 @@ class ConversationsClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.v2.Conversation]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L232} - /// [google.cloud.dialogflow.v2.GetConversationRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L506} + /// [google.cloud.dialogflow.v2.GetConversationRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L550} /// // clang-format on StatusOr GetConversation( @@ -321,7 +321,7 @@ class ConversationsClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.v2.Conversation]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L232} - /// [google.cloud.dialogflow.v2.GetConversationRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L506} + /// [google.cloud.dialogflow.v2.GetConversationRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L550} /// // clang-format on StatusOr GetConversation( @@ -348,7 +348,7 @@ class ConversationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.CompleteConversationRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L520} + /// [google.cloud.dialogflow.v2.CompleteConversationRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L564} /// [google.cloud.dialogflow.v2.Conversation]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L232} /// // clang-format on @@ -379,7 +379,7 @@ class ConversationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.CompleteConversationRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L520} + /// [google.cloud.dialogflow.v2.CompleteConversationRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L564} /// [google.cloud.dialogflow.v2.Conversation]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L232} /// // clang-format on @@ -411,8 +411,8 @@ class ConversationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.IngestContextReferencesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L587} - /// [google.cloud.dialogflow.v2.IngestContextReferencesResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L607} + /// [google.cloud.dialogflow.v2.IngestContextReferencesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L631} + /// [google.cloud.dialogflow.v2.IngestContextReferencesResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L651} /// // clang-format on StatusOr @@ -446,8 +446,8 @@ class ConversationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.IngestContextReferencesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L587} - /// [google.cloud.dialogflow.v2.IngestContextReferencesResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L607} + /// [google.cloud.dialogflow.v2.IngestContextReferencesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L631} + /// [google.cloud.dialogflow.v2.IngestContextReferencesResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L651} /// // clang-format on StatusOr @@ -488,7 +488,7 @@ class ConversationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.ListMessagesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L534} + /// [google.cloud.dialogflow.v2.ListMessagesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L578} /// [google.cloud.dialogflow.v2.Message]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L323} /// // clang-format on @@ -531,7 +531,7 @@ class ConversationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.ListMessagesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L534} + /// [google.cloud.dialogflow.v2.ListMessagesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L578} /// [google.cloud.dialogflow.v2.Message]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L323} /// // clang-format on @@ -560,8 +560,8 @@ class ConversationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.SuggestConversationSummaryRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L614} - /// [google.cloud.dialogflow.v2.SuggestConversationSummaryResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L651} + /// [google.cloud.dialogflow.v2.SuggestConversationSummaryRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L658} + /// [google.cloud.dialogflow.v2.SuggestConversationSummaryResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L695} /// // clang-format on StatusOr @@ -593,8 +593,8 @@ class ConversationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.SuggestConversationSummaryRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L614} - /// [google.cloud.dialogflow.v2.SuggestConversationSummaryResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L651} + /// [google.cloud.dialogflow.v2.SuggestConversationSummaryRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L658} + /// [google.cloud.dialogflow.v2.SuggestConversationSummaryResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L695} /// // clang-format on StatusOr @@ -627,8 +627,8 @@ class ConversationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L696} - /// [google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L747} + /// [google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L753} + /// [google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L804} /// // clang-format on StatusOr @@ -661,8 +661,8 @@ class ConversationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L784} - /// [google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L834} + /// [google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L841} + /// [google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L891} /// // clang-format on StatusOr @@ -694,8 +694,8 @@ class ConversationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.SearchKnowledgeRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L842} - /// [google.cloud.dialogflow.v2.SearchKnowledgeResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L1122} + /// [google.cloud.dialogflow.v2.SearchKnowledgeRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L899} + /// [google.cloud.dialogflow.v2.SearchKnowledgeResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L1209} /// // clang-format on StatusOr @@ -727,8 +727,8 @@ class ConversationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.GenerateSuggestionsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L1183} - /// [google.cloud.dialogflow.v2.GenerateSuggestionsResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L889} + /// [google.cloud.dialogflow.v2.GenerateSuggestionsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L1273} + /// [google.cloud.dialogflow.v2.GenerateSuggestionsResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L894} /// // clang-format on StatusOr @@ -759,8 +759,8 @@ class ConversationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.GenerateSuggestionsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L1183} - /// [google.cloud.dialogflow.v2.GenerateSuggestionsResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L889} + /// [google.cloud.dialogflow.v2.GenerateSuggestionsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/conversation.proto#L1273} + /// [google.cloud.dialogflow.v2.GenerateSuggestionsResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L894} /// // clang-format on StatusOr @@ -1003,7 +1003,7 @@ class ConversationsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1042,7 +1042,7 @@ class ConversationsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/documents_client.h b/google/cloud/dialogflow_es/documents_client.h index 06efc7bb18e75..1e258f256ce42 100644 --- a/google/cloud/dialogflow_es/documents_client.h +++ b/google/cloud/dialogflow_es/documents_client.h @@ -1167,7 +1167,7 @@ class DocumentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1206,7 +1206,7 @@ class DocumentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/encryption_spec_client.h b/google/cloud/dialogflow_es/encryption_spec_client.h index 88a8f2e607f30..6bb45f445bc35 100644 --- a/google/cloud/dialogflow_es/encryption_spec_client.h +++ b/google/cloud/dialogflow_es/encryption_spec_client.h @@ -516,7 +516,7 @@ class EncryptionSpecServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -555,7 +555,7 @@ class EncryptionSpecServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/entity_types_client.h b/google/cloud/dialogflow_es/entity_types_client.h index 03723b8853e34..ae0fe2e3e0118 100644 --- a/google/cloud/dialogflow_es/entity_types_client.h +++ b/google/cloud/dialogflow_es/entity_types_client.h @@ -1685,7 +1685,7 @@ class EntityTypesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1724,7 +1724,7 @@ class EntityTypesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/environments_client.h b/google/cloud/dialogflow_es/environments_client.h index 2fc5126ff2d13..7d7fbf80935d5 100644 --- a/google/cloud/dialogflow_es/environments_client.h +++ b/google/cloud/dialogflow_es/environments_client.h @@ -575,7 +575,7 @@ class EnvironmentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -614,7 +614,7 @@ class EnvironmentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/fulfillments_client.h b/google/cloud/dialogflow_es/fulfillments_client.h index af135dac8d355..c499d18302bfe 100644 --- a/google/cloud/dialogflow_es/fulfillments_client.h +++ b/google/cloud/dialogflow_es/fulfillments_client.h @@ -440,7 +440,7 @@ class FulfillmentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -479,7 +479,7 @@ class FulfillmentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/generators_client.h b/google/cloud/dialogflow_es/generators_client.h index 460f0fbb745b2..7e3083c10afdb 100644 --- a/google/cloud/dialogflow_es/generators_client.h +++ b/google/cloud/dialogflow_es/generators_client.h @@ -118,8 +118,8 @@ class GeneratorsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.CreateGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L100} - /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L396} + /// [google.cloud.dialogflow.v2.CreateGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L103} + /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L399} /// // clang-format on StatusOr CreateGenerator( @@ -150,8 +150,8 @@ class GeneratorsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.CreateGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L100} - /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L396} + /// [google.cloud.dialogflow.v2.CreateGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L103} + /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L399} /// // clang-format on StatusOr CreateGenerator( @@ -177,8 +177,8 @@ class GeneratorsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L396} - /// [google.cloud.dialogflow.v2.GetGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L127} + /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L399} + /// [google.cloud.dialogflow.v2.GetGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L130} /// // clang-format on StatusOr GetGenerator( @@ -207,8 +207,8 @@ class GeneratorsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L396} - /// [google.cloud.dialogflow.v2.GetGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L127} + /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L399} + /// [google.cloud.dialogflow.v2.GetGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L130} /// // clang-format on StatusOr GetGenerator( @@ -243,8 +243,8 @@ class GeneratorsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L396} - /// [google.cloud.dialogflow.v2.ListGeneratorsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L139} + /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L399} + /// [google.cloud.dialogflow.v2.ListGeneratorsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L142} /// // clang-format on StreamRange ListGenerators( @@ -282,8 +282,8 @@ class GeneratorsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L396} - /// [google.cloud.dialogflow.v2.ListGeneratorsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L139} + /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L399} + /// [google.cloud.dialogflow.v2.ListGeneratorsRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L142} /// // clang-format on StreamRange ListGenerators( @@ -307,7 +307,7 @@ class GeneratorsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.DeleteGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L168} + /// [google.cloud.dialogflow.v2.DeleteGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L171} /// // clang-format on Status DeleteGenerator(std::string const& name, Options opts = {}); @@ -333,7 +333,7 @@ class GeneratorsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.DeleteGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L168} + /// [google.cloud.dialogflow.v2.DeleteGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L171} /// // clang-format on Status DeleteGenerator( @@ -360,8 +360,8 @@ class GeneratorsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L396} - /// [google.cloud.dialogflow.v2.UpdateGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L180} + /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L399} + /// [google.cloud.dialogflow.v2.UpdateGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L183} /// // clang-format on StatusOr UpdateGenerator( @@ -391,8 +391,8 @@ class GeneratorsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L396} - /// [google.cloud.dialogflow.v2.UpdateGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L180} + /// [google.cloud.dialogflow.v2.Generator]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L399} + /// [google.cloud.dialogflow.v2.UpdateGeneratorRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/generator.proto#L183} /// // clang-format on StatusOr UpdateGenerator( @@ -634,7 +634,7 @@ class GeneratorsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -673,7 +673,7 @@ class GeneratorsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/intents_client.h b/google/cloud/dialogflow_es/intents_client.h index 545db73bce79d..805ce491f628b 100644 --- a/google/cloud/dialogflow_es/intents_client.h +++ b/google/cloud/dialogflow_es/intents_client.h @@ -1169,7 +1169,7 @@ class IntentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1208,7 +1208,7 @@ class IntentsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/knowledge_bases_client.h b/google/cloud/dialogflow_es/knowledge_bases_client.h index e7bd08a4acf80..2ad7dd9b106d0 100644 --- a/google/cloud/dialogflow_es/knowledge_bases_client.h +++ b/google/cloud/dialogflow_es/knowledge_bases_client.h @@ -627,7 +627,7 @@ class KnowledgeBasesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -666,7 +666,7 @@ class KnowledgeBasesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/participants_client.h b/google/cloud/dialogflow_es/participants_client.h index 9711fd6250274..ffd2ae0eeee8c 100644 --- a/google/cloud/dialogflow_es/participants_client.h +++ b/google/cloud/dialogflow_es/participants_client.h @@ -514,7 +514,7 @@ class ParticipantsClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L602} - /// [google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L719} + /// [google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L724} /// // clang-format on std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< @@ -542,8 +542,8 @@ class ParticipantsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.SuggestArticlesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L776} - /// [google.cloud.dialogflow.v2.SuggestArticlesResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L811} + /// [google.cloud.dialogflow.v2.SuggestArticlesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L781} + /// [google.cloud.dialogflow.v2.SuggestArticlesResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L816} /// // clang-format on StatusOr @@ -573,8 +573,8 @@ class ParticipantsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.SuggestArticlesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L776} - /// [google.cloud.dialogflow.v2.SuggestArticlesResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L811} + /// [google.cloud.dialogflow.v2.SuggestArticlesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L781} + /// [google.cloud.dialogflow.v2.SuggestArticlesResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L816} /// // clang-format on StatusOr @@ -602,8 +602,8 @@ class ParticipantsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.SuggestFaqAnswersRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L833} - /// [google.cloud.dialogflow.v2.SuggestFaqAnswersResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L867} + /// [google.cloud.dialogflow.v2.SuggestFaqAnswersRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L838} + /// [google.cloud.dialogflow.v2.SuggestFaqAnswersResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L872} /// // clang-format on StatusOr @@ -633,8 +633,8 @@ class ParticipantsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.SuggestFaqAnswersRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L833} - /// [google.cloud.dialogflow.v2.SuggestFaqAnswersResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L867} + /// [google.cloud.dialogflow.v2.SuggestFaqAnswersRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L838} + /// [google.cloud.dialogflow.v2.SuggestFaqAnswersResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L872} /// // clang-format on StatusOr @@ -662,8 +662,8 @@ class ParticipantsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.SuggestSmartRepliesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L922} - /// [google.cloud.dialogflow.v2.SuggestSmartRepliesResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L955} + /// [google.cloud.dialogflow.v2.SuggestSmartRepliesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L927} + /// [google.cloud.dialogflow.v2.SuggestSmartRepliesResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L960} /// // clang-format on StatusOr @@ -693,8 +693,8 @@ class ParticipantsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.SuggestSmartRepliesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L922} - /// [google.cloud.dialogflow.v2.SuggestSmartRepliesResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L955} + /// [google.cloud.dialogflow.v2.SuggestSmartRepliesRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L927} + /// [google.cloud.dialogflow.v2.SuggestSmartRepliesResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L960} /// // clang-format on StatusOr @@ -725,8 +725,8 @@ class ParticipantsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L1288} - /// [google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L1325} + /// [google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L1293} + /// [google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse]: @googleapis_reference_link{google/cloud/dialogflow/v2/participant.proto#L1330} /// // clang-format on StatusOr @@ -970,7 +970,7 @@ class ParticipantsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1009,7 +1009,7 @@ class ParticipantsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/quickstart/.bazelversion b/google/cloud/dialogflow_es/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/dialogflow_es/quickstart/.bazelversion +++ b/google/cloud/dialogflow_es/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/dialogflow_es/quickstart/WORKSPACE.bazel b/google/cloud/dialogflow_es/quickstart/WORKSPACE.bazel index ce1add3a3fcc5..e38ae0810537a 100644 --- a/google/cloud/dialogflow_es/quickstart/WORKSPACE.bazel +++ b/google/cloud/dialogflow_es/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/dialogflow_es/session_entity_types_client.h b/google/cloud/dialogflow_es/session_entity_types_client.h index 3d111b38aa599..83682a4565b1f 100644 --- a/google/cloud/dialogflow_es/session_entity_types_client.h +++ b/google/cloud/dialogflow_es/session_entity_types_client.h @@ -726,7 +726,7 @@ class SessionEntityTypesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -765,7 +765,7 @@ class SessionEntityTypesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/sessions_client.h b/google/cloud/dialogflow_es/sessions_client.h index 675bd26e002a6..3b614539f7c8e 100644 --- a/google/cloud/dialogflow_es/sessions_client.h +++ b/google/cloud/dialogflow_es/sessions_client.h @@ -474,7 +474,7 @@ class SessionsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -513,7 +513,7 @@ class SessionsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dialogflow_es/versions_client.h b/google/cloud/dialogflow_es/versions_client.h index 27bc3d0558763..9c70493867b16 100644 --- a/google/cloud/dialogflow_es/versions_client.h +++ b/google/cloud/dialogflow_es/versions_client.h @@ -652,7 +652,7 @@ class VersionsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -691,7 +691,7 @@ class VersionsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/quickstart/.bazelversion b/google/cloud/discoveryengine/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/discoveryengine/quickstart/.bazelversion +++ b/google/cloud/discoveryengine/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/discoveryengine/quickstart/WORKSPACE.bazel b/google/cloud/discoveryengine/quickstart/WORKSPACE.bazel index 496340f4017e8..08e01828238f3 100644 --- a/google/cloud/discoveryengine/quickstart/WORKSPACE.bazel +++ b/google/cloud/discoveryengine/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/discoveryengine/v1/completion_client.h b/google/cloud/discoveryengine/v1/completion_client.h index 14d32507e21aa..edc80a96905af 100644 --- a/google/cloud/discoveryengine/v1/completion_client.h +++ b/google/cloud/discoveryengine/v1/completion_client.h @@ -585,7 +585,7 @@ class CompletionServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -624,7 +624,7 @@ class CompletionServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/v1/control_client.h b/google/cloud/discoveryengine/v1/control_client.h index 922014aee3b21..96827f3eddf64 100644 --- a/google/cloud/discoveryengine/v1/control_client.h +++ b/google/cloud/discoveryengine/v1/control_client.h @@ -599,7 +599,7 @@ class ControlServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -638,7 +638,7 @@ class ControlServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/v1/conversational_search_client.h b/google/cloud/discoveryengine/v1/conversational_search_client.h index 0652caa32f94c..8a72cea5929be 100644 --- a/google/cloud/discoveryengine/v1/conversational_search_client.h +++ b/google/cloud/discoveryengine/v1/conversational_search_client.h @@ -1117,7 +1117,7 @@ class ConversationalSearchServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1156,7 +1156,7 @@ class ConversationalSearchServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/v1/data_store_client.h b/google/cloud/discoveryengine/v1/data_store_client.h index 2246f1da5ed89..eb19f5aac9048 100644 --- a/google/cloud/discoveryengine/v1/data_store_client.h +++ b/google/cloud/discoveryengine/v1/data_store_client.h @@ -741,7 +741,7 @@ class DataStoreServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -780,7 +780,7 @@ class DataStoreServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/v1/document_client.h b/google/cloud/discoveryengine/v1/document_client.h index 04f437afa6e13..f8e6a98ba8176 100644 --- a/google/cloud/discoveryengine/v1/document_client.h +++ b/google/cloud/discoveryengine/v1/document_client.h @@ -840,7 +840,7 @@ class DocumentServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -879,7 +879,7 @@ class DocumentServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/v1/engine_client.h b/google/cloud/discoveryengine/v1/engine_client.h index b0ae5eca997e7..2c985a686bfee 100644 --- a/google/cloud/discoveryengine/v1/engine_client.h +++ b/google/cloud/discoveryengine/v1/engine_client.h @@ -712,7 +712,7 @@ class EngineServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -751,7 +751,7 @@ class EngineServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/v1/grounded_generation_client.h b/google/cloud/discoveryengine/v1/grounded_generation_client.h index ff238d0d98f1b..6835fd4e84ed8 100644 --- a/google/cloud/discoveryengine/v1/grounded_generation_client.h +++ b/google/cloud/discoveryengine/v1/grounded_generation_client.h @@ -350,7 +350,7 @@ class GroundedGenerationServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -389,7 +389,7 @@ class GroundedGenerationServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/v1/project_client.h b/google/cloud/discoveryengine/v1/project_client.h index adf178f9f0434..f1836e23c4ec5 100644 --- a/google/cloud/discoveryengine/v1/project_client.h +++ b/google/cloud/discoveryengine/v1/project_client.h @@ -384,7 +384,7 @@ class ProjectServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -423,7 +423,7 @@ class ProjectServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/v1/rank_client.h b/google/cloud/discoveryengine/v1/rank_client.h index 814965743edba..4e73c4371b1fe 100644 --- a/google/cloud/discoveryengine/v1/rank_client.h +++ b/google/cloud/discoveryengine/v1/rank_client.h @@ -282,7 +282,7 @@ class RankServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -321,7 +321,7 @@ class RankServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/v1/recommendation_client.h b/google/cloud/discoveryengine/v1/recommendation_client.h index d085ef336c695..0c6d98e29a38f 100644 --- a/google/cloud/discoveryengine/v1/recommendation_client.h +++ b/google/cloud/discoveryengine/v1/recommendation_client.h @@ -285,7 +285,7 @@ class RecommendationServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -324,7 +324,7 @@ class RecommendationServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/v1/schema_client.h b/google/cloud/discoveryengine/v1/schema_client.h index 5bdc265147c54..b49d005c6a80d 100644 --- a/google/cloud/discoveryengine/v1/schema_client.h +++ b/google/cloud/discoveryengine/v1/schema_client.h @@ -698,7 +698,7 @@ class SchemaServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -737,7 +737,7 @@ class SchemaServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/v1/search_client.h b/google/cloud/discoveryengine/v1/search_client.h index f92fcae3dea9f..28518dcece0ff 100644 --- a/google/cloud/discoveryengine/v1/search_client.h +++ b/google/cloud/discoveryengine/v1/search_client.h @@ -344,7 +344,7 @@ class SearchServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -383,7 +383,7 @@ class SearchServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/v1/site_search_engine_client.h b/google/cloud/discoveryengine/v1/site_search_engine_client.h index 3c786dd352d5f..4978c26a54e2b 100644 --- a/google/cloud/discoveryengine/v1/site_search_engine_client.h +++ b/google/cloud/discoveryengine/v1/site_search_engine_client.h @@ -1557,7 +1557,7 @@ class SiteSearchEngineServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1596,7 +1596,7 @@ class SiteSearchEngineServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/discoveryengine/v1/user_event_client.h b/google/cloud/discoveryengine/v1/user_event_client.h index 524b6036bc47d..03ab0d3155b80 100644 --- a/google/cloud/discoveryengine/v1/user_event_client.h +++ b/google/cloud/discoveryengine/v1/user_event_client.h @@ -468,7 +468,7 @@ class UserEventServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -507,7 +507,7 @@ class UserEventServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/dlp/quickstart/.bazelversion b/google/cloud/dlp/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/dlp/quickstart/.bazelversion +++ b/google/cloud/dlp/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/dlp/quickstart/WORKSPACE.bazel b/google/cloud/dlp/quickstart/WORKSPACE.bazel index 3ff8811d29c2b..5ca236e26bce1 100644 --- a/google/cloud/dlp/quickstart/WORKSPACE.bazel +++ b/google/cloud/dlp/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/dlp/v2/dlp_client.h b/google/cloud/dlp/v2/dlp_client.h index 9678fa43266bd..82ec0f59f9762 100644 --- a/google/cloud/dlp/v2/dlp_client.h +++ b/google/cloud/dlp/v2/dlp_client.h @@ -121,8 +121,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.InspectContentRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1816} - /// [google.privacy.dlp.v2.InspectContentResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1856} + /// [google.privacy.dlp.v2.InspectContentRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1941} + /// [google.privacy.dlp.v2.InspectContentResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1981} /// // clang-format on StatusOr InspectContent( @@ -163,8 +163,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.RedactImageRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1571} - /// [google.privacy.dlp.v2.RedactImageResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1661} + /// [google.privacy.dlp.v2.RedactImageRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1696} + /// [google.privacy.dlp.v2.RedactImageResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1786} /// // clang-format on StatusOr RedactImage( @@ -202,8 +202,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeidentifyContentRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1675} - /// [google.privacy.dlp.v2.DeidentifyContentResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1735} + /// [google.privacy.dlp.v2.DeidentifyContentRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1800} + /// [google.privacy.dlp.v2.DeidentifyContentResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1860} /// // clang-format on StatusOr @@ -237,8 +237,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ReidentifyContentRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1744} - /// [google.privacy.dlp.v2.ReidentifyContentResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1807} + /// [google.privacy.dlp.v2.ReidentifyContentRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1869} + /// [google.privacy.dlp.v2.ReidentifyContentResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L1932} /// // clang-format on StatusOr @@ -271,8 +271,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ListInfoTypesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L2362} - /// [google.privacy.dlp.v2.ListInfoTypesResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L2384} + /// [google.privacy.dlp.v2.ListInfoTypesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L2506} + /// [google.privacy.dlp.v2.ListInfoTypesResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L2528} /// // clang-format on StatusOr ListInfoTypes( @@ -304,8 +304,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ListInfoTypesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L2362} - /// [google.privacy.dlp.v2.ListInfoTypesResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L2384} + /// [google.privacy.dlp.v2.ListInfoTypesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L2506} + /// [google.privacy.dlp.v2.ListInfoTypesResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L2528} /// // clang-format on StatusOr ListInfoTypes( @@ -354,8 +354,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CreateInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4448} - /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4024} + /// [google.privacy.dlp.v2.CreateInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4592} + /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4168} /// // clang-format on StatusOr CreateInspectTemplate( @@ -390,8 +390,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CreateInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4448} - /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4024} + /// [google.privacy.dlp.v2.CreateInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4592} + /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4168} /// // clang-format on StatusOr CreateInspectTemplate( @@ -423,8 +423,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4024} - /// [google.privacy.dlp.v2.UpdateInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4490} + /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4168} + /// [google.privacy.dlp.v2.UpdateInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4634} /// // clang-format on StatusOr UpdateInspectTemplate( @@ -458,8 +458,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4024} - /// [google.privacy.dlp.v2.UpdateInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4490} + /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4168} + /// [google.privacy.dlp.v2.UpdateInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4634} /// // clang-format on StatusOr UpdateInspectTemplate( @@ -489,8 +489,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.GetInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4509} - /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4024} + /// [google.privacy.dlp.v2.GetInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4653} + /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4168} /// // clang-format on StatusOr GetInspectTemplate( @@ -522,8 +522,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.GetInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4509} - /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4024} + /// [google.privacy.dlp.v2.GetInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4653} + /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4168} /// // clang-format on StatusOr GetInspectTemplate( @@ -579,8 +579,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4024} - /// [google.privacy.dlp.v2.ListInspectTemplatesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4522} + /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4168} + /// [google.privacy.dlp.v2.ListInspectTemplatesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4666} /// // clang-format on StreamRange ListInspectTemplates( @@ -621,8 +621,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4024} - /// [google.privacy.dlp.v2.ListInspectTemplatesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4522} + /// [google.privacy.dlp.v2.InspectTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4168} + /// [google.privacy.dlp.v2.ListInspectTemplatesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4666} /// // clang-format on StreamRange ListInspectTemplates( @@ -650,7 +650,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4588} + /// [google.privacy.dlp.v2.DeleteInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4732} /// // clang-format on Status DeleteInspectTemplate(std::string const& name, Options opts = {}); @@ -679,7 +679,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4588} + /// [google.privacy.dlp.v2.DeleteInspectTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4732} /// // clang-format on Status DeleteInspectTemplate( @@ -728,8 +728,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CreateDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6713} - /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4062} + /// [google.privacy.dlp.v2.CreateDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6857} + /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4206} /// // clang-format on StatusOr @@ -765,8 +765,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CreateDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6713} - /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4062} + /// [google.privacy.dlp.v2.CreateDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6857} + /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4206} /// // clang-format on StatusOr @@ -800,8 +800,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4062} - /// [google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6756} + /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4206} + /// [google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6900} /// // clang-format on StatusOr @@ -836,8 +836,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4062} - /// [google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6756} + /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4206} + /// [google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6900} /// // clang-format on StatusOr @@ -868,8 +868,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4062} - /// [google.privacy.dlp.v2.GetDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6776} + /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4206} + /// [google.privacy.dlp.v2.GetDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6920} /// // clang-format on StatusOr GetDeidentifyTemplate( @@ -901,8 +901,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4062} - /// [google.privacy.dlp.v2.GetDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6776} + /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4206} + /// [google.privacy.dlp.v2.GetDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6920} /// // clang-format on StatusOr GetDeidentifyTemplate( @@ -958,8 +958,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4062} - /// [google.privacy.dlp.v2.ListDeidentifyTemplatesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6789} + /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4206} + /// [google.privacy.dlp.v2.ListDeidentifyTemplatesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6933} /// // clang-format on StreamRange @@ -1000,8 +1000,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4062} - /// [google.privacy.dlp.v2.ListDeidentifyTemplatesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6789} + /// [google.privacy.dlp.v2.DeidentifyTemplate]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4206} + /// [google.privacy.dlp.v2.ListDeidentifyTemplatesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6933} /// // clang-format on StreamRange @@ -1031,7 +1031,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6856} + /// [google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7000} /// // clang-format on Status DeleteDeidentifyTemplate(std::string const& name, Options opts = {}); @@ -1060,7 +1060,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6856} + /// [google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7000} /// // clang-format on Status DeleteDeidentifyTemplate( @@ -1105,8 +1105,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CreateJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4601} - /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4126} + /// [google.privacy.dlp.v2.CreateJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4745} + /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4270} /// // clang-format on StatusOr CreateJobTrigger( @@ -1141,8 +1141,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CreateJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4601} - /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4126} + /// [google.privacy.dlp.v2.CreateJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4745} + /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4270} /// // clang-format on StatusOr CreateJobTrigger( @@ -1173,8 +1173,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4126} - /// [google.privacy.dlp.v2.UpdateJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4649} + /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4270} + /// [google.privacy.dlp.v2.UpdateJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4793} /// // clang-format on StatusOr UpdateJobTrigger( @@ -1208,8 +1208,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4126} - /// [google.privacy.dlp.v2.UpdateJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4649} + /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4270} + /// [google.privacy.dlp.v2.UpdateJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4793} /// // clang-format on StatusOr UpdateJobTrigger( @@ -1237,8 +1237,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.HybridInspectJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7138} - /// [google.privacy.dlp.v2.HybridInspectResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7217} + /// [google.privacy.dlp.v2.HybridInspectJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7282} + /// [google.privacy.dlp.v2.HybridInspectResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7361} /// // clang-format on StatusOr @@ -1269,8 +1269,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.HybridInspectJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7138} - /// [google.privacy.dlp.v2.HybridInspectResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7217} + /// [google.privacy.dlp.v2.HybridInspectJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7282} + /// [google.privacy.dlp.v2.HybridInspectResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7361} /// // clang-format on StatusOr @@ -1300,8 +1300,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.GetJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4665} - /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4126} + /// [google.privacy.dlp.v2.GetJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4809} + /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4270} /// // clang-format on StatusOr GetJobTrigger( @@ -1333,8 +1333,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.GetJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4665} - /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4126} + /// [google.privacy.dlp.v2.GetJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4809} + /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4270} /// // clang-format on StatusOr GetJobTrigger( @@ -1386,8 +1386,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4126} - /// [google.privacy.dlp.v2.ListJobTriggersRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4850} + /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4270} + /// [google.privacy.dlp.v2.ListJobTriggersRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4994} /// // clang-format on StreamRange ListJobTriggers( @@ -1428,8 +1428,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4126} - /// [google.privacy.dlp.v2.ListJobTriggersRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4850} + /// [google.privacy.dlp.v2.JobTrigger]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4270} + /// [google.privacy.dlp.v2.ListJobTriggersRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4994} /// // clang-format on StreamRange ListJobTriggers( @@ -1456,7 +1456,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4945} + /// [google.privacy.dlp.v2.DeleteJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5089} /// // clang-format on Status DeleteJobTrigger(std::string const& name, Options opts = {}); @@ -1485,7 +1485,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4945} + /// [google.privacy.dlp.v2.DeleteJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5089} /// // clang-format on Status DeleteJobTrigger( @@ -1516,8 +1516,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ActivateJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4639} - /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6505} + /// [google.privacy.dlp.v2.ActivateJobTriggerRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4783} + /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6649} /// // clang-format on StatusOr ActivateJobTrigger( @@ -1557,8 +1557,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CreateDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4675} - /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5396} + /// [google.privacy.dlp.v2.CreateDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4819} + /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5540} /// // clang-format on StatusOr CreateDiscoveryConfig( @@ -1589,8 +1589,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CreateDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4675} - /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5396} + /// [google.privacy.dlp.v2.CreateDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4819} + /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5540} /// // clang-format on StatusOr CreateDiscoveryConfig( @@ -1618,8 +1618,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5396} - /// [google.privacy.dlp.v2.UpdateDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4709} + /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5540} + /// [google.privacy.dlp.v2.UpdateDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4853} /// // clang-format on StatusOr UpdateDiscoveryConfig( @@ -1650,8 +1650,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5396} - /// [google.privacy.dlp.v2.UpdateDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4709} + /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5540} + /// [google.privacy.dlp.v2.UpdateDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4853} /// // clang-format on StatusOr UpdateDiscoveryConfig( @@ -1677,8 +1677,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5396} - /// [google.privacy.dlp.v2.GetDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4727} + /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5540} + /// [google.privacy.dlp.v2.GetDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4871} /// // clang-format on StatusOr GetDiscoveryConfig( @@ -1707,8 +1707,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5396} - /// [google.privacy.dlp.v2.GetDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4727} + /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5540} + /// [google.privacy.dlp.v2.GetDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4871} /// // clang-format on StatusOr GetDiscoveryConfig( @@ -1751,8 +1751,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5396} - /// [google.privacy.dlp.v2.ListDiscoveryConfigsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4739} + /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5540} + /// [google.privacy.dlp.v2.ListDiscoveryConfigsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4883} /// // clang-format on StreamRange ListDiscoveryConfigs( @@ -1790,8 +1790,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5396} - /// [google.privacy.dlp.v2.ListDiscoveryConfigsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4739} + /// [google.privacy.dlp.v2.DiscoveryConfig]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L5540} + /// [google.privacy.dlp.v2.ListDiscoveryConfigsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4883} /// // clang-format on StreamRange ListDiscoveryConfigs( @@ -1815,7 +1815,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4791} + /// [google.privacy.dlp.v2.DeleteDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4935} /// // clang-format on Status DeleteDiscoveryConfig(std::string const& name, Options opts = {}); @@ -1841,7 +1841,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4791} + /// [google.privacy.dlp.v2.DeleteDiscoveryConfigRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4935} /// // clang-format on Status DeleteDiscoveryConfig( @@ -1891,8 +1891,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CreateDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4805} - /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6505} + /// [google.privacy.dlp.v2.CreateDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4949} + /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6649} /// // clang-format on StatusOr CreateDlpJob( @@ -1944,8 +1944,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CreateDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4805} - /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6505} + /// [google.privacy.dlp.v2.CreateDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4949} + /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6649} /// // clang-format on StatusOr CreateDlpJob( @@ -1985,8 +1985,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CreateDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4805} - /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6505} + /// [google.privacy.dlp.v2.CreateDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L4949} + /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6649} /// // clang-format on StatusOr CreateDlpJob( @@ -2040,8 +2040,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6505} - /// [google.privacy.dlp.v2.ListDlpJobsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6592} + /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6649} + /// [google.privacy.dlp.v2.ListDlpJobsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6736} /// // clang-format on StreamRange ListDlpJobs( @@ -2084,8 +2084,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6505} - /// [google.privacy.dlp.v2.ListDlpJobsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6592} + /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6649} + /// [google.privacy.dlp.v2.ListDlpJobsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6736} /// // clang-format on StreamRange ListDlpJobs( @@ -2114,8 +2114,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6505} - /// [google.privacy.dlp.v2.GetDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6583} + /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6649} + /// [google.privacy.dlp.v2.GetDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6727} /// // clang-format on StatusOr GetDlpJob(std::string const& name, @@ -2149,8 +2149,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6505} - /// [google.privacy.dlp.v2.GetDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6583} + /// [google.privacy.dlp.v2.DlpJob]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6649} + /// [google.privacy.dlp.v2.GetDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6727} /// // clang-format on StatusOr GetDlpJob( @@ -2180,7 +2180,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6704} + /// [google.privacy.dlp.v2.DeleteDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6848} /// // clang-format on Status DeleteDlpJob(std::string const& name, Options opts = {}); @@ -2213,7 +2213,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6704} + /// [google.privacy.dlp.v2.DeleteDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6848} /// // clang-format on Status DeleteDlpJob( @@ -2248,7 +2248,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CancelDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6686} + /// [google.privacy.dlp.v2.CancelDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6830} /// // clang-format on Status CancelDlpJob( @@ -2296,8 +2296,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CreateStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6986} - /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6965} + /// [google.privacy.dlp.v2.CreateStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7130} + /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7109} /// // clang-format on StatusOr CreateStoredInfoType( @@ -2331,8 +2331,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.CreateStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6986} - /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6965} + /// [google.privacy.dlp.v2.CreateStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7130} + /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7109} /// // clang-format on StatusOr CreateStoredInfoType( @@ -2367,8 +2367,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6965} - /// [google.privacy.dlp.v2.UpdateStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7028} + /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7109} + /// [google.privacy.dlp.v2.UpdateStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7172} /// // clang-format on StatusOr UpdateStoredInfoType( @@ -2403,8 +2403,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6965} - /// [google.privacy.dlp.v2.UpdateStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7028} + /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7109} + /// [google.privacy.dlp.v2.UpdateStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7172} /// // clang-format on StatusOr UpdateStoredInfoType( @@ -2434,8 +2434,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.GetStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7049} - /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6965} + /// [google.privacy.dlp.v2.GetStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7193} + /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7109} /// // clang-format on StatusOr GetStoredInfoType( @@ -2467,8 +2467,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.GetStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7049} - /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6965} + /// [google.privacy.dlp.v2.GetStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7193} + /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7109} /// // clang-format on StatusOr GetStoredInfoType( @@ -2520,8 +2520,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ListStoredInfoTypesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7062} - /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6965} + /// [google.privacy.dlp.v2.ListStoredInfoTypesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7206} + /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7109} /// // clang-format on StreamRange ListStoredInfoTypes( @@ -2562,8 +2562,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ListStoredInfoTypesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7062} - /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6965} + /// [google.privacy.dlp.v2.ListStoredInfoTypesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7206} + /// [google.privacy.dlp.v2.StoredInfoType]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7109} /// // clang-format on StreamRange ListStoredInfoTypes( @@ -2591,7 +2591,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7125} + /// [google.privacy.dlp.v2.DeleteStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7269} /// // clang-format on Status DeleteStoredInfoType(std::string const& name, Options opts = {}); @@ -2620,7 +2620,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7125} + /// [google.privacy.dlp.v2.DeleteStoredInfoTypeRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7269} /// // clang-format on Status DeleteStoredInfoType( @@ -2654,8 +2654,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ListProjectDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7342} - /// [google.privacy.dlp.v2.ProjectDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7626} + /// [google.privacy.dlp.v2.ListProjectDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7529} + /// [google.privacy.dlp.v2.ProjectDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7813} /// // clang-format on StreamRange @@ -2693,8 +2693,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ListProjectDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7342} - /// [google.privacy.dlp.v2.ProjectDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7626} + /// [google.privacy.dlp.v2.ListProjectDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7529} + /// [google.privacy.dlp.v2.ProjectDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7813} /// // clang-format on StreamRange @@ -2731,8 +2731,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ListTableDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7417} - /// [google.privacy.dlp.v2.TableDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7700} + /// [google.privacy.dlp.v2.ListTableDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7604} + /// [google.privacy.dlp.v2.TableDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7887} /// // clang-format on StreamRange ListTableDataProfiles( @@ -2770,8 +2770,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ListTableDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7417} - /// [google.privacy.dlp.v2.TableDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7700} + /// [google.privacy.dlp.v2.ListTableDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7604} + /// [google.privacy.dlp.v2.TableDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7887} /// // clang-format on StreamRange ListTableDataProfiles( @@ -2807,8 +2807,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ColumnDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7906} - /// [google.privacy.dlp.v2.ListColumnDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7505} + /// [google.privacy.dlp.v2.ColumnDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8093} + /// [google.privacy.dlp.v2.ListColumnDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7692} /// // clang-format on StreamRange @@ -2846,8 +2846,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ColumnDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7906} - /// [google.privacy.dlp.v2.ListColumnDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7505} + /// [google.privacy.dlp.v2.ColumnDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8093} + /// [google.privacy.dlp.v2.ListColumnDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7692} /// // clang-format on StreamRange @@ -2874,8 +2874,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.GetProjectDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8305} - /// [google.privacy.dlp.v2.ProjectDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7626} + /// [google.privacy.dlp.v2.GetProjectDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8492} + /// [google.privacy.dlp.v2.ProjectDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7813} /// // clang-format on StatusOr GetProjectDataProfile( @@ -2904,8 +2904,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.GetProjectDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8305} - /// [google.privacy.dlp.v2.ProjectDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7626} + /// [google.privacy.dlp.v2.GetProjectDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8492} + /// [google.privacy.dlp.v2.ProjectDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7813} /// // clang-format on StatusOr GetProjectDataProfile( @@ -2941,8 +2941,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.FileStoreDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8071} - /// [google.privacy.dlp.v2.ListFileStoreDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8330} + /// [google.privacy.dlp.v2.FileStoreDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8258} + /// [google.privacy.dlp.v2.ListFileStoreDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8517} /// // clang-format on StreamRange @@ -2980,8 +2980,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.FileStoreDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8071} - /// [google.privacy.dlp.v2.ListFileStoreDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8330} + /// [google.privacy.dlp.v2.FileStoreDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8258} + /// [google.privacy.dlp.v2.ListFileStoreDataProfilesRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8517} /// // clang-format on StreamRange @@ -3008,8 +3008,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.FileStoreDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8071} - /// [google.privacy.dlp.v2.GetFileStoreDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8317} + /// [google.privacy.dlp.v2.FileStoreDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8258} + /// [google.privacy.dlp.v2.GetFileStoreDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8504} /// // clang-format on StatusOr @@ -3038,8 +3038,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.FileStoreDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8071} - /// [google.privacy.dlp.v2.GetFileStoreDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8317} + /// [google.privacy.dlp.v2.FileStoreDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8258} + /// [google.privacy.dlp.v2.GetFileStoreDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8504} /// // clang-format on StatusOr @@ -3064,7 +3064,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteFileStoreDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8424} + /// [google.privacy.dlp.v2.DeleteFileStoreDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8611} /// // clang-format on Status DeleteFileStoreDataProfile(std::string const& name, Options opts = {}); @@ -3091,7 +3091,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteFileStoreDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8424} + /// [google.privacy.dlp.v2.DeleteFileStoreDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8611} /// // clang-format on Status DeleteFileStoreDataProfile( @@ -3118,8 +3118,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.GetTableDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8435} - /// [google.privacy.dlp.v2.TableDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7700} + /// [google.privacy.dlp.v2.GetTableDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8622} + /// [google.privacy.dlp.v2.TableDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7887} /// // clang-format on StatusOr GetTableDataProfile( @@ -3148,8 +3148,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.GetTableDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8435} - /// [google.privacy.dlp.v2.TableDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7700} + /// [google.privacy.dlp.v2.GetTableDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8622} + /// [google.privacy.dlp.v2.TableDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7887} /// // clang-format on StatusOr GetTableDataProfile( @@ -3175,8 +3175,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ColumnDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7906} - /// [google.privacy.dlp.v2.GetColumnDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8447} + /// [google.privacy.dlp.v2.ColumnDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8093} + /// [google.privacy.dlp.v2.GetColumnDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8634} /// // clang-format on StatusOr GetColumnDataProfile( @@ -3205,8 +3205,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.ColumnDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7906} - /// [google.privacy.dlp.v2.GetColumnDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8447} + /// [google.privacy.dlp.v2.ColumnDataProfile]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8093} + /// [google.privacy.dlp.v2.GetColumnDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8634} /// // clang-format on StatusOr GetColumnDataProfile( @@ -3230,7 +3230,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteTableDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8777} + /// [google.privacy.dlp.v2.DeleteTableDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8964} /// // clang-format on Status DeleteTableDataProfile(std::string const& name, Options opts = {}); @@ -3257,7 +3257,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteTableDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8777} + /// [google.privacy.dlp.v2.DeleteTableDataProfileRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8964} /// // clang-format on Status DeleteTableDataProfile( @@ -3285,8 +3285,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.HybridInspectDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7151} - /// [google.privacy.dlp.v2.HybridInspectResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7217} + /// [google.privacy.dlp.v2.HybridInspectDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7295} + /// [google.privacy.dlp.v2.HybridInspectResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7361} /// // clang-format on StatusOr HybridInspectDlpJob( @@ -3317,8 +3317,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.HybridInspectDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7151} - /// [google.privacy.dlp.v2.HybridInspectResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7217} + /// [google.privacy.dlp.v2.HybridInspectDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7295} + /// [google.privacy.dlp.v2.HybridInspectResponse]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L7361} /// // clang-format on StatusOr HybridInspectDlpJob( @@ -3347,7 +3347,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.FinishDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6695} + /// [google.privacy.dlp.v2.FinishDlpJobRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L6839} /// // clang-format on Status FinishDlpJob( @@ -3381,8 +3381,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8660} - /// [google.privacy.dlp.v2.CreateConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8528} + /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8847} + /// [google.privacy.dlp.v2.CreateConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8715} /// // clang-format on StatusOr CreateConnection( @@ -3413,8 +3413,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8660} - /// [google.privacy.dlp.v2.CreateConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8528} + /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8847} + /// [google.privacy.dlp.v2.CreateConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8715} /// // clang-format on StatusOr CreateConnection( @@ -3440,8 +3440,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8660} - /// [google.privacy.dlp.v2.GetConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8550} + /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8847} + /// [google.privacy.dlp.v2.GetConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8737} /// // clang-format on StatusOr GetConnection( @@ -3470,8 +3470,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8660} - /// [google.privacy.dlp.v2.GetConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8550} + /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8847} + /// [google.privacy.dlp.v2.GetConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8737} /// // clang-format on StatusOr GetConnection( @@ -3508,8 +3508,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8660} - /// [google.privacy.dlp.v2.ListConnectionsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8560} + /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8847} + /// [google.privacy.dlp.v2.ListConnectionsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8747} /// // clang-format on StreamRange ListConnections( @@ -3548,8 +3548,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8660} - /// [google.privacy.dlp.v2.ListConnectionsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8560} + /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8847} + /// [google.privacy.dlp.v2.ListConnectionsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8747} /// // clang-format on StreamRange ListConnections( @@ -3585,8 +3585,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8660} - /// [google.privacy.dlp.v2.SearchConnectionsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8585} + /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8847} + /// [google.privacy.dlp.v2.SearchConnectionsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8772} /// // clang-format on StreamRange SearchConnections( @@ -3624,8 +3624,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8660} - /// [google.privacy.dlp.v2.SearchConnectionsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8585} + /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8847} + /// [google.privacy.dlp.v2.SearchConnectionsRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8772} /// // clang-format on StreamRange SearchConnections( @@ -3649,7 +3649,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8649} + /// [google.privacy.dlp.v2.DeleteConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8836} /// // clang-format on Status DeleteConnection(std::string const& name, Options opts = {}); @@ -3675,7 +3675,7 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.DeleteConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8649} + /// [google.privacy.dlp.v2.DeleteConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8836} /// // clang-format on Status DeleteConnection( @@ -3701,8 +3701,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8660} - /// [google.privacy.dlp.v2.UpdateConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8632} + /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8847} + /// [google.privacy.dlp.v2.UpdateConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8819} /// // clang-format on StatusOr UpdateConnection( @@ -3731,8 +3731,8 @@ class DlpServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8660} - /// [google.privacy.dlp.v2.UpdateConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8632} + /// [google.privacy.dlp.v2.Connection]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8847} + /// [google.privacy.dlp.v2.UpdateConnectionRequest]: @googleapis_reference_link{google/privacy/dlp/v2/dlp.proto#L8819} /// // clang-format on StatusOr UpdateConnection( diff --git a/google/cloud/documentai/quickstart/.bazelversion b/google/cloud/documentai/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/documentai/quickstart/.bazelversion +++ b/google/cloud/documentai/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/documentai/quickstart/WORKSPACE.bazel b/google/cloud/documentai/quickstart/WORKSPACE.bazel index 0e9d01734b862..7e037cf296182 100644 --- a/google/cloud/documentai/quickstart/WORKSPACE.bazel +++ b/google/cloud/documentai/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/documentai/v1/document_processor_client.h b/google/cloud/documentai/v1/document_processor_client.h index 210012c145a14..d2dfea4b90a5f 100644 --- a/google/cloud/documentai/v1/document_processor_client.h +++ b/google/cloud/documentai/v1/document_processor_client.h @@ -122,8 +122,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.ProcessRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L403} - /// [google.cloud.documentai.v1.ProcessResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L498} + /// [google.cloud.documentai.v1.ProcessRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L409} + /// [google.cloud.documentai.v1.ProcessResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L504} /// [google.cloud.documentai.v1.Processor]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L209} /// [google.cloud.documentai.v1.Processor.default_processor_version]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L269} /// [google.cloud.documentai.v1.ProcessorVersion]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L37} @@ -155,8 +155,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.ProcessRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L403} - /// [google.cloud.documentai.v1.ProcessResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L498} + /// [google.cloud.documentai.v1.ProcessRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L409} + /// [google.cloud.documentai.v1.ProcessResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L504} /// // clang-format on StatusOr ProcessDocument( @@ -194,8 +194,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.BatchProcessRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L509} - /// [google.cloud.documentai.v1.BatchProcessResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L549} + /// [google.cloud.documentai.v1.BatchProcessRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L515} + /// [google.cloud.documentai.v1.BatchProcessResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L555} /// [google.cloud.documentai.v1.Processor]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L209} /// [google.cloud.documentai.v1.ProcessorVersion]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L37} /// @@ -248,8 +248,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.BatchProcessRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L509} - /// [google.cloud.documentai.v1.BatchProcessResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L549} + /// [google.cloud.documentai.v1.BatchProcessRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L515} + /// [google.cloud.documentai.v1.BatchProcessResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L555} /// // clang-format on future> @@ -308,8 +308,8 @@ class DocumentProcessorServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L105} - /// [google.cloud.documentai.v1.FetchProcessorTypesRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L618} - /// [google.cloud.documentai.v1.FetchProcessorTypesResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L632} + /// [google.cloud.documentai.v1.FetchProcessorTypesRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L624} + /// [google.cloud.documentai.v1.FetchProcessorTypesResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L638} /// // clang-format on StatusOr @@ -341,8 +341,8 @@ class DocumentProcessorServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L105} - /// [google.cloud.documentai.v1.FetchProcessorTypesRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L618} - /// [google.cloud.documentai.v1.FetchProcessorTypesResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L632} + /// [google.cloud.documentai.v1.FetchProcessorTypesRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L624} + /// [google.cloud.documentai.v1.FetchProcessorTypesResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L638} /// // clang-format on StatusOr @@ -378,7 +378,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.ListProcessorTypesRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L641} + /// [google.cloud.documentai.v1.ListProcessorTypesRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L647} /// [google.cloud.documentai.v1.ProcessorType]: @googleapis_reference_link{google/cloud/documentai/v1/processor_type.proto#L32} /// // clang-format on @@ -417,7 +417,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.ListProcessorTypesRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L641} + /// [google.cloud.documentai.v1.ListProcessorTypesRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L647} /// [google.cloud.documentai.v1.ProcessorType]: @googleapis_reference_link{google/cloud/documentai/v1/processor_type.proto#L32} /// // clang-format on @@ -443,7 +443,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.GetProcessorTypeRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L706} + /// [google.cloud.documentai.v1.GetProcessorTypeRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L712} /// [google.cloud.documentai.v1.ProcessorType]: @googleapis_reference_link{google/cloud/documentai/v1/processor_type.proto#L32} /// // clang-format on @@ -473,7 +473,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.GetProcessorTypeRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L706} + /// [google.cloud.documentai.v1.GetProcessorTypeRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L712} /// [google.cloud.documentai.v1.ProcessorType]: @googleapis_reference_link{google/cloud/documentai/v1/processor_type.proto#L32} /// // clang-format on @@ -509,7 +509,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.ListProcessorsRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L672} + /// [google.cloud.documentai.v1.ListProcessorsRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L678} /// [google.cloud.documentai.v1.Processor]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L209} /// // clang-format on @@ -548,7 +548,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.ListProcessorsRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L672} + /// [google.cloud.documentai.v1.ListProcessorsRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L678} /// [google.cloud.documentai.v1.Processor]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L209} /// // clang-format on @@ -574,7 +574,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.GetProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L719} + /// [google.cloud.documentai.v1.GetProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L725} /// [google.cloud.documentai.v1.Processor]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L209} /// // clang-format on @@ -604,7 +604,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.GetProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L719} + /// [google.cloud.documentai.v1.GetProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L725} /// [google.cloud.documentai.v1.Processor]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L209} /// // clang-format on @@ -642,9 +642,9 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.TrainProcessorVersionMetadata]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1070} - /// [google.cloud.documentai.v1.TrainProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L987} - /// [google.cloud.documentai.v1.TrainProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1064} + /// [google.cloud.documentai.v1.TrainProcessorVersionMetadata]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1076} + /// [google.cloud.documentai.v1.TrainProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L993} + /// [google.cloud.documentai.v1.TrainProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1070} /// // clang-format on future> @@ -701,9 +701,9 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.TrainProcessorVersionMetadata]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1070} - /// [google.cloud.documentai.v1.TrainProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L987} - /// [google.cloud.documentai.v1.TrainProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1064} + /// [google.cloud.documentai.v1.TrainProcessorVersionMetadata]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1076} + /// [google.cloud.documentai.v1.TrainProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L993} + /// [google.cloud.documentai.v1.TrainProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1070} /// // clang-format on future> @@ -760,7 +760,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.GetProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L732} + /// [google.cloud.documentai.v1.GetProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L738} /// [google.cloud.documentai.v1.ProcessorVersion]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L37} /// // clang-format on @@ -790,7 +790,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.GetProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L732} + /// [google.cloud.documentai.v1.GetProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L738} /// [google.cloud.documentai.v1.ProcessorVersion]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L37} /// // clang-format on @@ -827,7 +827,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.ListProcessorVersionsRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L743} + /// [google.cloud.documentai.v1.ListProcessorVersionsRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L749} /// [google.cloud.documentai.v1.ProcessorVersion]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L37} /// // clang-format on @@ -866,7 +866,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.ListProcessorVersionsRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L743} + /// [google.cloud.documentai.v1.ListProcessorVersionsRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L749} /// [google.cloud.documentai.v1.ProcessorVersion]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L37} /// // clang-format on @@ -901,8 +901,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.DeleteProcessorVersionMetadata]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L791} - /// [google.cloud.documentai.v1.DeleteProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L778} + /// [google.cloud.documentai.v1.DeleteProcessorVersionMetadata]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L797} + /// [google.cloud.documentai.v1.DeleteProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L784} /// // clang-format on future< @@ -954,8 +954,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.DeleteProcessorVersionMetadata]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L791} - /// [google.cloud.documentai.v1.DeleteProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L778} + /// [google.cloud.documentai.v1.DeleteProcessorVersionMetadata]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L797} + /// [google.cloud.documentai.v1.DeleteProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L784} /// // clang-format on future< @@ -1021,8 +1021,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.DeployProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L799} - /// [google.cloud.documentai.v1.DeployProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L812} + /// [google.cloud.documentai.v1.DeployProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L805} + /// [google.cloud.documentai.v1.DeployProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L818} /// // clang-format on future< @@ -1073,8 +1073,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.DeployProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L799} - /// [google.cloud.documentai.v1.DeployProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L812} + /// [google.cloud.documentai.v1.DeployProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L805} + /// [google.cloud.documentai.v1.DeployProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L818} /// // clang-format on future< @@ -1140,8 +1140,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.UndeployProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L825} - /// [google.cloud.documentai.v1.UndeployProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L838} + /// [google.cloud.documentai.v1.UndeployProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L831} + /// [google.cloud.documentai.v1.UndeployProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L844} /// // clang-format on future< @@ -1192,8 +1192,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.UndeployProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L825} - /// [google.cloud.documentai.v1.UndeployProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L838} + /// [google.cloud.documentai.v1.UndeployProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L831} + /// [google.cloud.documentai.v1.UndeployProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L844} /// // clang-format on future< @@ -1265,7 +1265,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.CreateProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L853} + /// [google.cloud.documentai.v1.CreateProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L859} /// [google.cloud.documentai.v1.Processor]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L209} /// [google.cloud.documentai.v1.Processor.display_name]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L263} /// [google.cloud.documentai.v1.Processor.kms_key_name]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L290} @@ -1307,7 +1307,7 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.CreateProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L853} + /// [google.cloud.documentai.v1.CreateProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L859} /// [google.cloud.documentai.v1.Processor]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L209} /// [google.cloud.documentai.v1.ProcessorType]: @googleapis_reference_link{google/cloud/documentai/v1/processor_type.proto#L32} /// @@ -1342,8 +1342,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.DeleteProcessorMetadata]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L888} - /// [google.cloud.documentai.v1.DeleteProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L875} + /// [google.cloud.documentai.v1.DeleteProcessorMetadata]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L894} + /// [google.cloud.documentai.v1.DeleteProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L881} /// // clang-format on future> @@ -1394,8 +1394,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.DeleteProcessorMetadata]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L888} - /// [google.cloud.documentai.v1.DeleteProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L875} + /// [google.cloud.documentai.v1.DeleteProcessorMetadata]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L894} + /// [google.cloud.documentai.v1.DeleteProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L881} /// // clang-format on future> @@ -1462,8 +1462,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.EnableProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L896} - /// [google.cloud.documentai.v1.EnableProcessorResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L909} + /// [google.cloud.documentai.v1.EnableProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L902} + /// [google.cloud.documentai.v1.EnableProcessorResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L915} /// // clang-format on future> @@ -1530,8 +1530,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.DisableProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L922} - /// [google.cloud.documentai.v1.DisableProcessorResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L935} + /// [google.cloud.documentai.v1.DisableProcessorRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L928} + /// [google.cloud.documentai.v1.DisableProcessorResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L941} /// // clang-format on future> @@ -1605,8 +1605,8 @@ class DocumentProcessorServiceClient { /// [google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L76} /// [google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L62} /// [google.cloud.documentai.v1.Processor]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L209} - /// [google.cloud.documentai.v1.SetDefaultProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L948} - /// [google.cloud.documentai.v1.SetDefaultProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L974} + /// [google.cloud.documentai.v1.SetDefaultProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L954} + /// [google.cloud.documentai.v1.SetDefaultProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L980} /// // clang-format on future> @@ -1727,8 +1727,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.ReviewDocumentRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1104} - /// [google.cloud.documentai.v1.ReviewDocumentResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1144} + /// [google.cloud.documentai.v1.ReviewDocumentRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1110} + /// [google.cloud.documentai.v1.ReviewDocumentResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1150} /// // clang-format on future> @@ -1794,8 +1794,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.EvaluateProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1182} - /// [google.cloud.documentai.v1.EvaluateProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1211} + /// [google.cloud.documentai.v1.EvaluateProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1188} + /// [google.cloud.documentai.v1.EvaluateProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1217} /// [google.cloud.documentai.v1.ProcessorVersion]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L37} /// // clang-format on @@ -1849,8 +1849,8 @@ class DocumentProcessorServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.documentai.v1.EvaluateProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1182} - /// [google.cloud.documentai.v1.EvaluateProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1211} + /// [google.cloud.documentai.v1.EvaluateProcessorVersionRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1188} + /// [google.cloud.documentai.v1.EvaluateProcessorVersionResponse]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1217} /// // clang-format on future< @@ -1912,7 +1912,7 @@ class DocumentProcessorServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.documentai.v1.Evaluation]: @googleapis_reference_link{google/cloud/documentai/v1/evaluation.proto#L49} - /// [google.cloud.documentai.v1.GetEvaluationRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1217} + /// [google.cloud.documentai.v1.GetEvaluationRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1223} /// // clang-format on StatusOr GetEvaluation( @@ -1942,7 +1942,7 @@ class DocumentProcessorServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.documentai.v1.Evaluation]: @googleapis_reference_link{google/cloud/documentai/v1/evaluation.proto#L49} - /// [google.cloud.documentai.v1.GetEvaluationRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1217} + /// [google.cloud.documentai.v1.GetEvaluationRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1223} /// // clang-format on StatusOr GetEvaluation( @@ -1980,7 +1980,7 @@ class DocumentProcessorServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.documentai.v1.Evaluation]: @googleapis_reference_link{google/cloud/documentai/v1/evaluation.proto#L49} - /// [google.cloud.documentai.v1.ListEvaluationsRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1231} + /// [google.cloud.documentai.v1.ListEvaluationsRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1237} /// [google.cloud.documentai.v1.ProcessorVersion]: @googleapis_reference_link{google/cloud/documentai/v1/processor.proto#L37} /// // clang-format on @@ -2020,7 +2020,7 @@ class DocumentProcessorServiceClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.documentai.v1.Evaluation]: @googleapis_reference_link{google/cloud/documentai/v1/evaluation.proto#L49} - /// [google.cloud.documentai.v1.ListEvaluationsRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1231} + /// [google.cloud.documentai.v1.ListEvaluationsRequest]: @googleapis_reference_link{google/cloud/documentai/v1/document_processor_service.proto#L1237} /// // clang-format on StreamRange ListEvaluations( @@ -2262,7 +2262,7 @@ class DocumentProcessorServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2301,7 +2301,7 @@ class DocumentProcessorServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/domains/quickstart/.bazelversion b/google/cloud/domains/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/domains/quickstart/.bazelversion +++ b/google/cloud/domains/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/domains/quickstart/WORKSPACE.bazel b/google/cloud/domains/quickstart/WORKSPACE.bazel index 0aed4e2ded559..652c27cf0e0c9 100644 --- a/google/cloud/domains/quickstart/WORKSPACE.bazel +++ b/google/cloud/domains/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/edgecontainer/quickstart/.bazelversion b/google/cloud/edgecontainer/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/edgecontainer/quickstart/.bazelversion +++ b/google/cloud/edgecontainer/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/edgecontainer/quickstart/WORKSPACE.bazel b/google/cloud/edgecontainer/quickstart/WORKSPACE.bazel index f9454bcf97ce9..00c576787c3a7 100644 --- a/google/cloud/edgecontainer/quickstart/WORKSPACE.bazel +++ b/google/cloud/edgecontainer/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/edgecontainer/v1/edge_container_client.h b/google/cloud/edgecontainer/v1/edge_container_client.h index 1f52aec4a1d3d..b63fac1d81aa8 100644 --- a/google/cloud/edgecontainer/v1/edge_container_client.h +++ b/google/cloud/edgecontainer/v1/edge_container_client.h @@ -2135,7 +2135,7 @@ class EdgeContainerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2174,7 +2174,7 @@ class EdgeContainerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/edgenetwork/quickstart/.bazelversion b/google/cloud/edgenetwork/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/edgenetwork/quickstart/.bazelversion +++ b/google/cloud/edgenetwork/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/edgenetwork/quickstart/WORKSPACE.bazel b/google/cloud/edgenetwork/quickstart/WORKSPACE.bazel index bcc928fccaeb8..d8993b6c2b8e8 100644 --- a/google/cloud/edgenetwork/quickstart/WORKSPACE.bazel +++ b/google/cloud/edgenetwork/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/edgenetwork/v1/edge_network_client.h b/google/cloud/edgenetwork/v1/edge_network_client.h index 50e8fff1e52d5..118e24b0764bc 100644 --- a/google/cloud/edgenetwork/v1/edge_network_client.h +++ b/google/cloud/edgenetwork/v1/edge_network_client.h @@ -2595,7 +2595,7 @@ class EdgeNetworkClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2634,7 +2634,7 @@ class EdgeNetworkClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/essentialcontacts/quickstart/.bazelversion b/google/cloud/essentialcontacts/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/essentialcontacts/quickstart/.bazelversion +++ b/google/cloud/essentialcontacts/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/essentialcontacts/quickstart/WORKSPACE.bazel b/google/cloud/essentialcontacts/quickstart/WORKSPACE.bazel index b056bf2040857..0cc728c5bc81d 100644 --- a/google/cloud/essentialcontacts/quickstart/WORKSPACE.bazel +++ b/google/cloud/essentialcontacts/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/eventarc/quickstart/.bazelversion b/google/cloud/eventarc/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/eventarc/quickstart/.bazelversion +++ b/google/cloud/eventarc/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/eventarc/quickstart/WORKSPACE.bazel b/google/cloud/eventarc/quickstart/WORKSPACE.bazel index aeb691c6c9e62..189dce99f8ec1 100644 --- a/google/cloud/eventarc/quickstart/WORKSPACE.bazel +++ b/google/cloud/eventarc/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/eventarc/v1/eventarc_client.h b/google/cloud/eventarc/v1/eventarc_client.h index 4203dafcc29d8..01cf2d2b4f03d 100644 --- a/google/cloud/eventarc/v1/eventarc_client.h +++ b/google/cloud/eventarc/v1/eventarc_client.h @@ -4058,7 +4058,7 @@ class EventarcClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -4097,7 +4097,7 @@ class EventarcClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/filestore/quickstart/.bazelversion b/google/cloud/filestore/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/filestore/quickstart/.bazelversion +++ b/google/cloud/filestore/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/filestore/quickstart/WORKSPACE.bazel b/google/cloud/filestore/quickstart/WORKSPACE.bazel index 93b528958be4c..91cdeeb9d9e4c 100644 --- a/google/cloud/filestore/quickstart/WORKSPACE.bazel +++ b/google/cloud/filestore/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/filestore/v1/cloud_filestore_manager_client.h b/google/cloud/filestore/v1/cloud_filestore_manager_client.h index c21a9053e7e2c..c63ad038490b4 100644 --- a/google/cloud/filestore/v1/cloud_filestore_manager_client.h +++ b/google/cloud/filestore/v1/cloud_filestore_manager_client.h @@ -2086,7 +2086,7 @@ class CloudFilestoreManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2125,7 +2125,7 @@ class CloudFilestoreManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/financialservices/quickstart/WORKSPACE.bazel b/google/cloud/financialservices/quickstart/WORKSPACE.bazel index 2a989a4f7f0cd..2aa54912f2047 100644 --- a/google/cloud/financialservices/quickstart/WORKSPACE.bazel +++ b/google/cloud/financialservices/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/financialservices/v1/aml_client.h b/google/cloud/financialservices/v1/aml_client.h index c0f1dcbe8f893..404b885f71744 100644 --- a/google/cloud/financialservices/v1/aml_client.h +++ b/google/cloud/financialservices/v1/aml_client.h @@ -4281,7 +4281,7 @@ class AMLClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -4320,7 +4320,7 @@ class AMLClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/functions/quickstart/.bazelversion b/google/cloud/functions/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/functions/quickstart/.bazelversion +++ b/google/cloud/functions/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/functions/quickstart/WORKSPACE.bazel b/google/cloud/functions/quickstart/WORKSPACE.bazel index 4fefaff72056d..b6372157c5f49 100644 --- a/google/cloud/functions/quickstart/WORKSPACE.bazel +++ b/google/cloud/functions/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/gkebackup/quickstart/.bazelversion b/google/cloud/gkebackup/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/gkebackup/quickstart/.bazelversion +++ b/google/cloud/gkebackup/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/gkebackup/quickstart/WORKSPACE.bazel b/google/cloud/gkebackup/quickstart/WORKSPACE.bazel index 92aa9ae3c7dcc..85158d5b66d73 100644 --- a/google/cloud/gkebackup/quickstart/WORKSPACE.bazel +++ b/google/cloud/gkebackup/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/gkebackup/v1/backup_for_gke_client.h b/google/cloud/gkebackup/v1/backup_for_gke_client.h index 0111576cc8442..34369256cfb4c 100644 --- a/google/cloud/gkebackup/v1/backup_for_gke_client.h +++ b/google/cloud/gkebackup/v1/backup_for_gke_client.h @@ -4071,7 +4071,7 @@ class BackupForGKEClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -4110,7 +4110,7 @@ class BackupForGKEClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/gkeconnect/quickstart/.bazelversion b/google/cloud/gkeconnect/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/gkeconnect/quickstart/.bazelversion +++ b/google/cloud/gkeconnect/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/gkeconnect/quickstart/WORKSPACE.bazel b/google/cloud/gkeconnect/quickstart/WORKSPACE.bazel index 00d24819f169b..6e9c901c7a190 100644 --- a/google/cloud/gkeconnect/quickstart/WORKSPACE.bazel +++ b/google/cloud/gkeconnect/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/gkehub/quickstart/.bazelversion b/google/cloud/gkehub/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/gkehub/quickstart/.bazelversion +++ b/google/cloud/gkehub/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/gkehub/quickstart/WORKSPACE.bazel b/google/cloud/gkehub/quickstart/WORKSPACE.bazel index 04dd126823a34..81d762320970d 100644 --- a/google/cloud/gkehub/quickstart/WORKSPACE.bazel +++ b/google/cloud/gkehub/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/gkemulticloud/quickstart/.bazelversion b/google/cloud/gkemulticloud/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/gkemulticloud/quickstart/.bazelversion +++ b/google/cloud/gkemulticloud/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/gkemulticloud/quickstart/WORKSPACE.bazel b/google/cloud/gkemulticloud/quickstart/WORKSPACE.bazel index 2f70d884b418f..d7b61d0f71924 100644 --- a/google/cloud/gkemulticloud/quickstart/WORKSPACE.bazel +++ b/google/cloud/gkemulticloud/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/gkemulticloud/v1/attached_clusters_client.h b/google/cloud/gkemulticloud/v1/attached_clusters_client.h index 4cc9017252d00..396dbcfdcc9fc 100644 --- a/google/cloud/gkemulticloud/v1/attached_clusters_client.h +++ b/google/cloud/gkemulticloud/v1/attached_clusters_client.h @@ -1226,7 +1226,7 @@ class AttachedClustersClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1265,7 +1265,7 @@ class AttachedClustersClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/gkemulticloud/v1/aws_clusters_client.h b/google/cloud/gkemulticloud/v1/aws_clusters_client.h index dfd792afbf77a..39abf61efc7ae 100644 --- a/google/cloud/gkemulticloud/v1/aws_clusters_client.h +++ b/google/cloud/gkemulticloud/v1/aws_clusters_client.h @@ -1923,7 +1923,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1962,7 +1962,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/gkemulticloud/v1/azure_clusters_client.h b/google/cloud/gkemulticloud/v1/azure_clusters_client.h index da8e04ba88dbf..7f788c9de0951 100644 --- a/google/cloud/gkemulticloud/v1/azure_clusters_client.h +++ b/google/cloud/gkemulticloud/v1/azure_clusters_client.h @@ -2370,7 +2370,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2409,7 +2409,7 @@ class GOOGLE_CLOUD_CPP_DEPRECATED( /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/gkerecommender/quickstart/WORKSPACE.bazel b/google/cloud/gkerecommender/quickstart/WORKSPACE.bazel index 61292054fbd91..c3a5ecb85e7f4 100644 --- a/google/cloud/gkerecommender/quickstart/WORKSPACE.bazel +++ b/google/cloud/gkerecommender/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/google_cloud_cpp_common.bzl b/google/cloud/google_cloud_cpp_common.bzl index 450a070542af9..421c9c00a4160 100644 --- a/google/cloud/google_cloud_cpp_common.bzl +++ b/google/cloud/google_cloud_cpp_common.bzl @@ -74,6 +74,7 @@ google_cloud_cpp_common_hdrs = [ "internal/retry_info.h", "internal/retry_loop_helpers.h", "internal/retry_policy_impl.h", + "internal/run_async_base.h", "internal/service_endpoint.h", "internal/sha256_hash.h", "internal/sha256_hmac.h", diff --git a/google/cloud/google_cloud_cpp_common.cmake b/google/cloud/google_cloud_cpp_common.cmake index a3f11bb04ac9c..8b3601db39f01 100644 --- a/google/cloud/google_cloud_cpp_common.cmake +++ b/google/cloud/google_cloud_cpp_common.cmake @@ -117,6 +117,7 @@ add_library( internal/retry_loop_helpers.h internal/retry_policy_impl.cc internal/retry_policy_impl.h + internal/run_async_base.h internal/service_endpoint.cc internal/service_endpoint.h internal/sha256_hash.cc diff --git a/google/cloud/google_cloud_cpp_rest_internal.bzl b/google/cloud/google_cloud_cpp_rest_internal.bzl index 1506bb22a18cd..81603086f1e8e 100644 --- a/google/cloud/google_cloud_cpp_rest_internal.bzl +++ b/google/cloud/google_cloud_cpp_rest_internal.bzl @@ -54,6 +54,7 @@ google_cloud_cpp_rest_internal_hdrs = [ "internal/oauth2_logging_credentials.h", "internal/oauth2_minimal_iam_credentials_rest.h", "internal/oauth2_refreshing_credentials_wrapper.h", + "internal/oauth2_regional_access_boundary_token_manager.h", "internal/oauth2_service_account_credentials.h", "internal/oauth2_universe_domain.h", "internal/parse_service_account_p12_file.h", @@ -65,6 +66,8 @@ google_cloud_cpp_rest_internal_hdrs = [ "internal/rest_opentelemetry.h", "internal/rest_options.h", "internal/rest_parse_json_error.h", + "internal/rest_pure_background_threads_impl.h", + "internal/rest_pure_completion_queue_impl.h", "internal/rest_request.h", "internal/rest_response.h", "internal/rest_retry_loop.h", @@ -111,6 +114,7 @@ google_cloud_cpp_rest_internal_srcs = [ "internal/oauth2_logging_credentials.cc", "internal/oauth2_minimal_iam_credentials_rest.cc", "internal/oauth2_refreshing_credentials_wrapper.cc", + "internal/oauth2_regional_access_boundary_token_manager.cc", "internal/oauth2_service_account_credentials.cc", "internal/oauth2_universe_domain.cc", "internal/openssl/parse_service_account_p12_file.cc", @@ -121,6 +125,8 @@ google_cloud_cpp_rest_internal_srcs = [ "internal/rest_lro_helpers.cc", "internal/rest_opentelemetry.cc", "internal/rest_parse_json_error.cc", + "internal/rest_pure_background_threads_impl.cc", + "internal/rest_pure_completion_queue_impl.cc", "internal/rest_request.cc", "internal/rest_response.cc", "internal/rest_set_metadata.cc", diff --git a/google/cloud/google_cloud_cpp_rest_internal.cmake b/google/cloud/google_cloud_cpp_rest_internal.cmake index 3d38991523870..41926d4906226 100644 --- a/google/cloud/google_cloud_cpp_rest_internal.cmake +++ b/google/cloud/google_cloud_cpp_rest_internal.cmake @@ -92,6 +92,8 @@ add_library( internal/oauth2_minimal_iam_credentials_rest.h internal/oauth2_refreshing_credentials_wrapper.cc internal/oauth2_refreshing_credentials_wrapper.h + internal/oauth2_regional_access_boundary_token_manager.cc + internal/oauth2_regional_access_boundary_token_manager.h internal/oauth2_service_account_credentials.cc internal/oauth2_service_account_credentials.h internal/oauth2_universe_domain.cc @@ -113,6 +115,10 @@ add_library( internal/rest_options.h internal/rest_parse_json_error.cc internal/rest_parse_json_error.h + internal/rest_pure_background_threads_impl.cc + internal/rest_pure_background_threads_impl.h + internal/rest_pure_completion_queue_impl.cc + internal/rest_pure_completion_queue_impl.h internal/rest_request.cc internal/rest_request.h internal/rest_response.cc @@ -137,7 +143,7 @@ add_library( target_link_libraries( google_cloud_cpp_rest_internal PUBLIC absl::span google-cloud-cpp::common CURL::libcurl - nlohmann_json::nlohmann_json) + absl::flat_hash_map nlohmann_json::nlohmann_json) if (WIN32) target_compile_definitions(google_cloud_cpp_rest_internal PRIVATE WIN32_LEAN_AND_MEAN) @@ -197,6 +203,7 @@ google_cloud_cpp_add_pkgconfig( "Provides REST Transport for the Google Cloud C++ Client Library." "google_cloud_cpp_common" "libcurl" + "absl_flat_hash_map" NON_WIN32_REQUIRES openssl WIN32_LIBS @@ -279,6 +286,7 @@ if (BUILD_TESTING) internal/oauth2_logging_credentials_test.cc internal/oauth2_minimal_iam_credentials_rest_test.cc internal/oauth2_refreshing_credentials_wrapper_test.cc + internal/oauth2_regional_access_boundary_token_manager_test.cc internal/oauth2_service_account_credentials_test.cc internal/oauth2_universe_domain_test.cc internal/populate_rest_options_test.cc diff --git a/google/cloud/google_cloud_cpp_rest_internal_unit_tests.bzl b/google/cloud/google_cloud_cpp_rest_internal_unit_tests.bzl index b80f9ce502207..97315183034dc 100644 --- a/google/cloud/google_cloud_cpp_rest_internal_unit_tests.bzl +++ b/google/cloud/google_cloud_cpp_rest_internal_unit_tests.bzl @@ -51,6 +51,7 @@ google_cloud_cpp_rest_internal_unit_tests = [ "internal/oauth2_logging_credentials_test.cc", "internal/oauth2_minimal_iam_credentials_rest_test.cc", "internal/oauth2_refreshing_credentials_wrapper_test.cc", + "internal/oauth2_regional_access_boundary_token_manager_test.cc", "internal/oauth2_service_account_credentials_test.cc", "internal/oauth2_universe_domain_test.cc", "internal/populate_rest_options_test.cc", diff --git a/google/cloud/hypercomputecluster/BUILD.bazel b/google/cloud/hypercomputecluster/BUILD.bazel new file mode 100644 index 0000000000000..da0ca0e4a24f1 --- /dev/null +++ b/google/cloud/hypercomputecluster/BUILD.bazel @@ -0,0 +1,31 @@ +# Copyright 2026 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 = [ + "@googleapis//google/cloud/hypercomputecluster/v1:hypercomputecluster_cc_grpc", +] + +cc_gapic_library( + name = "hypercomputecluster", + googleapis_deps = googleapis_deps, + service_dirs = service_dirs, +) diff --git a/google/cloud/hypercomputecluster/CMakeLists.txt b/google/cloud/hypercomputecluster/CMakeLists.txt new file mode 100644 index 0000000000000..2998318431044 --- /dev/null +++ b/google/cloud/hypercomputecluster/CMakeLists.txt @@ -0,0 +1,37 @@ +# ~~~ +# Copyright 2026 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(hypercomputecluster "Cluster Director API" + SERVICE_DIRS "v1/") + +if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) + add_executable(hypercomputecluster_quickstart "quickstart/quickstart.cc") + target_link_libraries(hypercomputecluster_quickstart + PRIVATE google-cloud-cpp::hypercomputecluster) + google_cloud_cpp_add_common_options(hypercomputecluster_quickstart) + add_test( + NAME hypercomputecluster_quickstart + COMMAND + cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" + $ GOOGLE_CLOUD_PROJECT + GOOGLE_CLOUD_CPP_TEST_REGION) + set_tests_properties( + hypercomputecluster_quickstart + PROPERTIES LABELS "integration-test;quickstart" PASS_REGULAR_EXPRESSION + "Permanent error.*gcloud-cpp.retry.function=ListClusters") +endif () diff --git a/google/cloud/hypercomputecluster/README.md b/google/cloud/hypercomputecluster/README.md new file mode 100644 index 0000000000000..30e93082fdec8 --- /dev/null +++ b/google/cloud/hypercomputecluster/README.md @@ -0,0 +1,62 @@ +# Cluster Director API C++ Client Library + +This directory contains an idiomatic C++ client library for the +[Cluster Director API][cloud-service-docs]. + +The Cluster Director API allows you to deploy, manage, and monitor clusters that +run AI, ML, or HPC workloads. + +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/hypercomputecluster/v1/hypercompute_cluster_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 hypercomputecluster = ::google::cloud::hypercomputecluster_v1; + auto client = hypercomputecluster::HypercomputeClusterClient( + hypercomputecluster::MakeHypercomputeClusterConnection()); + + for (auto r : client.ListClusters(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 [Cluster Director 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/cluster-director/docs +[doxygen-link]: https://cloud.google.com/cpp/docs/reference/hypercomputecluster/latest/ +[source-link]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/hypercomputecluster diff --git a/google/cloud/hypercomputecluster/doc/environment-variables.dox b/google/cloud/hypercomputecluster/doc/environment-variables.dox new file mode 100644 index 0000000000000..ee9ac6cd98695 --- /dev/null +++ b/google/cloud/hypercomputecluster/doc/environment-variables.dox @@ -0,0 +1,49 @@ +/*! +@page hypercomputecluster-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 hypercomputecluster-env-endpoint Endpoint Overrides + + + +- `GOOGLE_CLOUD_CPP_HYPERCOMPUTE_CLUSTER_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "hypercomputecluster.googleapis.com") + used by `MakeHypercomputeClusterConnection()`. + + + +@see google::cloud::EndpointOption + +@section hypercomputecluster-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 hypercomputecluster-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/hypercomputecluster/doc/main.dox b/google/cloud/hypercomputecluster/doc/main.dox new file mode 100644 index 0000000000000..c9555d27a1ac0 --- /dev/null +++ b/google/cloud/hypercomputecluster/doc/main.dox @@ -0,0 +1,49 @@ +/*! + +@mainpage Cluster Director API C++ Client Library + +An idiomatic C++ client library for the [Cluster Director API][cloud-service-docs]. + +The Cluster Director API allows you to deploy, manage, and monitor clusters +that run AI, ML, or HPC workloads. + +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/hypercomputecluster/quickstart/` directory, +which should give you a taste of the Cluster Director API C++ client library API. + +@snippet quickstart.cc all + +## Main classes + + +The main class in this library is +[`hypercomputecluster_v1::HypercomputeClusterClient`](@ref google::cloud::hypercomputecluster_v1::HypercomputeClusterClient). All RPCs are exposed +as member functions of this class. Other classes provide helpers, configuration +parameters, and infrastructure to mock +[`hypercomputecluster_v1::HypercomputeClusterClient`](@ref google::cloud::hypercomputecluster_v1::HypercomputeClusterClient) when testing your +application. + + +## More Information + +- @ref common-error-handling - describes how the library reports errors. +- @ref hypercomputecluster-override-endpoint - describes how to override the default + endpoint. +- @ref hypercomputecluster-override-authentication - describes how to change the + authentication credentials used by the library. +- @ref hypercomputecluster-override-retry - describes how to change the default retry + policies. +- @ref hypercomputecluster-env - describes environment variables that can configure the + behavior of the library. +- @ref hypercomputecluster-override-universe-domain - describes how to override the default universe domain. + +[cloud-service-docs]: https://cloud.google.com/cluster-director/docs + +*/ diff --git a/google/cloud/hypercomputecluster/doc/options.dox b/google/cloud/hypercomputecluster/doc/options.dox new file mode 100644 index 0000000000000..8cf39686b26d5 --- /dev/null +++ b/google/cloud/hypercomputecluster/doc/options.dox @@ -0,0 +1,10 @@ +/*! +@defgroup google-cloud-hypercomputecluster-options Cluster Director 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/hypercomputecluster/doc/override-authentication.dox b/google/cloud/hypercomputecluster/doc/override-authentication.dox new file mode 100644 index 0000000000000..9c3929d69c11b --- /dev/null +++ b/google/cloud/hypercomputecluster/doc/override-authentication.dox @@ -0,0 +1,35 @@ +/*! +@page hypercomputecluster-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 hypercompute_cluster_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 hypercomputecluster_v1::HypercomputeClusterClient-service-account-snippet Override hypercomputecluster_v1::HypercomputeClusterClient Authentication Defaults + +@snippet google/cloud/hypercomputecluster/v1/samples/hypercompute_cluster_client_samples.cc with-service-account + +*/ +// diff --git a/google/cloud/hypercomputecluster/doc/override-endpoint.dox b/google/cloud/hypercomputecluster/doc/override-endpoint.dox new file mode 100644 index 0000000000000..dd2d6131f72ec --- /dev/null +++ b/google/cloud/hypercomputecluster/doc/override-endpoint.dox @@ -0,0 +1,25 @@ +/*! +@page hypercomputecluster-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 `hypercomputecluster_v1::HypercomputeClusterClient`: + +@snippet hypercompute_cluster_client_samples.cc set-client-endpoint + + + +*/ + +// + +/*! @page hypercomputecluster_v1::HypercomputeClusterClient-endpoint-snippet Override hypercomputecluster_v1::HypercomputeClusterClient Endpoint Configuration + +@snippet google/cloud/hypercomputecluster/v1/samples/hypercompute_cluster_client_samples.cc set-client-endpoint + +*/ +// diff --git a/google/cloud/hypercomputecluster/doc/override-retry-policies.dox b/google/cloud/hypercomputecluster/doc/override-retry-policies.dox new file mode 100644 index 0000000000000..14e9b652b0c30 --- /dev/null +++ b/google/cloud/hypercomputecluster/doc/override-retry-policies.dox @@ -0,0 +1,108 @@ +/*! +@page hypercomputecluster-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 hypercomputecluster-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 hypercomputecluster-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 hypercomputecluster-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 hypercomputecluster-override-retry-example Example + + +For example, this will override the retry policies for `hypercomputecluster_v1::HypercomputeClusterClient`: + +@snippet hypercompute_cluster_client_samples.cc set-retry-policy + +This assumes you have created a custom idempotency policy. Such as: + +@snippet hypercompute_cluster_client_samples.cc custom-idempotency-policy + +This will override the polling policies for `hypercomputecluster_v1::HypercomputeClusterClient` + +@snippet hypercompute_cluster_client_samples.cc set-polling-policy + + + + +@section hypercomputecluster-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 hypercomputecluster_v1::HypercomputeClusterClient-retry-snippet Override hypercomputecluster_v1::HypercomputeClusterClient Retry Policies + +This shows how to override the retry policies for hypercomputecluster_v1::HypercomputeClusterClient: + +@snippet google/cloud/hypercomputecluster/v1/samples/hypercompute_cluster_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/hypercomputecluster/v1/samples/hypercompute_cluster_client_samples.cc custom-idempotency-policy + +*/ +// diff --git a/google/cloud/hypercomputecluster/doc/override-universe-domain.dox b/google/cloud/hypercomputecluster/doc/override-universe-domain.dox new file mode 100644 index 0000000000000..5eb65167a1d14 --- /dev/null +++ b/google/cloud/hypercomputecluster/doc/override-universe-domain.dox @@ -0,0 +1,24 @@ +/*! +@page hypercomputecluster-override-universe-domain How to Override the Default Universe Domain + +In some cases, you may need to override the default universe domain used by the +client library. Use `AddUniverseDomainOption` when initializing the client +library to change this default. + + +For example, this will override the default universe domain for `hypercomputecluster_v1::HypercomputeClusterClient`: + +@snippet hypercompute_cluster_client_samples.cc set-client-universe-domain + + + +*/ + +// + +/*! @page hypercomputecluster_v1::HypercomputeClusterClient-universe-domain-snippet Override hypercomputecluster_v1::HypercomputeClusterClient Universe Domain + +@snippet google/cloud/hypercomputecluster/v1/samples/hypercompute_cluster_client_samples.cc set-client-universe-domain + +*/ +// diff --git a/google/cloud/hypercomputecluster/quickstart/.bazelrc b/google/cloud/hypercomputecluster/quickstart/.bazelrc new file mode 100644 index 0000000000000..c884db46c2b4d --- /dev/null +++ b/google/cloud/hypercomputecluster/quickstart/.bazelrc @@ -0,0 +1,30 @@ +# Copyright 2026 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/hypercomputecluster/quickstart/BUILD.bazel b/google/cloud/hypercomputecluster/quickstart/BUILD.bazel new file mode 100644 index 0000000000000..c019e0419b1ed --- /dev/null +++ b/google/cloud/hypercomputecluster/quickstart/BUILD.bazel @@ -0,0 +1,25 @@ +# Copyright 2026 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//:hypercomputecluster", + ], +) diff --git a/google/cloud/hypercomputecluster/quickstart/CMakeLists.txt b/google/cloud/hypercomputecluster/quickstart/CMakeLists.txt new file mode 100644 index 0000000000000..b6e22881b2577 --- /dev/null +++ b/google/cloud/hypercomputecluster/quickstart/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright 2026 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 Cluster Director API C++ client library from a +# larger CMake project. + +cmake_minimum_required(VERSION 3.22...3.31) +project(google-cloud-cpp-hypercomputecluster-quickstart CXX) + +find_package(google_cloud_cpp_hypercomputecluster 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::hypercomputecluster) diff --git a/google/cloud/hypercomputecluster/quickstart/Makefile b/google/cloud/hypercomputecluster/quickstart/Makefile new file mode 100644 index 0000000000000..21b36a552c763 --- /dev/null +++ b/google/cloud/hypercomputecluster/quickstart/Makefile @@ -0,0 +1,35 @@ +# Copyright 2026 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 Cluster Director 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 Cluster Director API C++ +# client library. +CLIENT_MODULE := google_cloud_cpp_hypercomputecluster +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/hypercomputecluster/quickstart/README.md b/google/cloud/hypercomputecluster/quickstart/README.md new file mode 100644 index 0000000000000..7913ded3486c4 --- /dev/null +++ b/google/cloud/hypercomputecluster/quickstart/README.md @@ -0,0 +1,135 @@ +# HOWTO: using the Cluster Director API C++ client in your project + +This directory contains small examples showing how to use the Cluster Director +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, Cluster Director 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/hypercomputecluster/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,hypercomputecluster] + ``` + + 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/hypercomputecluster/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/hypercomputecluster/quickstart/WORKSPACE.bazel b/google/cloud/hypercomputecluster/quickstart/WORKSPACE.bazel new file mode 100644 index 0000000000000..038972e088479 --- /dev/null +++ b/google/cloud/hypercomputecluster/quickstart/WORKSPACE.bazel @@ -0,0 +1,53 @@ +# Copyright 2026 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 Cluster Director 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 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.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/hypercomputecluster/quickstart/quickstart.cc b/google/cloud/hypercomputecluster/quickstart/quickstart.cc new file mode 100644 index 0000000000000..a3369bbbfb677 --- /dev/null +++ b/google/cloud/hypercomputecluster/quickstart/quickstart.cc @@ -0,0 +1,42 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster_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 hypercomputecluster = ::google::cloud::hypercomputecluster_v1; + auto client = hypercomputecluster::HypercomputeClusterClient( + hypercomputecluster::MakeHypercomputeClusterConnection()); + + for (auto r : client.ListClusters(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/hypercomputecluster/v1/.repo-metadata.json b/google/cloud/hypercomputecluster/v1/.repo-metadata.json new file mode 100644 index 0000000000000..75d22f9dc60f0 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "api_id": "hypercomputecluster.googleapis.com", + "api_shortname": "hypercomputecluster", + "client_documentation": "https://cloud.google.com/cpp/docs/reference/hypercomputecluster/latest", + "distribution_name": "google-cloud-cpp", + "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:1907878%20status=open", + "language": "cpp", + "library_type": "GAPIC_AUTO", + "name_pretty": "Cluster Director API", + "product_documentation": "https://cloud.google.com/cluster-director/docs", + "release_level": "stable", + "repo": "googleapis/google-cloud-cpp", + "requires_billing": true +} diff --git a/google/cloud/hypercomputecluster/v1/hypercompute_cluster_client.cc b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_client.cc new file mode 100644 index 0000000000000..7b30445818207 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_client.cc @@ -0,0 +1,284 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HypercomputeClusterClient::HypercomputeClusterClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +HypercomputeClusterClient::~HypercomputeClusterClient() = default; + +StreamRange +HypercomputeClusterClient::ListClusters(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::hypercomputecluster::v1::ListClustersRequest request; + request.set_parent(parent); + return connection_->ListClusters(request); +} + +StreamRange +HypercomputeClusterClient::ListClusters( + google::cloud::hypercomputecluster::v1::ListClustersRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListClusters(std::move(request)); +} + +StatusOr +HypercomputeClusterClient::GetCluster(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::hypercomputecluster::v1::GetClusterRequest request; + request.set_name(name); + return connection_->GetCluster(request); +} + +StatusOr +HypercomputeClusterClient::GetCluster( + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetCluster(request); +} + +future> +HypercomputeClusterClient::CreateCluster( + std::string const& parent, + google::cloud::hypercomputecluster::v1::Cluster const& cluster, + std::string const& cluster_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::hypercomputecluster::v1::CreateClusterRequest request; + request.set_parent(parent); + *request.mutable_cluster() = cluster; + request.set_cluster_id(cluster_id); + return connection_->CreateCluster(request); +} + +StatusOr +HypercomputeClusterClient::CreateCluster( + NoAwaitTag, std::string const& parent, + google::cloud::hypercomputecluster::v1::Cluster const& cluster, + std::string const& cluster_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::hypercomputecluster::v1::CreateClusterRequest request; + request.set_parent(parent); + *request.mutable_cluster() = cluster; + request.set_cluster_id(cluster_id); + return connection_->CreateCluster(NoAwaitTag{}, request); +} + +future> +HypercomputeClusterClient::CreateCluster( + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCluster(request); +} + +StatusOr +HypercomputeClusterClient::CreateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCluster(NoAwaitTag{}, request); +} + +future> +HypercomputeClusterClient::CreateCluster( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCluster(operation); +} + +future> +HypercomputeClusterClient::UpdateCluster( + google::cloud::hypercomputecluster::v1::Cluster const& cluster, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::hypercomputecluster::v1::UpdateClusterRequest request; + *request.mutable_cluster() = cluster; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateCluster(request); +} + +StatusOr +HypercomputeClusterClient::UpdateCluster( + NoAwaitTag, google::cloud::hypercomputecluster::v1::Cluster const& cluster, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::hypercomputecluster::v1::UpdateClusterRequest request; + *request.mutable_cluster() = cluster; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateCluster(NoAwaitTag{}, request); +} + +future> +HypercomputeClusterClient::UpdateCluster( + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateCluster(request); +} + +StatusOr +HypercomputeClusterClient::UpdateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateCluster(NoAwaitTag{}, request); +} + +future> +HypercomputeClusterClient::UpdateCluster( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateCluster(operation); +} + +future> +HypercomputeClusterClient::DeleteCluster(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::hypercomputecluster::v1::DeleteClusterRequest request; + request.set_name(name); + return connection_->DeleteCluster(request); +} + +StatusOr +HypercomputeClusterClient::DeleteCluster(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::hypercomputecluster::v1::DeleteClusterRequest request; + request.set_name(name); + return connection_->DeleteCluster(NoAwaitTag{}, request); +} + +future> +HypercomputeClusterClient::DeleteCluster( + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCluster(request); +} + +StatusOr +HypercomputeClusterClient::DeleteCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCluster(NoAwaitTag{}, request); +} + +future> +HypercomputeClusterClient::DeleteCluster( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCluster(operation); +} + +StreamRange +HypercomputeClusterClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr +HypercomputeClusterClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange +HypercomputeClusterClient::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 +HypercomputeClusterClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr +HypercomputeClusterClient::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 +HypercomputeClusterClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status HypercomputeClusterClient::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 HypercomputeClusterClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status HypercomputeClusterClient::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 HypercomputeClusterClient::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 hypercomputecluster_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/hypercomputecluster/v1/hypercompute_cluster_client.h b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_client.h new file mode 100644 index 0000000000000..13fdfc36564d2 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_client.h @@ -0,0 +1,936 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_HYPERCOMPUTE_CLUSTER_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_HYPERCOMPUTE_CLUSTER_CLIENT_H + +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_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 "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// Service describing handlers for resources +/// +/// @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 HypercomputeClusterClient { + public: + explicit HypercomputeClusterClient( + std::shared_ptr connection, + Options opts = {}); + ~HypercomputeClusterClient(); + + ///@{ + /// @name Copy and move support + HypercomputeClusterClient(HypercomputeClusterClient const&) = default; + HypercomputeClusterClient& operator=(HypercomputeClusterClient const&) = + default; + HypercomputeClusterClient(HypercomputeClusterClient&&) = default; + HypercomputeClusterClient& operator=(HypercomputeClusterClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(HypercomputeClusterClient const& a, + HypercomputeClusterClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(HypercomputeClusterClient const& a, + HypercomputeClusterClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Lists Clusters in a given project and location. + /// + /// @param parent Required. Parent location of the clusters to list, in the format + /// `projects/{project}/locations/{location}`. + /// @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.hypercomputecluster.v1.Cluster], 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.hypercomputecluster.v1.Cluster]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L149} + /// [google.cloud.hypercomputecluster.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L213} + /// + // clang-format on + StreamRange ListClusters( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Clusters 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.hypercomputecluster.v1.ListClustersRequest]. + /// 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.hypercomputecluster.v1.Cluster], 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.hypercomputecluster.v1.Cluster]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L149} + /// [google.cloud.hypercomputecluster.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L213} + /// + // clang-format on + StreamRange ListClusters( + google::cloud::hypercomputecluster::v1::ListClustersRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Cluster. + /// + /// @param name Required. Name of the cluster to retrieve, in the format + /// `projects/{project}/locations/{location}/clusters/{cluster}`. + /// @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.hypercomputecluster.v1.Cluster]) + /// 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.hypercomputecluster.v1.Cluster]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L149} + /// [google.cloud.hypercomputecluster.v1.GetClusterRequest]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L265} + /// + // clang-format on + StatusOr GetCluster( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Cluster. + /// + /// @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.hypercomputecluster.v1.GetClusterRequest]. + /// 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.hypercomputecluster.v1.Cluster]) + /// 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.hypercomputecluster.v1.Cluster]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L149} + /// [google.cloud.hypercomputecluster.v1.GetClusterRequest]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L265} + /// + // clang-format on + StatusOr GetCluster( + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Cluster in a given project and location. + /// + /// @param parent Required. Parent location in which the cluster should be created, in the + /// format `projects/{project}/locations/{location}`. + /// @param cluster Required. Cluster to create. + /// @param cluster_id Required. ID of the cluster to create. Must conform to + /// [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, + /// alphanumeric, and at most 63 characters). + /// @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.hypercomputecluster.v1.Cluster] 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.hypercomputecluster.v1.Cluster]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L149} + /// [google.cloud.hypercomputecluster.v1.CreateClusterRequest]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L278} + /// + // clang-format on + future> + CreateCluster(std::string const& parent, + google::cloud::hypercomputecluster::v1::Cluster const& cluster, + std::string const& cluster_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCluster + /// + /// 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 CreateCluster( + NoAwaitTag, std::string const& parent, + google::cloud::hypercomputecluster::v1::Cluster const& cluster, + std::string const& cluster_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Cluster 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.hypercomputecluster.v1.CreateClusterRequest]. + /// 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.hypercomputecluster.v1.Cluster] 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.hypercomputecluster.v1.Cluster]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L149} + /// [google.cloud.hypercomputecluster.v1.CreateClusterRequest]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L278} + /// + // clang-format on + future> + CreateCluster( + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCluster + /// + /// 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 CreateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCluster + /// + /// 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> + CreateCluster(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Cluster. + /// + /// @param cluster Required. Cluster to update. + /// @param update_mask Optional. Mask specifying which fields in the cluster to update. All paths + /// must be specified explicitly - wildcards are not supported. At least one + /// path must be provided. + /// @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.hypercomputecluster.v1.Cluster] 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.hypercomputecluster.v1.Cluster]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L149} + /// [google.cloud.hypercomputecluster.v1.UpdateClusterRequest]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L307} + /// + // clang-format on + future> + UpdateCluster(google::cloud::hypercomputecluster::v1::Cluster const& cluster, + google::protobuf::FieldMask const& update_mask, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateCluster + /// + /// 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 UpdateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::Cluster const& cluster, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Cluster. + /// + /// @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.hypercomputecluster.v1.UpdateClusterRequest]. + /// 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.hypercomputecluster.v1.Cluster] 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.hypercomputecluster.v1.Cluster]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L149} + /// [google.cloud.hypercomputecluster.v1.UpdateClusterRequest]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L307} + /// + // clang-format on + future> + UpdateCluster( + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateCluster + /// + /// 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 UpdateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateCluster + /// + /// 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> + UpdateCluster(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single Cluster. + /// + /// @param name Required. Name of the cluster to delete, in the format + /// `projects/{project}/locations/{location}/clusters/{cluster}`. + /// @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.hypercomputecluster.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.hypercomputecluster.v1.DeleteClusterRequest]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L328} + /// [google.cloud.hypercomputecluster.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/operation_metadata.proto#L36} + /// + // clang-format on + future> + DeleteCluster(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCluster + /// + /// 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 DeleteCluster( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Cluster. + /// + /// @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.hypercomputecluster.v1.DeleteClusterRequest]. + /// 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.hypercomputecluster.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.hypercomputecluster.v1.DeleteClusterRequest]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/hypercompute_cluster.proto#L328} + /// [google.cloud.hypercomputecluster.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/hypercomputecluster/v1/operation_metadata.proto#L36} + /// + // clang-format on + future> + DeleteCluster( + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCluster + /// + /// 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 DeleteCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCluster + /// + /// 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> + DeleteCluster(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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 hypercomputecluster_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_HYPERCOMPUTE_CLUSTER_CLIENT_H diff --git a/google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection.cc b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection.cc new file mode 100644 index 0000000000000..8aa038ff4054f --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection.cc @@ -0,0 +1,188 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_options.h" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_connection_impl.h" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_option_defaults.h" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub_factory.h" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_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 hypercomputecluster_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HypercomputeClusterConnection::~HypercomputeClusterConnection() = default; + +StreamRange +HypercomputeClusterConnection::ListClusters( + google::cloud::hypercomputecluster::v1:: + ListClustersRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +HypercomputeClusterConnection::GetCluster( + google::cloud::hypercomputecluster::v1::GetClusterRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +HypercomputeClusterConnection::CreateCluster( + google::cloud::hypercomputecluster::v1::CreateClusterRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +HypercomputeClusterConnection::CreateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +HypercomputeClusterConnection::CreateCluster( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +HypercomputeClusterConnection::UpdateCluster( + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +HypercomputeClusterConnection::UpdateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +HypercomputeClusterConnection::UpdateCluster( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +HypercomputeClusterConnection::DeleteCluster( + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +HypercomputeClusterConnection::DeleteCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +HypercomputeClusterConnection::DeleteCluster( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +HypercomputeClusterConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +HypercomputeClusterConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +HypercomputeClusterConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +HypercomputeClusterConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status HypercomputeClusterConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status HypercomputeClusterConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr +MakeHypercomputeClusterConnection(Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = hypercomputecluster_v1_internal::HypercomputeClusterDefaultOptions( + std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = + hypercomputecluster_v1_internal::CreateDefaultHypercomputeClusterStub( + std::move(auth), options); + return hypercomputecluster_v1_internal:: + MakeHypercomputeClusterTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection.h b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection.h new file mode 100644 index 0000000000000..5acbc19a5d3eb --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection.h @@ -0,0 +1,292 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_HYPERCOMPUTE_CLUSTER_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_HYPERCOMPUTE_CLUSTER_CONNECTION_H + +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster.pb.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection_idempotency_policy.h" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `HypercomputeClusterConnection`. +class HypercomputeClusterRetryPolicy : 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 `HypercomputeClusterConnection` 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 HypercomputeClusterLimitedErrorCountRetryPolicy + : public HypercomputeClusterRetryPolicy { + 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 HypercomputeClusterLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + HypercomputeClusterLimitedErrorCountRetryPolicy( + HypercomputeClusterLimitedErrorCountRetryPolicy&& rhs) noexcept + : HypercomputeClusterLimitedErrorCountRetryPolicy( + rhs.maximum_failures()) {} + HypercomputeClusterLimitedErrorCountRetryPolicy( + HypercomputeClusterLimitedErrorCountRetryPolicy const& rhs) noexcept + : HypercomputeClusterLimitedErrorCountRetryPolicy( + 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 = HypercomputeClusterRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + hypercomputecluster_v1_internal::HypercomputeClusterRetryTraits> + impl_; +}; + +/** + * A retry policy for `HypercomputeClusterConnection` 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 HypercomputeClusterLimitedTimeRetryPolicy + : public HypercomputeClusterRetryPolicy { + 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 HypercomputeClusterLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + HypercomputeClusterLimitedTimeRetryPolicy( + HypercomputeClusterLimitedTimeRetryPolicy&& rhs) noexcept + : HypercomputeClusterLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + HypercomputeClusterLimitedTimeRetryPolicy( + HypercomputeClusterLimitedTimeRetryPolicy const& rhs) noexcept + : HypercomputeClusterLimitedTimeRetryPolicy(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 = HypercomputeClusterRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + hypercomputecluster_v1_internal::HypercomputeClusterRetryTraits> + impl_; +}; + +/** + * The `HypercomputeClusterConnection` object for `HypercomputeClusterClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `HypercomputeClusterClient`. This allows users to inject custom + * behavior (e.g., with a Google Mock object) when writing tests that use + * objects of type `HypercomputeClusterClient`. + * + * To create a concrete instance, see `MakeHypercomputeClusterConnection()`. + * + * For mocking, see + * `hypercomputecluster_v1_mocks::MockHypercomputeClusterConnection`. + */ +class HypercomputeClusterConnection { + public: + virtual ~HypercomputeClusterConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StreamRange + ListClusters( + google::cloud::hypercomputecluster::v1::ListClustersRequest request); + + virtual StatusOr GetCluster( + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request); + + virtual future> + CreateCluster( + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request); + + virtual StatusOr CreateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request); + + virtual future> + CreateCluster(google::longrunning::Operation const& operation); + + virtual future> + UpdateCluster( + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request); + + virtual StatusOr UpdateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request); + + virtual future> + UpdateCluster(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteCluster( + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request); + + virtual StatusOr DeleteCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request); + + virtual future< + StatusOr> + DeleteCluster(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 + * `HypercomputeClusterConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of + * HypercomputeClusterClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `HypercomputeClusterConnection`. Expected options are any of the + * types in the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - + * `google::cloud::hypercomputecluster_v1::HypercomputeClusterPolicyOptionList` + * + * @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 `HypercomputeClusterConnection` + * created by this function. + */ +std::shared_ptr +MakeHypercomputeClusterConnection(Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_HYPERCOMPUTE_CLUSTER_CONNECTION_H diff --git a/google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection_idempotency_policy.cc b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..81f4e17027000 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection_idempotency_policy.cc @@ -0,0 +1,101 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +HypercomputeClusterConnectionIdempotencyPolicy:: + ~HypercomputeClusterConnectionIdempotencyPolicy() = default; + +std::unique_ptr +HypercomputeClusterConnectionIdempotencyPolicy::clone() const { + return std::make_unique( + *this); +} + +Idempotency HypercomputeClusterConnectionIdempotencyPolicy::ListClusters( + google::cloud::hypercomputecluster::v1::ListClustersRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency HypercomputeClusterConnectionIdempotencyPolicy::GetCluster( + google::cloud::hypercomputecluster::v1::GetClusterRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency HypercomputeClusterConnectionIdempotencyPolicy::CreateCluster( + google::cloud::hypercomputecluster::v1::CreateClusterRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency HypercomputeClusterConnectionIdempotencyPolicy::UpdateCluster( + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency HypercomputeClusterConnectionIdempotencyPolicy::DeleteCluster( + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency HypercomputeClusterConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency HypercomputeClusterConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency HypercomputeClusterConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency HypercomputeClusterConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency HypercomputeClusterConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency HypercomputeClusterConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultHypercomputeClusterConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection_idempotency_policy.h b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection_idempotency_policy.h new file mode 100644 index 0000000000000..acdf74f19c15b --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection_idempotency_policy.h @@ -0,0 +1,87 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_HYPERCOMPUTE_CLUSTER_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_HYPERCOMPUTE_CLUSTER_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HypercomputeClusterConnectionIdempotencyPolicy { + public: + virtual ~HypercomputeClusterConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr + clone() const; + + virtual google::cloud::Idempotency ListClusters( + google::cloud::hypercomputecluster::v1::ListClustersRequest request); + + virtual google::cloud::Idempotency GetCluster( + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request); + + virtual google::cloud::Idempotency CreateCluster( + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request); + + virtual google::cloud::Idempotency UpdateCluster( + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request); + + virtual google::cloud::Idempotency DeleteCluster( + google::cloud::hypercomputecluster::v1::DeleteClusterRequest 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 +MakeDefaultHypercomputeClusterConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_HYPERCOMPUTE_CLUSTER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/hypercomputecluster/v1/hypercompute_cluster_options.h b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_options.h new file mode 100644 index 0000000000000..6512e0feea063 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/hypercompute_cluster_options.h @@ -0,0 +1,87 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_HYPERCOMPUTE_CLUSTER_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_HYPERCOMPUTE_CLUSTER_OPTIONS_H + +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_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 hypercomputecluster_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-hypercomputecluster-options + */ +struct HypercomputeClusterRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-hypercomputecluster-options + */ +struct HypercomputeClusterBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-hypercomputecluster-options + */ +struct HypercomputeClusterConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-hypercomputecluster-options + */ +struct HypercomputeClusterPollingPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to HypercomputeCluster. + * + * @ingroup google-cloud-hypercomputecluster-options + */ +using HypercomputeClusterPolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_HYPERCOMPUTE_CLUSTER_OPTIONS_H diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_auth_decorator.cc b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_auth_decorator.cc new file mode 100644 index 0000000000000..5544c153fccaa --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_auth_decorator.cc @@ -0,0 +1,238 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_auth_decorator.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HypercomputeClusterAuth::HypercomputeClusterAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +HypercomputeClusterAuth::ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::ListClustersRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListClusters(context, options, request); +} + +StatusOr +HypercomputeClusterAuth::GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetCluster(context, options, request); +} + +future> +HypercomputeClusterAuth::AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest 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->AsyncCreateCluster(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr HypercomputeClusterAuth::CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateCluster(context, options, request); +} + +future> +HypercomputeClusterAuth::AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest 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->AsyncUpdateCluster(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr HypercomputeClusterAuth::UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateCluster(context, options, request); +} + +future> +HypercomputeClusterAuth::AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest 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->AsyncDeleteCluster(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr HypercomputeClusterAuth::DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteCluster(context, options, request); +} + +StatusOr +HypercomputeClusterAuth::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 +HypercomputeClusterAuth::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 +HypercomputeClusterAuth::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 HypercomputeClusterAuth::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 HypercomputeClusterAuth::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 HypercomputeClusterAuth::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> +HypercomputeClusterAuth::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 HypercomputeClusterAuth::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 hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_auth_decorator.h b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_auth_decorator.h new file mode 100644 index 0000000000000..7a156cf93509c --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_auth_decorator.h @@ -0,0 +1,140 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_AUTH_DECORATOR_H + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HypercomputeClusterAuth : public HypercomputeClusterStub { + public: + ~HypercomputeClusterAuth() override = default; + HypercomputeClusterAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr + ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::ListClustersRequest const& + request) override; + + StatusOr GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) + override; + + future> AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + StatusOr CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + future> AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + StatusOr UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + future> AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) override; + + StatusOr DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest 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 hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_AUTH_DECORATOR_H diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_connection_impl.cc b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_connection_impl.cc new file mode 100644 index 0000000000000..1287ed569372c --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_connection_impl.cc @@ -0,0 +1,541 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_connection_impl.h" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_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 hypercomputecluster_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< + hypercomputecluster_v1::HypercomputeClusterConnectionIdempotencyPolicy> +idempotency_policy(Options const& options) { + return options + .get() + ->clone(); +} + +std::unique_ptr polling_policy(Options const& options) { + return options + .get() + ->clone(); +} + +} // namespace + +HypercomputeClusterConnectionImpl::HypercomputeClusterConnectionImpl( + std::unique_ptr background, + std::shared_ptr + stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions( + std::move(options), HypercomputeClusterConnection::options())) {} + +StreamRange +HypercomputeClusterConnectionImpl::ListClusters( + google::cloud::hypercomputecluster::v1::ListClustersRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListClusters(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< + hypercomputecluster_v1::HypercomputeClusterRetryPolicy>( + retry_policy(*current)), + backoff = std::shared_ptr(backoff_policy(*current))]( + Options const& options, + google::cloud::hypercomputecluster::v1::ListClustersRequest const& + r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1:: + ListClustersRequest const& request) { + return stub->ListClusters(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::hypercomputecluster::v1::ListClustersResponse r) { + std::vector result( + r.clusters().size()); + auto& messages = *r.mutable_clusters(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +HypercomputeClusterConnectionImpl::GetCluster( + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetCluster(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::GetClusterRequest const& + request) { + return stub_->GetCluster(context, options, request); + }, + *current, request, __func__); +} + +future> +HypercomputeClusterConnectionImpl::CreateCluster( + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateCluster(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::hypercomputecluster::v1::Cluster>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + return stub->AsyncCreateCluster(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::hypercomputecluster::v1::Cluster>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +HypercomputeClusterConnectionImpl::CreateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateCluster(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + return stub_->CreateCluster(context, options, request); + }, + *current, request, __func__); +} + +future> +HypercomputeClusterConnectionImpl::CreateCluster( + 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 CreateCluster", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::hypercomputecluster::v1::Cluster>( + 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::hypercomputecluster::v1::Cluster>, + polling_policy(*current), __func__); +} + +future> +HypercomputeClusterConnectionImpl::UpdateCluster( + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateCluster(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::hypercomputecluster::v1::Cluster>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + return stub->AsyncUpdateCluster(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::hypercomputecluster::v1::Cluster>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +HypercomputeClusterConnectionImpl::UpdateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateCluster(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + return stub_->UpdateCluster(context, options, request); + }, + *current, request, __func__); +} + +future> +HypercomputeClusterConnectionImpl::UpdateCluster( + 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 UpdateCluster", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::hypercomputecluster::v1::Cluster>( + 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::hypercomputecluster::v1::Cluster>, + polling_policy(*current), __func__); +} + +future> +HypercomputeClusterConnectionImpl::DeleteCluster( + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteCluster(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::hypercomputecluster::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::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + return stub->AsyncDeleteCluster(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::hypercomputecluster::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +HypercomputeClusterConnectionImpl::DeleteCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteCluster(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + return stub_->DeleteCluster(context, options, request); + }, + *current, request, __func__); +} + +future> +HypercomputeClusterConnectionImpl::DeleteCluster( + 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 DeleteCluster", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::hypercomputecluster::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::hypercomputecluster::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +HypercomputeClusterConnectionImpl::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< + hypercomputecluster_v1::HypercomputeClusterRetryPolicy>( + 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 +HypercomputeClusterConnectionImpl::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 +HypercomputeClusterConnectionImpl::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< + hypercomputecluster_v1::HypercomputeClusterRetryPolicy>( + 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 +HypercomputeClusterConnectionImpl::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 HypercomputeClusterConnectionImpl::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 HypercomputeClusterConnectionImpl::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 hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_connection_impl.h b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_connection_impl.h new file mode 100644 index 0000000000000..6c7950418147f --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_connection_impl.h @@ -0,0 +1,133 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_CONNECTION_IMPL_H + +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection_idempotency_policy.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_options.h" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_retry_traits.h" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HypercomputeClusterConnectionImpl + : public hypercomputecluster_v1::HypercomputeClusterConnection { + public: + ~HypercomputeClusterConnectionImpl() override = default; + + HypercomputeClusterConnectionImpl( + std::unique_ptr background, + std::shared_ptr + stub, + Options options); + + Options options() override { return options_; } + + StreamRange ListClusters( + google::cloud::hypercomputecluster::v1::ListClustersRequest request) + override; + + StatusOr GetCluster( + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) + override; + + future> + CreateCluster( + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + StatusOr CreateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + future> + CreateCluster(google::longrunning::Operation const& operation) override; + + future> + UpdateCluster( + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + StatusOr UpdateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + future> + UpdateCluster(google::longrunning::Operation const& operation) override; + + future> + DeleteCluster( + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) override; + + StatusOr DeleteCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) override; + + future> + DeleteCluster(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 hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_CONNECTION_IMPL_H diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_logging_decorator.cc b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_logging_decorator.cc new file mode 100644 index 0000000000000..927aa64515952 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_logging_decorator.cc @@ -0,0 +1,280 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_logging_decorator.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HypercomputeClusterLogging::HypercomputeClusterLogging( + std::shared_ptr child, + TracingOptions tracing_options, std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +HypercomputeClusterLogging::ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::ListClustersRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::ListClustersRequest const& + request) { + return child_->ListClusters(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +HypercomputeClusterLogging::GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::GetClusterRequest const& + request) { + return child_->GetCluster(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +HypercomputeClusterLogging::AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + return child_->AsyncCreateCluster(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +HypercomputeClusterLogging::CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + return child_->CreateCluster(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +HypercomputeClusterLogging::AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + return child_->AsyncUpdateCluster(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +HypercomputeClusterLogging::UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + return child_->UpdateCluster(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +HypercomputeClusterLogging::AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + return child_->AsyncDeleteCluster(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +HypercomputeClusterLogging::DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + return child_->DeleteCluster(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +HypercomputeClusterLogging::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 +HypercomputeClusterLogging::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 +HypercomputeClusterLogging::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 +HypercomputeClusterLogging::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 HypercomputeClusterLogging::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 HypercomputeClusterLogging::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> +HypercomputeClusterLogging::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 HypercomputeClusterLogging::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 hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_logging_decorator.h b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_logging_decorator.h new file mode 100644 index 0000000000000..b6da58db7d760 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_logging_decorator.h @@ -0,0 +1,140 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_LOGGING_DECORATOR_H + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HypercomputeClusterLogging : public HypercomputeClusterStub { + public: + ~HypercomputeClusterLogging() override = default; + HypercomputeClusterLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr + ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::ListClustersRequest const& + request) override; + + StatusOr GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) + override; + + future> AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + StatusOr CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + future> AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + StatusOr UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + future> AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) override; + + StatusOr DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest 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_; +}; // HypercomputeClusterLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_LOGGING_DECORATOR_H diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_metadata_decorator.cc b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_metadata_decorator.cc new file mode 100644 index 0000000000000..ed7c18784e541 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_metadata_decorator.cc @@ -0,0 +1,234 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_metadata_decorator.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HypercomputeClusterMetadata::HypercomputeClusterMetadata( + 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 +HypercomputeClusterMetadata::ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::ListClustersRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListClusters(context, options, request); +} + +StatusOr +HypercomputeClusterMetadata::GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetCluster(context, options, request); +} + +future> +HypercomputeClusterMetadata::AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateCluster(cq, std::move(context), std::move(options), + request); +} + +StatusOr +HypercomputeClusterMetadata::CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateCluster(context, options, request); +} + +future> +HypercomputeClusterMetadata::AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("cluster.name=", + internal::UrlEncode(request.cluster().name()))); + return child_->AsyncUpdateCluster(cq, std::move(context), std::move(options), + request); +} + +StatusOr +HypercomputeClusterMetadata::UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("cluster.name=", + internal::UrlEncode(request.cluster().name()))); + return child_->UpdateCluster(context, options, request); +} + +future> +HypercomputeClusterMetadata::AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteCluster(cq, std::move(context), std::move(options), + request); +} + +StatusOr +HypercomputeClusterMetadata::DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteCluster(context, options, request); +} + +StatusOr +HypercomputeClusterMetadata::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 +HypercomputeClusterMetadata::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 +HypercomputeClusterMetadata::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 +HypercomputeClusterMetadata::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 HypercomputeClusterMetadata::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 HypercomputeClusterMetadata::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> +HypercomputeClusterMetadata::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 HypercomputeClusterMetadata::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 HypercomputeClusterMetadata::SetMetadata( + grpc::ClientContext& context, Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void HypercomputeClusterMetadata::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 hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_metadata_decorator.h b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_metadata_decorator.h new file mode 100644 index 0000000000000..808b301488836 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_metadata_decorator.h @@ -0,0 +1,146 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_METADATA_DECORATOR_H + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HypercomputeClusterMetadata : public HypercomputeClusterStub { + public: + ~HypercomputeClusterMetadata() override = default; + HypercomputeClusterMetadata( + std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr + ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::ListClustersRequest const& + request) override; + + StatusOr GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) + override; + + future> AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + StatusOr CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + future> AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + StatusOr UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + future> AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) override; + + StatusOr DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest 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 hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_METADATA_DECORATOR_H diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_option_defaults.cc b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_option_defaults.cc new file mode 100644 index 0000000000000..57815e74fa576 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_option_defaults.cc @@ -0,0 +1,88 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_option_defaults.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_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 hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options HypercomputeClusterDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_HYPERCOMPUTE_CLUSTER_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_HYPERCOMPUTE_CLUSTER_AUTHORITY", + "hypercomputecluster.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has< + hypercomputecluster_v1::HypercomputeClusterRetryPolicyOption>()) { + options.set( + hypercomputecluster_v1::HypercomputeClusterLimitedTimeRetryPolicy( + std::chrono::minutes(10)) + .clone()); + } + if (!options.has< + hypercomputecluster_v1::HypercomputeClusterBackoffPolicyOption>()) { + options.set( + ExponentialBackoffPolicy( + std::chrono::seconds(0), std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling, kBackoffScaling) + .clone()); + } + if (!options.has< + hypercomputecluster_v1::HypercomputeClusterPollingPolicyOption>()) { + options.set( + GenericPollingPolicy< + hypercomputecluster_v1::HypercomputeClusterRetryPolicyOption::Type, + hypercomputecluster_v1::HypercomputeClusterBackoffPolicyOption:: + Type>( + options + .get() + ->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } + if (!options + .has()) { + options.set( + hypercomputecluster_v1:: + MakeDefaultHypercomputeClusterConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_option_defaults.h b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_option_defaults.h new file mode 100644 index 0000000000000..c98ef311e3e9b --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options HypercomputeClusterDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_OPTION_DEFAULTS_H diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_retry_traits.h b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_retry_traits.h new file mode 100644 index 0000000000000..b1a2b757491bc --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct HypercomputeClusterRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_RETRY_TRAITS_H diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_sources.cc b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_sources.cc new file mode 100644 index 0000000000000..5f4694fecc6b3 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_client.cc" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection.cc" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection_idempotency_policy.cc" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_auth_decorator.cc" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_connection_impl.cc" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_logging_decorator.cc" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_metadata_decorator.cc" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_option_defaults.cc" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.cc" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub_factory.cc" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_connection.cc" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_stub.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.cc b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.cc new file mode 100644 index 0000000000000..2c1da107f07e2 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.cc @@ -0,0 +1,275 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HypercomputeClusterStub::~HypercomputeClusterStub() = default; + +StatusOr +DefaultHypercomputeClusterStub::ListClusters( + grpc::ClientContext& context, Options const&, + google::cloud::hypercomputecluster::v1::ListClustersRequest const& + request) { + google::cloud::hypercomputecluster::v1::ListClustersResponse response; + auto status = grpc_stub_->ListClusters(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultHypercomputeClusterStub::GetCluster( + grpc::ClientContext& context, Options const&, + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) { + google::cloud::hypercomputecluster::v1::Cluster response; + auto status = grpc_stub_->GetCluster(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultHypercomputeClusterStub::AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::hypercomputecluster::v1::CreateClusterRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateCluster(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultHypercomputeClusterStub::CreateCluster( + grpc::ClientContext& context, Options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateCluster(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultHypercomputeClusterStub::AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::hypercomputecluster::v1::UpdateClusterRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateCluster(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultHypercomputeClusterStub::UpdateCluster( + grpc::ClientContext& context, Options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateCluster(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultHypercomputeClusterStub::AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::hypercomputecluster::v1::DeleteClusterRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteCluster(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultHypercomputeClusterStub::DeleteCluster( + grpc::ClientContext& context, Options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteCluster(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultHypercomputeClusterStub::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 +DefaultHypercomputeClusterStub::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 +DefaultHypercomputeClusterStub::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 +DefaultHypercomputeClusterStub::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 DefaultHypercomputeClusterStub::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 DefaultHypercomputeClusterStub::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> +DefaultHypercomputeClusterStub::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 DefaultHypercomputeClusterStub::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 hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.h b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.h new file mode 100644 index 0000000000000..11b067c16322f --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.h @@ -0,0 +1,244 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_STUB_H + +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster.grpc.pb.h" +#include "google/cloud/location/locations.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HypercomputeClusterStub { + public: + virtual ~HypercomputeClusterStub() = 0; + + virtual StatusOr + ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::ListClustersRequest const& + request) = 0; + + virtual StatusOr GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::GetClusterRequest const& + request) = 0; + + virtual future> AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) = 0; + + virtual StatusOr CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) = 0; + + virtual future> AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) = 0; + + virtual StatusOr UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) = 0; + + virtual future> AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) = 0; + + virtual StatusOr DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest 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 DefaultHypercomputeClusterStub : public HypercomputeClusterStub { + public: + DefaultHypercomputeClusterStub( + std::unique_ptr + 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 + ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::ListClustersRequest const& + request) override; + + StatusOr GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) + override; + + future> AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + StatusOr CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + future> AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + StatusOr UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + future> AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) override; + + StatusOr DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest 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 + grpc_stub_; + std::unique_ptr + locations_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_STUB_H diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub_factory.cc b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub_factory.cc new file mode 100644 index 0000000000000..86ae1d0196c71 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub_factory.cc @@ -0,0 +1,83 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub_factory.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster.grpc.pb.h" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_auth_decorator.h" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_logging_decorator.h" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_metadata_decorator.h" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.h" +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_stub.h" +#include "google/cloud/location/locations.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultHypercomputeClusterStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::hypercomputecluster::v1::HypercomputeCluster::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 = MakeHypercomputeClusterTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub_factory.h b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub_factory.h new file mode 100644 index 0000000000000..91ac1a37d436f --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_STUB_FACTORY_H + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultHypercomputeClusterStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_STUB_FACTORY_H diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_connection.cc b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_connection.cc new file mode 100644 index 0000000000000..9232530e1face --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_connection.cc @@ -0,0 +1,216 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HypercomputeClusterTracingConnection::HypercomputeClusterTracingConnection( + std::shared_ptr + child) + : child_(std::move(child)) {} + +StreamRange +HypercomputeClusterTracingConnection::ListClusters( + google::cloud::hypercomputecluster::v1::ListClustersRequest request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::ListClusters"); + internal::OTelScope scope(span); + auto sr = child_->ListClusters(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::hypercomputecluster::v1::Cluster>(std::move(span), + std::move(sr)); +} + +StatusOr +HypercomputeClusterTracingConnection::GetCluster( + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::GetCluster"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetCluster(request)); +} + +future> +HypercomputeClusterTracingConnection::CreateCluster( + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::CreateCluster"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateCluster(request)); +} + +StatusOr +HypercomputeClusterTracingConnection::CreateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::CreateCluster"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateCluster(NoAwaitTag{}, request)); +} + +future> +HypercomputeClusterTracingConnection::CreateCluster( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::CreateCluster"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateCluster(operation)); +} + +future> +HypercomputeClusterTracingConnection::UpdateCluster( + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::UpdateCluster"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateCluster(request)); +} + +StatusOr +HypercomputeClusterTracingConnection::UpdateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::UpdateCluster"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateCluster(NoAwaitTag{}, request)); +} + +future> +HypercomputeClusterTracingConnection::UpdateCluster( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::UpdateCluster"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateCluster(operation)); +} + +future> +HypercomputeClusterTracingConnection::DeleteCluster( + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::DeleteCluster"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteCluster(request)); +} + +StatusOr +HypercomputeClusterTracingConnection::DeleteCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::DeleteCluster"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteCluster(NoAwaitTag{}, request)); +} + +future> +HypercomputeClusterTracingConnection::DeleteCluster( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::DeleteCluster"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteCluster(operation)); +} + +StreamRange +HypercomputeClusterTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +HypercomputeClusterTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +HypercomputeClusterTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +HypercomputeClusterTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status HypercomputeClusterTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status HypercomputeClusterTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "hypercomputecluster_v1::HypercomputeClusterConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeHypercomputeClusterTracingConnection( + std::shared_ptr + conn) { + if (internal::TracingEnabled(conn->options())) { + conn = + std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_connection.h b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_connection.h new file mode 100644 index 0000000000000..4b74464d97ba6 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_connection.h @@ -0,0 +1,127 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_TRACING_CONNECTION_H + +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HypercomputeClusterTracingConnection + : public hypercomputecluster_v1::HypercomputeClusterConnection { + public: + ~HypercomputeClusterTracingConnection() override = default; + + explicit HypercomputeClusterTracingConnection( + std::shared_ptr + child); + + Options options() override { return child_->options(); } + + StreamRange ListClusters( + google::cloud::hypercomputecluster::v1::ListClustersRequest request) + override; + + StatusOr GetCluster( + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) + override; + + future> + CreateCluster( + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + StatusOr CreateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + future> + CreateCluster(google::longrunning::Operation const& operation) override; + + future> + UpdateCluster( + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + StatusOr UpdateCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + future> + UpdateCluster(google::longrunning::Operation const& operation) override; + + future> + DeleteCluster( + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) override; + + StatusOr DeleteCluster( + NoAwaitTag, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) override; + + future> + DeleteCluster(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_; +}; + +/** + * 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 +MakeHypercomputeClusterTracingConnection( + std::shared_ptr + conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_TRACING_CONNECTION_H diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_stub.cc b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_stub.cc new file mode 100644 index 0000000000000..044ea34db6075 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_stub.cc @@ -0,0 +1,265 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HypercomputeClusterTracingStub::HypercomputeClusterTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +HypercomputeClusterTracingStub::ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::ListClustersRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", + "ListClusters"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListClusters(context, options, request)); +} + +StatusOr +HypercomputeClusterTracingStub::GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", "GetCluster"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetCluster(context, options, request)); +} + +future> +HypercomputeClusterTracingStub::AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", + "CreateCluster"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateCluster(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +HypercomputeClusterTracingStub::CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", + "CreateCluster"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateCluster(context, options, request)); +} + +future> +HypercomputeClusterTracingStub::AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", + "UpdateCluster"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateCluster(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +HypercomputeClusterTracingStub::UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", + "UpdateCluster"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateCluster(context, options, request)); +} + +future> +HypercomputeClusterTracingStub::AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", + "DeleteCluster"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteCluster(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +HypercomputeClusterTracingStub::DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", + "DeleteCluster"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteCluster(context, options, request)); +} + +StatusOr +HypercomputeClusterTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", + "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +HypercomputeClusterTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +HypercomputeClusterTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", + "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +HypercomputeClusterTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", + "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status HypercomputeClusterTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", + "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status HypercomputeClusterTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.hypercomputecluster.v1.HypercomputeCluster", + "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +HypercomputeClusterTracingStub::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 HypercomputeClusterTracingStub::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)); +} + +std::shared_ptr MakeHypercomputeClusterTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_stub.h b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_stub.h new file mode 100644 index 0000000000000..5b5d33ef585d9 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_tracing_stub.h @@ -0,0 +1,148 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_TRACING_STUB_H + +#include "google/cloud/hypercomputecluster/v1/internal/hypercompute_cluster_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HypercomputeClusterTracingStub : public HypercomputeClusterStub { + public: + ~HypercomputeClusterTracingStub() override = default; + + explicit HypercomputeClusterTracingStub( + std::shared_ptr child); + + StatusOr + ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::ListClustersRequest const& + request) override; + + StatusOr GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::hypercomputecluster::v1::GetClusterRequest const& request) + override; + + future> AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + StatusOr CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request) override; + + future> AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + StatusOr UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request) override; + + future> AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request) override; + + StatusOr DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest 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_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeHypercomputeClusterTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace hypercomputecluster_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_INTERNAL_HYPERCOMPUTE_CLUSTER_TRACING_STUB_H diff --git a/google/cloud/hypercomputecluster/v1/mocks/mock_hypercompute_cluster_connection.h b/google/cloud/hypercomputecluster/v1/mocks/mock_hypercompute_cluster_connection.h new file mode 100644 index 0000000000000..05274f6b34775 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/mocks/mock_hypercompute_cluster_connection.h @@ -0,0 +1,217 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_MOCKS_MOCK_HYPERCOMPUTE_CLUSTER_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_MOCKS_MOCK_HYPERCOMPUTE_CLUSTER_CONNECTION_H + +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection.h" +#include + +namespace google { +namespace cloud { +namespace hypercomputecluster_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `HypercomputeClusterConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `HypercomputeClusterClient`. To do + * so, construct an object of type `HypercomputeClusterClient` 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 MockHypercomputeClusterConnection + : public hypercomputecluster_v1::HypercomputeClusterConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD( + (StreamRange), + ListClusters, + (google::cloud::hypercomputecluster::v1::ListClustersRequest request), + (override)); + + MOCK_METHOD(StatusOr, + GetCluster, + (google::cloud::hypercomputecluster::v1::GetClusterRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateCluster(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateCluster, + (google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateCluster(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateCluster, + (NoAwaitTag, + google::cloud::hypercomputecluster::v1::CreateClusterRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateCluster(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateCluster, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateCluster(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateCluster, + (google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateCluster(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateCluster, + (NoAwaitTag, + google::cloud::hypercomputecluster::v1::UpdateClusterRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateCluster(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateCluster, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteCluster(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + DeleteCluster, + (google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteCluster(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteCluster, + (NoAwaitTag, + google::cloud::hypercomputecluster::v1::DeleteClusterRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteCluster(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + DeleteCluster, (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 hypercomputecluster_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_HYPERCOMPUTECLUSTER_V1_MOCKS_MOCK_HYPERCOMPUTE_CLUSTER_CONNECTION_H diff --git a/google/cloud/hypercomputecluster/v1/samples/hypercompute_cluster_client_samples.cc b/google/cloud/hypercomputecluster/v1/samples/hypercompute_cluster_client_samples.cc new file mode 100644 index 0000000000000..8cb77d2aea551 --- /dev/null +++ b/google/cloud/hypercomputecluster/v1/samples/hypercompute_cluster_client_samples.cc @@ -0,0 +1,242 @@ +// Copyright 2026 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/hypercomputecluster/v1/hypercompute_cluster.proto + +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_client.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_connection_idempotency_policy.h" +#include "google/cloud/hypercomputecluster/v1/hypercompute_cluster_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 "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: hypercomputecluster_v1::HypercomputeClusterClient +// 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::hypercomputecluster_v1::HypercomputeClusterClient( + google::cloud::hypercomputecluster_v1:: + MakeHypercomputeClusterConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = + google::cloud::hypercomputecluster_v1::HypercomputeClusterClient( + google::cloud::hypercomputecluster_v1:: + MakeHypercomputeClusterConnection(*ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::hypercomputecluster_v1:: + HypercomputeClusterConnectionIdempotencyPolicy { + 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::hypercomputecluster_v1:: + HypercomputeClusterLimitedErrorCountRetryPolicy(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::hypercomputecluster_v1::MakeHypercomputeClusterConnection( + options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::hypercomputecluster_v1::HypercomputeClusterClient( + connection); + auto c2 = google::cloud::hypercomputecluster_v1::HypercomputeClusterClient( + 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::hypercomputecluster_v1::HypercomputeClusterClient( + connection, google::cloud::Options{} + .set( + google::cloud::hypercomputecluster_v1:: + HypercomputeClusterLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::hypercomputecluster_v1::HypercomputeClusterLimitedErrorCountRetryPolicy(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::hypercomputecluster_v1:: + HypercomputeClusterRetryPolicyOption::Type, + google::cloud::hypercomputecluster_v1:: + HypercomputeClusterBackoffPolicyOption::Type>( + google::cloud::hypercomputecluster_v1:: + HypercomputeClusterLimitedTimeRetryPolicy( + /*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::hypercomputecluster_v1::MakeHypercomputeClusterConnection( + options); + + // c1 and c2 share the same polling policies. + auto c1 = google::cloud::hypercomputecluster_v1::HypercomputeClusterClient( + connection); + auto c2 = google::cloud::hypercomputecluster_v1::HypercomputeClusterClient( + 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::hypercomputecluster_v1::HypercomputeClusterClient( + google::cloud::hypercomputecluster_v1:: + MakeHypercomputeClusterConnection(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}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/iam/quickstart/.bazelversion b/google/cloud/iam/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/iam/quickstart/.bazelversion +++ b/google/cloud/iam/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/iam/quickstart/MODULE.bazel b/google/cloud/iam/quickstart/MODULE.bazel index 769db68723a0d..e47bfb6fa8af0 100644 --- a/google/cloud/iam/quickstart/MODULE.bazel +++ b/google/cloud/iam/quickstart/MODULE.bazel @@ -17,4 +17,4 @@ module( version = "0.0.0", ) -bazel_dep(name = "google_cloud_cpp", version = "3.1.0") +bazel_dep(name = "google_cloud_cpp", version = "3.2.0") diff --git a/google/cloud/iam/quickstart/WORKSPACE.bazel b/google/cloud/iam/quickstart/WORKSPACE.bazel index a0f55c8651f0a..7f6c3929113c8 100644 --- a/google/cloud/iam/quickstart/WORKSPACE.bazel +++ b/google/cloud/iam/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/iap/quickstart/.bazelversion b/google/cloud/iap/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/iap/quickstart/.bazelversion +++ b/google/cloud/iap/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/iap/quickstart/WORKSPACE.bazel b/google/cloud/iap/quickstart/WORKSPACE.bazel index b23bb85699c45..b7aae0c70bc66 100644 --- a/google/cloud/iap/quickstart/WORKSPACE.bazel +++ b/google/cloud/iap/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/iap/v1/identity_aware_proxy_admin_client.h b/google/cloud/iap/v1/identity_aware_proxy_admin_client.h index 5814003b9f02b..dbe223815500f 100644 --- a/google/cloud/iap/v1/identity_aware_proxy_admin_client.h +++ b/google/cloud/iap/v1/identity_aware_proxy_admin_client.h @@ -276,8 +276,8 @@ class IdentityAwareProxyAdminServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.iap.v1.ValidateIapAttributeExpressionRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L684} - /// [google.cloud.iap.v1.ValidateIapAttributeExpressionResponse]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L695} + /// [google.cloud.iap.v1.ValidateIapAttributeExpressionRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L701} + /// [google.cloud.iap.v1.ValidateIapAttributeExpressionResponse]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L712} /// // clang-format on StatusOr diff --git a/google/cloud/iap/v1/identity_aware_proxy_o_auth_client.h b/google/cloud/iap/v1/identity_aware_proxy_o_auth_client.h index a710efbc8f4f9..8f3359b14d80f 100644 --- a/google/cloud/iap/v1/identity_aware_proxy_o_auth_client.h +++ b/google/cloud/iap/v1/identity_aware_proxy_o_auth_client.h @@ -115,8 +115,8 @@ class IdentityAwareProxyOAuthServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.iap.v1.ListBrandsRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L698} - /// [google.cloud.iap.v1.ListBrandsResponse]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L705} + /// [google.cloud.iap.v1.ListBrandsRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L715} + /// [google.cloud.iap.v1.ListBrandsResponse]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L722} /// // clang-format on StatusOr ListBrands( @@ -153,8 +153,8 @@ class IdentityAwareProxyOAuthServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.iap.v1.Brand]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L797} - /// [google.cloud.iap.v1.CreateBrandRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L711} + /// [google.cloud.iap.v1.Brand]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L814} + /// [google.cloud.iap.v1.CreateBrandRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L728} /// // clang-format on StatusOr CreateBrand( @@ -184,8 +184,8 @@ class IdentityAwareProxyOAuthServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.iap.v1.Brand]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L797} - /// [google.cloud.iap.v1.GetBrandRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L721} + /// [google.cloud.iap.v1.Brand]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L814} + /// [google.cloud.iap.v1.GetBrandRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L738} /// // clang-format on StatusOr GetBrand( @@ -217,8 +217,8 @@ class IdentityAwareProxyOAuthServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.iap.v1.CreateIdentityAwareProxyClientRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L759} - /// [google.cloud.iap.v1.IdentityAwareProxyClient]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L815} + /// [google.cloud.iap.v1.CreateIdentityAwareProxyClientRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L776} + /// [google.cloud.iap.v1.IdentityAwareProxyClient]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L832} /// // clang-format on StatusOr @@ -259,8 +259,8 @@ class IdentityAwareProxyOAuthServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.iap.v1.IdentityAwareProxyClient]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L815} - /// [google.cloud.iap.v1.ListIdentityAwareProxyClientsRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L728} + /// [google.cloud.iap.v1.IdentityAwareProxyClient]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L832} + /// [google.cloud.iap.v1.ListIdentityAwareProxyClientsRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L745} /// // clang-format on StreamRange @@ -292,8 +292,8 @@ class IdentityAwareProxyOAuthServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.iap.v1.GetIdentityAwareProxyClientRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L772} - /// [google.cloud.iap.v1.IdentityAwareProxyClient]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L815} + /// [google.cloud.iap.v1.GetIdentityAwareProxyClientRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L789} + /// [google.cloud.iap.v1.IdentityAwareProxyClient]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L832} /// // clang-format on StatusOr @@ -325,8 +325,8 @@ class IdentityAwareProxyOAuthServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.iap.v1.IdentityAwareProxyClient]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L815} - /// [google.cloud.iap.v1.ResetIdentityAwareProxyClientSecretRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L780} + /// [google.cloud.iap.v1.IdentityAwareProxyClient]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L832} + /// [google.cloud.iap.v1.ResetIdentityAwareProxyClientSecretRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L797} /// // clang-format on StatusOr @@ -358,7 +358,7 @@ class IdentityAwareProxyOAuthServiceClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.iap.v1.DeleteIdentityAwareProxyClientRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L788} + /// [google.cloud.iap.v1.DeleteIdentityAwareProxyClientRequest]: @googleapis_reference_link{google/cloud/iap/v1/service.proto#L805} /// // clang-format on Status DeleteIdentityAwareProxyClient( diff --git a/google/cloud/ids/quickstart/.bazelversion b/google/cloud/ids/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/ids/quickstart/.bazelversion +++ b/google/cloud/ids/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/ids/quickstart/WORKSPACE.bazel b/google/cloud/ids/quickstart/WORKSPACE.bazel index fd6719597965f..5364de951dea8 100644 --- a/google/cloud/ids/quickstart/WORKSPACE.bazel +++ b/google/cloud/ids/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/internal/completion_queue_impl.h b/google/cloud/internal/completion_queue_impl.h index 31afec8e3c005..3f623668aa408 100644 --- a/google/cloud/internal/completion_queue_impl.h +++ b/google/cloud/internal/completion_queue_impl.h @@ -18,6 +18,7 @@ #include "google/cloud/async_operation.h" #include "google/cloud/future.h" #include "google/cloud/internal/invoke_result.h" +#include "google/cloud/internal/run_async_base.h" #include "google/cloud/internal/throw_delegate.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" @@ -30,12 +31,6 @@ namespace cloud { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace internal { -// Type erase the callables in RunAsync() -struct RunAsyncBase { - virtual ~RunAsyncBase() = default; - virtual void exec() = 0; -}; - /** * The implementation details for `CompletionQueue`. * diff --git a/google/cloud/internal/curl_impl.cc b/google/cloud/internal/curl_impl.cc index c20667a4b5b3d..9d897bfe59909 100644 --- a/google/cloud/internal/curl_impl.cc +++ b/google/cloud/internal/curl_impl.cc @@ -297,10 +297,9 @@ void CurlImpl::MergeAndWriteHeaders( } } -void CurlImpl::SetHeaders( - std::unordered_map> const& headers) { +void CurlImpl::SetHeaders(HttpHeaders const& headers) { for (auto const& header : headers) { - SetHeader(HttpHeader(header.first, header.second)); + SetHeader(header.second); } } diff --git a/google/cloud/internal/curl_impl.h b/google/cloud/internal/curl_impl.h index 266be569501e3..c71078aeeacd4 100644 --- a/google/cloud/internal/curl_impl.h +++ b/google/cloud/internal/curl_impl.h @@ -35,7 +35,6 @@ #include #include #include -#include #include namespace google { @@ -84,8 +83,7 @@ class CurlImpl { CurlImpl& operator=(CurlImpl&&) = default; void SetHeader(HttpHeader header); - void SetHeaders( - std::unordered_map> const& headers); + void SetHeaders(HttpHeaders const& headers); std::string MakeEscapedString(std::string const& s); diff --git a/google/cloud/internal/curl_rest_client.cc b/google/cloud/internal/curl_rest_client.cc index 04f5ec98cea6b..0a993ff7c2a86 100644 --- a/google/cloud/internal/curl_rest_client.cc +++ b/google/cloud/internal/curl_rest_client.cc @@ -124,10 +124,12 @@ StatusOr> CurlRestClient::CreateCurlImpl( auto impl = std::make_unique(std::move(handle), handle_factory_, options); if (credentials_) { - auto auth_header = - credentials_->AuthenticationHeader(std::chrono::system_clock::now()); - if (!auth_header.ok()) return std::move(auth_header).status(); - impl->SetHeader(HttpHeader(auth_header->first, auth_header->second)); + auto auth_headers = credentials_->AuthenticationHeaders( + std::chrono::system_clock::now(), endpoint_address_); + if (!auth_headers.ok()) return std::move(auth_headers).status(); + for (auto& header : *auth_headers) { + impl->SetHeader(std::move(header)); + } } impl->SetHeader(HostHeader(options, endpoint_address_)); impl->SetHeaders(context.headers()); diff --git a/google/cloud/internal/curl_rest_client_test.cc b/google/cloud/internal/curl_rest_client_test.cc index 59f8339d7b28d..487be9ed6bac0 100644 --- a/google/cloud/internal/curl_rest_client_test.cc +++ b/google/cloud/internal/curl_rest_client_test.cc @@ -29,21 +29,21 @@ TEST(CurlRestClientStandaloneFunctions, HostHeader) { std::string expected; } cases[] = { {"https://storage.googleapis.com", "storage.googleapis.com", - "Host: storage.googleapis.com"}, - {"https://storage.googleapis.com", "", "Host: storage.googleapis.com"}, - {"https://storage.googleapis.com", "auth", "Host: auth"}, + "host: storage.googleapis.com"}, + {"https://storage.googleapis.com", "", "host: storage.googleapis.com"}, + {"https://storage.googleapis.com", "auth", "host: auth"}, {"https://storage.googleapis.com:443", "storage.googleapis.com", - "Host: storage.googleapis.com"}, + "host: storage.googleapis.com"}, {"https://restricted.googleapis.com", "storage.googleapis.com", - "Host: storage.googleapis.com"}, + "host: storage.googleapis.com"}, {"https://private.googleapis.com", "storage.googleapis.com", - "Host: storage.googleapis.com"}, + "host: storage.googleapis.com"}, {"https://restricted.googleapis.com", "iamcredentials.googleapis.com", - "Host: iamcredentials.googleapis.com"}, + "host: iamcredentials.googleapis.com"}, {"https://private.googleapis.com", "iamcredentials.googleapis.com", - "Host: iamcredentials.googleapis.com"}, + "host: iamcredentials.googleapis.com"}, {"http://localhost:8080", "", ""}, - {"http://localhost:8080", "auth", "Host: auth"}, + {"http://localhost:8080", "auth", "host: auth"}, {"http://[::1]", "", ""}, {"http://[::1]/", "", ""}, {"http://[::1]/foo/bar", "", ""}, diff --git a/google/cloud/internal/http_header.cc b/google/cloud/internal/http_header.cc index 32d0220797bd9..fbe8820eec808 100644 --- a/google/cloud/internal/http_header.cc +++ b/google/cloud/internal/http_header.cc @@ -22,48 +22,50 @@ namespace cloud { namespace rest_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -HttpHeader::HttpHeader(std::string key) : key_(std::move(key)) {} +HttpHeader::HttpHeader(HttpHeaderName key) : name_(std::move(key)) {} -HttpHeader::HttpHeader(std::string key, std::string value) - : key_(std::move(key)), values_({std::move(value)}) {} +HttpHeader::HttpHeader(std::pair header) + : HttpHeader(std::move(header.first), std::move(header.second)) {} -HttpHeader::HttpHeader(std::string key, std::vector values) - : key_(std::move(key)), values_(std::move(values)) {} +HttpHeader::HttpHeader(HttpHeaderName key, std::string value) + : name_(std::move(key)), values_({std::move(value)}) {} -HttpHeader::HttpHeader(std::string key, +HttpHeader::HttpHeader(HttpHeaderName key, std::vector values) + : name_(std::move(key)), values_(std::move(values)) {} + +HttpHeader::HttpHeader(HttpHeaderName key, std::initializer_list values) - : key_(std::move(key)) { + : name_(std::move(key)) { for (auto&& v : values) values_.emplace_back(v); } bool operator==(HttpHeader const& lhs, HttpHeader const& rhs) { - return absl::AsciiStrToLower(lhs.key_) == absl::AsciiStrToLower(rhs.key_) && - lhs.values_ == rhs.values_; + return lhs.name_ == rhs.name_ && lhs.values_ == rhs.values_; } bool operator<(HttpHeader const& lhs, HttpHeader const& rhs) { - return absl::AsciiStrToLower(lhs.key_) < absl::AsciiStrToLower(rhs.key_); + return lhs.name_ < rhs.name_; } -bool HttpHeader::IsSameKey(std::string const& key) const { - return absl::AsciiStrToLower(key_) == absl::AsciiStrToLower(key); +bool HttpHeader::IsSameKey(HttpHeaderName const& name) const { + return name_ == name.name(); } bool HttpHeader::IsSameKey(HttpHeader const& other) const { - return IsSameKey(other.key_); + return name_ == other.name_; } HttpHeader::operator std::string() const { - if (key_.empty()) return {}; - if (values_.empty()) return absl::StrCat(key_, ":"); - return absl::StrCat(key_, ": ", absl::StrJoin(values_, ",")); + if (name_.empty()) return {}; + if (values_.empty()) return absl::StrCat(name_.name(), ":"); + return absl::StrCat(name_.name(), ": ", absl::StrJoin(values_, ",")); } std::string HttpHeader::DebugString() const { - if (key_.empty()) return {}; - if (values_.empty()) return absl::StrCat(key_, ":"); + if (name_.empty()) return {}; + if (values_.empty()) return absl::StrCat(name_.name(), ":"); return absl::StrCat( - key_, ": ", + name_.name(), ": ", absl::StrJoin(values_, ",", [](std::string* out, std::string const& v) { absl::StrAppend(out, v.substr(0, 10)); })); diff --git a/google/cloud/internal/http_header.h b/google/cloud/internal/http_header.h index 54799eaf2fb83..06a70993b74d9 100644 --- a/google/cloud/internal/http_header.h +++ b/google/cloud/internal/http_header.h @@ -16,6 +16,13 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_HTTP_HEADER_H #include "google/cloud/version.h" +#include "absl/strings/ascii.h" +#include +#if UINTPTR_MAX == UINT64_MAX +#include "absl/container/flat_hash_map.h" +#else +#include +#endif // UINTPTR_MAX == UINT64_MAX #include #include @@ -24,17 +31,67 @@ namespace cloud { namespace rest_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +// This class represents a case-insensitive HTTP header name by storing all +// strings in lower-case. +class HttpHeaderName { + public: + HttpHeaderName() = default; + HttpHeaderName(std::string name) // NOLINT(google-explicit-constructor) + : name_(std::move(name)) { + absl::AsciiStrToLower(&name_); + } + HttpHeaderName(std::string_view name) // NOLINT(google-explicit-constructor) + : HttpHeaderName(std::string{name}) {} + HttpHeaderName(char const* name) // NOLINT(google-explicit-constructor) + : HttpHeaderName(std::string{name}) {} + + operator std::string() const { // NOLINT(google-explicit-constructor) + return name_; + } + operator std::string_view() const { // NOLINT(google-explicit-constructor) + return name_; + } + operator char const*() const { // NOLINT(google-explicit-constructor) + return name_.c_str(); + } + + bool empty() const { return name_.empty(); } + std::string const& name() const { return name_; } + + friend bool operator==(HttpHeaderName const& lhs, HttpHeaderName const& rhs) { + return lhs.name_ == rhs.name_; + } + friend bool operator<(HttpHeaderName const& lhs, HttpHeaderName const& rhs) { + return lhs.name_ < rhs.name_; + } + friend bool operator!=(HttpHeaderName const& lhs, HttpHeaderName const& rhs) { + return !(lhs == rhs); + } + friend bool operator>(HttpHeaderName const& lhs, HttpHeaderName const& rhs) { + return !(lhs < rhs) && (lhs != rhs); + } + friend bool operator>=(HttpHeaderName const& lhs, HttpHeaderName const& rhs) { + return !(lhs < rhs); + } + friend bool operator<=(HttpHeaderName const& lhs, HttpHeaderName const& rhs) { + return !(lhs > rhs); + } + + private: + std::string name_; +}; + /** * This class represents an HTTP header field. */ class HttpHeader { public: HttpHeader() = default; - explicit HttpHeader(std::string key); - HttpHeader(std::string key, std::string value); - HttpHeader(std::string key, std::initializer_list values); - - HttpHeader(std::string key, std::vector values); + explicit HttpHeader(HttpHeaderName key); + explicit HttpHeader(std::pair header); + HttpHeader(HttpHeaderName key, std::string value); + HttpHeader(HttpHeaderName key, std::initializer_list values); + HttpHeader(HttpHeaderName key, std::vector values); HttpHeader(HttpHeader&&) = default; HttpHeader& operator=(HttpHeader&&) = default; @@ -57,14 +114,20 @@ class HttpHeader { friend bool operator<(HttpHeader const& lhs, HttpHeader const& rhs); // If the key is empty, the entire HttpHeader is considered empty. - bool empty() const { return key_.empty(); } + bool empty() const { return name_.empty(); } + + // Number of values. + std::size_t size() const { return values_.size(); } // Checks to see if the values are empty. Does not inspect the key field. bool EmptyValues() const { return values_.empty(); } // Performs a case-insensitive comparison of the key. bool IsSameKey(HttpHeader const& other) const; - bool IsSameKey(std::string const& key) const; + bool IsSameKey(HttpHeaderName const& name) const; + + std::string name() const { return name_; } + std::vector const& values() const { return values_; } // While the RFCs indicate that header keys are case-insensitive, no attempt // to convert them to all lowercase is made. Header keys are printed in the @@ -83,14 +146,44 @@ class HttpHeader { HttpHeader& MergeHeader(HttpHeader const& other); HttpHeader& MergeHeader(HttpHeader&& other); + using value_type = std::string; + using const_iterator = std::vector::const_iterator; + const_iterator begin() const { return values_.begin(); } + const_iterator end() const { return values_.end(); } + const_iterator cbegin() const { return begin(); } + const_iterator cend() const { return end(); } + private: - std::string key_; + HttpHeaderName name_; std::vector values_; }; +// Abseil does not guarantee compatibility with 32-bit platforms that they do +// not test with. Support for such platforms is a community effort. Using +// std::unordered_map on 32-bit platforms reduces the likelihood of issues +// arising due to this arrangement. +#if UINTPTR_MAX == UINT64_MAX +// 64-bit architecture +using HttpHeaders = absl::flat_hash_map; +#else +// 32-bit architecture +using HttpHeaders = std::unordered_map; +#endif // UINTPTR_MAX == UINT64_MAX + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace rest_internal } // namespace cloud } // namespace google +#if UINTPTR_MAX != UINT64_MAX +// This specialization has to be in the global namespace. +template <> +struct std::hash { + std::size_t operator()( + google::cloud::rest_internal::HttpHeaderName const& k) const noexcept { + return std::hash()(k.name()); + } +}; +#endif // UINTPTR_MAX != UINT64_MAX + #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_HTTP_HEADER_H diff --git a/google/cloud/internal/http_header_test.cc b/google/cloud/internal/http_header_test.cc index a7fd60520a101..4e8441d385fee 100644 --- a/google/cloud/internal/http_header_test.cc +++ b/google/cloud/internal/http_header_test.cc @@ -23,6 +23,48 @@ namespace { using ::testing::Eq; +TEST(HttpHeaderName, ConstructorsAndConversions) { + auto constexpr kHeaderName = "header-name"; + std::string header(kHeaderName); + std::string_view header_view(header); + + HttpHeaderName h1(header); + HttpHeaderName h2(header_view); + HttpHeaderName h3(kHeaderName); + + EXPECT_THAT(std::string(h2), Eq(header)); + EXPECT_THAT(std::string_view(h3), Eq(header)); + EXPECT_THAT(static_cast(h1), Eq(header)); +} + +TEST(HttpHeaderName, Empty) { + HttpHeaderName empty; + EXPECT_TRUE(empty.empty()); + EXPECT_THAT(std::string(empty), Eq("")); + + HttpHeaderName not_empty("header-name"); + EXPECT_FALSE(not_empty.empty()); + EXPECT_THAT(std::string(not_empty), Eq("header-name")); +} + +TEST(HttpHeaderName, LogicalOperators) { + HttpHeaderName h1("aa"); + HttpHeaderName h2("bb"); + EXPECT_TRUE(h1 < h2); + EXPECT_FALSE(h2 < h1); + EXPECT_FALSE(h1 == h2); + EXPECT_FALSE(h2 == h1); + EXPECT_TRUE(h1 != h2); + EXPECT_TRUE(h2 != h1); + EXPECT_FALSE(h1 > h2); + EXPECT_TRUE(h2 > h1); + EXPECT_TRUE(h1 >= h1); + EXPECT_TRUE(h2 >= h1); + EXPECT_TRUE(h1 <= h2); + EXPECT_TRUE(h1 <= h1); + EXPECT_TRUE(h2 >= h1); +} + TEST(HttpHeader, ConstructionAndStringFormatting) { HttpHeader empty; EXPECT_THAT(std::string(empty), Eq("")); diff --git a/google/cloud/internal/json_parsing.cc b/google/cloud/internal/json_parsing.cc index b1e42321debe5..6ef260fe38c35 100644 --- a/google/cloud/internal/json_parsing.cc +++ b/google/cloud/internal/json_parsing.cc @@ -63,6 +63,19 @@ StatusOr ValidateIntField(nlohmann::json const& json, return it->get(); } +StatusOr> ValidateStringArrayField( + nlohmann::json const& json, absl::string_view name, + absl::string_view object_name, internal::ErrorContext const& ec) { + auto it = json.find(std::string{name}); + if (it == json.end()) return MissingFieldError(name, object_name, ec); + if (!it->is_array()) return InvalidTypeError(name, object_name, ec); + if (!std::all_of(it->begin(), it->end(), + [](nlohmann::json const& e) { return e.is_string(); })) { + return InvalidTypeError(name, object_name, ec); + } + return it->get>(); +} + Status MissingFieldError(absl::string_view name, absl::string_view object_name, internal::ErrorContext const& ec) { return InvalidArgumentError( diff --git a/google/cloud/internal/json_parsing.h b/google/cloud/internal/json_parsing.h index 3549d73326f92..66676f6811f4d 100644 --- a/google/cloud/internal/json_parsing.h +++ b/google/cloud/internal/json_parsing.h @@ -57,6 +57,12 @@ StatusOr ValidateIntField(nlohmann::json const& json, std::int32_t default_value, internal::ErrorContext const& ec); +/// Returns the string values for `json[name]` (which must exist) or a +/// descriptive error. +StatusOr> ValidateStringArrayField( + nlohmann::json const& json, absl::string_view name, + absl::string_view object_name, internal::ErrorContext const& ec); + /// Use when a JSON field cannot be found but is required. Status MissingFieldError(absl::string_view name, absl::string_view object_name, internal::ErrorContext const& ec); diff --git a/google/cloud/internal/json_parsing_test.cc b/google/cloud/internal/json_parsing_test.cc index 5fa05b8c8dfe9..10f277de1a1d3 100644 --- a/google/cloud/internal/json_parsing_test.cc +++ b/google/cloud/internal/json_parsing_test.cc @@ -25,10 +25,11 @@ namespace { using ::google::cloud::testing_util::StatusIs; using ::testing::AllOf; using ::testing::Contains; +using ::testing::ElementsAre; using ::testing::HasSubstr; using ::testing::Pair; -TEST(ExternalAccountParsing, ValidateStringFieldSuccess) { +TEST(JsonParsingTest, ValidateStringFieldSuccess) { auto const json = nlohmann::json{{"someField", "value"}}; auto actual = ValidateStringField( json, "someField", "test-object", @@ -37,7 +38,7 @@ TEST(ExternalAccountParsing, ValidateStringFieldSuccess) { EXPECT_EQ(*actual, "value"); } -TEST(ExternalAccountParsing, ValidateStringFieldMissing) { +TEST(JsonParsingTest, ValidateStringFieldMissing) { auto const json = nlohmann::json{{"some-field", "value"}}; auto actual = ValidateStringField( json, "missingField", "test-object", @@ -51,7 +52,7 @@ TEST(ExternalAccountParsing, ValidateStringFieldMissing) { Contains(Pair("origin", "test"))); } -TEST(ExternalAccountParsing, ValidateStringFieldNotString) { +TEST(JsonParsingTest, ValidateStringFieldNotString) { auto const json = nlohmann::json{{"some-field", "value"}, {"wrongType", true}}; auto actual = ValidateStringField( @@ -66,7 +67,7 @@ TEST(ExternalAccountParsing, ValidateStringFieldNotString) { Contains(Pair("origin", "test"))); } -TEST(ExternalAccountParsing, ValidateStringFieldDefaultSuccess) { +TEST(JsonParsingTest, ValidateStringFieldDefaultSuccess) { auto const json = nlohmann::json{{"someField", "value"}}; auto actual = ValidateStringField( json, "someField", "test-object", "default-value", @@ -75,7 +76,7 @@ TEST(ExternalAccountParsing, ValidateStringFieldDefaultSuccess) { EXPECT_EQ(*actual, "value"); } -TEST(ExternalAccountParsing, ValidateStringFieldDefaultMissing) { +TEST(JsonParsingTest, ValidateStringFieldDefaultMissing) { auto const json = nlohmann::json{{"anotherField", "value"}}; auto actual = ValidateStringField( json, "someField", "test-object", "default-value", @@ -84,7 +85,7 @@ TEST(ExternalAccountParsing, ValidateStringFieldDefaultMissing) { EXPECT_EQ(*actual, "default-value"); } -TEST(ExternalAccountParsing, ValidateStringFieldDefaultNotInt) { +TEST(JsonParsingTest, ValidateStringFieldDefaultNotInt) { auto const json = nlohmann::json{{"some-field", "value"}, {"wrongType", true}}; auto actual = ValidateStringField( @@ -99,7 +100,7 @@ TEST(ExternalAccountParsing, ValidateStringFieldDefaultNotInt) { Contains(Pair("origin", "test"))); } -TEST(ExternalAccountParsing, ValidateIntFieldSuccess) { +TEST(JsonParsingTest, ValidateIntFieldSuccess) { auto const json = nlohmann::json{{"someField", 42}}; auto actual = ValidateIntField( json, "someField", "test-object", @@ -108,7 +109,7 @@ TEST(ExternalAccountParsing, ValidateIntFieldSuccess) { EXPECT_EQ(*actual, 42); } -TEST(ExternalAccountParsing, ValidateIntFieldMissing) { +TEST(JsonParsingTest, ValidateIntFieldMissing) { auto const json = nlohmann::json{{"some-field", 42}}; auto actual = ValidateIntField( json, "missingField", "test-object", @@ -122,7 +123,7 @@ TEST(ExternalAccountParsing, ValidateIntFieldMissing) { Contains(Pair("origin", "test"))); } -TEST(ExternalAccountParsing, ValidateIntFieldNotString) { +TEST(JsonParsingTest, ValidateIntFieldNotString) { auto const json = nlohmann::json{{"some-field", "value"}, {"wrongType", true}}; auto actual = ValidateIntField( @@ -137,7 +138,7 @@ TEST(ExternalAccountParsing, ValidateIntFieldNotString) { Contains(Pair("origin", "test"))); } -TEST(ExternalAccountParsing, ValidateIntFieldDefaultSuccess) { +TEST(JsonParsingTest, ValidateIntFieldDefaultSuccess) { auto const json = nlohmann::json{{"someField", 42}}; auto actual = ValidateIntField( json, "someField", "test-object", 42, @@ -146,7 +147,7 @@ TEST(ExternalAccountParsing, ValidateIntFieldDefaultSuccess) { EXPECT_EQ(*actual, 42); } -TEST(ExternalAccountParsing, ValidateIntFieldDefaultMissing) { +TEST(JsonParsingTest, ValidateIntFieldDefaultMissing) { auto const json = nlohmann::json{{"anotherField", "value"}}; auto actual = ValidateIntField( json, "someField", "test-object", 42, @@ -155,7 +156,7 @@ TEST(ExternalAccountParsing, ValidateIntFieldDefaultMissing) { EXPECT_EQ(*actual, 42); } -TEST(ExternalAccountParsing, ValidateIntFieldDefaultNotString) { +TEST(JsonParsingTest, ValidateIntFieldDefaultNotString) { auto const json = nlohmann::json{{"some-field", "value"}, {"wrongType", true}}; auto actual = ValidateIntField( @@ -170,6 +171,43 @@ TEST(ExternalAccountParsing, ValidateIntFieldDefaultNotString) { Contains(Pair("origin", "test"))); } +TEST(JsonParsingTest, ValidateStringArrayFieldSuccess) { + auto const json = nlohmann::json{{"someField", {"value1", "value2"}}}; + auto actual = ValidateStringArrayField( + json, "someField", "test-object", + internal::ErrorContext({{"origin", "test"}, {"filename", "/dev/null"}})); + ASSERT_STATUS_OK(actual); + EXPECT_THAT(*actual, ElementsAre("value1", "value2")); +} + +TEST(JsonParsingTest, ValidateStringArrayFieldMissing) { + auto const json = nlohmann::json{{"some-field", {"value1", "value2"}}}; + auto actual = ValidateStringArrayField( + json, "missingField", "test-object", + internal::ErrorContext({{"origin", "test"}, {"filename", "/dev/null"}})); + EXPECT_THAT(actual, StatusIs(StatusCode::kInvalidArgument, + AllOf(HasSubstr("missingField"), + HasSubstr("test-object")))); + EXPECT_THAT(actual.status().error_info().metadata(), + Contains(Pair("filename", "/dev/null"))); + EXPECT_THAT(actual.status().error_info().metadata(), + Contains(Pair("origin", "test"))); +} + +TEST(JsonParsingTest, ValidateStringArrayFieldNotString) { + auto const json = nlohmann::json({"wrongType", {"value1", true}}); + auto actual = ValidateStringArrayField( + json, "wrongType", "test-object", + internal::ErrorContext({{"origin", "test"}, {"filename", "/dev/null"}})); + EXPECT_THAT(actual, StatusIs(StatusCode::kInvalidArgument, + AllOf(HasSubstr("wrongType"), + HasSubstr("test-object")))); + EXPECT_THAT(actual.status().error_info().metadata(), + Contains(Pair("filename", "/dev/null"))); + EXPECT_THAT(actual.status().error_info().metadata(), + Contains(Pair("origin", "test"))); +} + } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oauth2_internal diff --git a/google/cloud/internal/oauth2_api_key_credentials.cc b/google/cloud/internal/oauth2_api_key_credentials.cc index 245a9a33ed08d..7e8b975cc9b29 100644 --- a/google/cloud/internal/oauth2_api_key_credentials.cc +++ b/google/cloud/internal/oauth2_api_key_credentials.cc @@ -27,9 +27,9 @@ StatusOr ApiKeyCredentials::GetToken( return AccessToken{std::string{}, tp}; } -StatusOr> -ApiKeyCredentials::AuthenticationHeader(std::chrono::system_clock::time_point) { - return std::make_pair(std::string{"x-goog-api-key"}, api_key_); +StatusOr ApiKeyCredentials::Authorization( + std::chrono::system_clock::time_point) { + return rest_internal::HttpHeader{"x-goog-api-key", api_key_}; } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/oauth2_api_key_credentials.h b/google/cloud/internal/oauth2_api_key_credentials.h index aec219a29cba0..16258d9e3d753 100644 --- a/google/cloud/internal/oauth2_api_key_credentials.h +++ b/google/cloud/internal/oauth2_api_key_credentials.h @@ -37,8 +37,8 @@ class ApiKeyCredentials : public oauth2_internal::Credentials { StatusOr GetToken( std::chrono::system_clock::time_point tp) override; - StatusOr> AuthenticationHeader( - std::chrono::system_clock::time_point) override; + StatusOr Authorization( + std::chrono::system_clock::time_point tp) override; private: std::string api_key_; diff --git a/google/cloud/internal/oauth2_api_key_credentials_test.cc b/google/cloud/internal/oauth2_api_key_credentials_test.cc index 12f51a2257b50..3aaaab21199ae 100644 --- a/google/cloud/internal/oauth2_api_key_credentials_test.cc +++ b/google/cloud/internal/oauth2_api_key_credentials_test.cc @@ -13,6 +13,7 @@ // limitations under the License. #include "google/cloud/internal/oauth2_api_key_credentials.h" +#include "google/cloud/internal/http_header.h" #include "google/cloud/testing_util/status_matchers.h" #include #include @@ -24,8 +25,8 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { using ::google::cloud::testing_util::IsOkAndHolds; +using ::testing::Contains; using ::testing::IsEmpty; -using ::testing::Pair; TEST(ApiKeyCredentials, EmptyToken) { ApiKeyCredentials creds("api-key"); @@ -38,8 +39,9 @@ TEST(ApiKeyCredentials, EmptyToken) { TEST(ApiKeyCredentials, SetsXGoogApiKeyHeader) { ApiKeyCredentials creds("api-key"); auto const now = std::chrono::system_clock::now(); - EXPECT_THAT(creds.AuthenticationHeader(now), - IsOkAndHolds(Pair("x-goog-api-key", "api-key"))); + EXPECT_THAT(creds.AuthenticationHeaders(now, ""), + IsOkAndHolds(Contains( + rest_internal::HttpHeader("x-goog-api-key", "api-key")))); } } // namespace diff --git a/google/cloud/internal/oauth2_cached_credentials.cc b/google/cloud/internal/oauth2_cached_credentials.cc index 8ae00341c43df..11d81c5fdf18f 100644 --- a/google/cloud/internal/oauth2_cached_credentials.cc +++ b/google/cloud/internal/oauth2_cached_credentials.cc @@ -83,6 +83,11 @@ StatusOr CachedCredentials::project_id( return impl_->project_id(options); } +Credentials::AllowedLocationsRequestType +CachedCredentials::AllowedLocationsRequest() const { + return impl_->AllowedLocationsRequest(); +} + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oauth2_internal } // namespace cloud diff --git a/google/cloud/internal/oauth2_cached_credentials.h b/google/cloud/internal/oauth2_cached_credentials.h index 9cd0bd528db96..ee8e18e9eb8ba 100644 --- a/google/cloud/internal/oauth2_cached_credentials.h +++ b/google/cloud/internal/oauth2_cached_credentials.h @@ -54,6 +54,8 @@ class CachedCredentials : public Credentials { StatusOr universe_domain(Options const& options) const override; StatusOr project_id() const override; StatusOr project_id(Options const& options) const override; + Credentials::AllowedLocationsRequestType AllowedLocationsRequest() + const override; private: std::shared_ptr impl_; diff --git a/google/cloud/internal/oauth2_compute_engine_credentials.cc b/google/cloud/internal/oauth2_compute_engine_credentials.cc index 4113e07fb3355..ac9cb5d2175f5 100644 --- a/google/cloud/internal/oauth2_compute_engine_credentials.cc +++ b/google/cloud/internal/oauth2_compute_engine_credentials.cc @@ -239,6 +239,16 @@ StatusOr ComputeEngineCredentials::project_id( return RetrieveProjectId(lk, options); } +Credentials::AllowedLocationsRequestType +ComputeEngineCredentials::AllowedLocationsRequest() const { + // TODO(#16079): Remove conditional and else clause when GA. +#ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB + return ServiceAccountAllowedLocationsRequest{AccountEmail()}; +#else + return std::monostate{}; +#endif +} + StatusOr ComputeEngineCredentials::RetrieveUniverseDomain( std::lock_guard const&, Options const& options) const { // Fetch the universe domain only once. diff --git a/google/cloud/internal/oauth2_compute_engine_credentials.h b/google/cloud/internal/oauth2_compute_engine_credentials.h index 9ead58012e4c9..add952892db64 100644 --- a/google/cloud/internal/oauth2_compute_engine_credentials.h +++ b/google/cloud/internal/oauth2_compute_engine_credentials.h @@ -118,6 +118,8 @@ class ComputeEngineCredentials : public Credentials { StatusOr project_id( google::cloud::Options const& options) const override; + AllowedLocationsRequestType AllowedLocationsRequest() const override; + /** * Returns the email or alias of this credential's service account. * diff --git a/google/cloud/internal/oauth2_compute_engine_credentials_test.cc b/google/cloud/internal/oauth2_compute_engine_credentials_test.cc index 7edb731392d14..d9c7042972280 100644 --- a/google/cloud/internal/oauth2_compute_engine_credentials_test.cc +++ b/google/cloud/internal/oauth2_compute_engine_credentials_test.cc @@ -53,6 +53,7 @@ using ::testing::Property; using ::testing::Return; using ::testing::UnorderedElementsAre; using ::testing::UnorderedElementsAreArray; +using ::testing::VariantWith; using MockHttpClientFactory = ::testing::MockFunction( @@ -387,6 +388,10 @@ TEST(ComputeEngineCredentialsTest, FailedRefresh) { HasSubstr("Could not find all required fields"))); } +MATCHER_P(RequestServiceAccountEmailIs, email, "has service account email") { + return email == arg.service_account_email; +} + /// @test Verify that we can force a refresh of the service account email. TEST(ComputeEngineCredentialsTest, AccountEmail) { auto const alias = std::string{"default"}; @@ -416,6 +421,15 @@ TEST(ComputeEngineCredentialsTest, AccountEmail) { auto refreshed_email = credentials.AccountEmail(); EXPECT_EQ(email, refreshed_email); EXPECT_EQ(credentials.service_account_email(), refreshed_email); + // TODO(#16079): Remove conditional and else clause when GA. +#ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB + EXPECT_THAT(credentials.AllowedLocationsRequest(), + VariantWith( + RequestServiceAccountEmailIs(email))); +#else + EXPECT_THAT(credentials.AllowedLocationsRequest(), + VariantWith(std::monostate())); +#endif } auto expected_universe_domain_request = []() { diff --git a/google/cloud/internal/oauth2_credentials.cc b/google/cloud/internal/oauth2_credentials.cc index b2f4d53c57d63..4f85f961640f5 100644 --- a/google/cloud/internal/oauth2_credentials.cc +++ b/google/cloud/internal/oauth2_credentials.cc @@ -22,6 +22,24 @@ namespace cloud { namespace oauth2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +StatusOr> +Credentials::AuthenticationHeaders(std::chrono::system_clock::time_point tp, + std::string_view endpoint) { + std::vector headers; + auto authorization = Authorization(tp); + if (!authorization) return std::move(authorization).status(); + if (!authorization->empty()) headers.push_back(*std::move(authorization)); + + auto allowed_locations = AllowedLocations(tp, endpoint); + // Not all credential types support the x-allowed-locations header. For + // those that do, if there is a problem retrieving the header, omit the + // header. + if (allowed_locations.ok() && !allowed_locations->empty()) { + headers.push_back(*std::move(allowed_locations)); + } + return headers; +} + StatusOr> Credentials::SignBlob( absl::optional const&, std::string const&) const { return internal::UnimplementedError( @@ -46,21 +64,18 @@ StatusOr Credentials::project_id( return project_id(); } -StatusOr> Credentials::AuthenticationHeader( +StatusOr Credentials::Authorization( std::chrono::system_clock::time_point tp) { auto token = GetToken(tp); if (!token) return std::move(token).status(); - if (token->token.empty()) return std::make_pair(std::string{}, std::string{}); - return std::make_pair(std::string{"Authorization"}, - absl::StrCat("Bearer ", token->token)); + if (token->token.empty()) return rest_internal::HttpHeader{}; + return rest_internal::HttpHeader{"authorization", + absl::StrCat("Bearer ", token->token)}; } -StatusOr AuthenticationHeaderJoined( - Credentials& credentials, std::chrono::system_clock::time_point tp) { - auto header = credentials.AuthenticationHeader(tp); - if (!header) return std::move(header).status(); - if (header->first.empty()) return std::string{}; - return absl::StrCat(header->first, ": ", header->second); +StatusOr Credentials::AllowedLocations( + std::chrono::system_clock::time_point, std::string_view) { + return {}; } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/oauth2_credentials.h b/google/cloud/internal/oauth2_credentials.h index 7c050f229370c..7b8ece8c00ed0 100644 --- a/google/cloud/internal/oauth2_credentials.h +++ b/google/cloud/internal/oauth2_credentials.h @@ -16,13 +16,13 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_OAUTH2_CREDENTIALS_H #include "google/cloud/access_token.h" +#include "google/cloud/internal/http_header.h" #include "google/cloud/options.h" -#include "google/cloud/status.h" #include "google/cloud/status_or.h" #include "google/cloud/version.h" #include -#include #include +#include #include namespace google { @@ -30,6 +30,19 @@ namespace cloud { namespace oauth2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +struct ServiceAccountAllowedLocationsRequest { + std::string service_account_email; +}; + +struct WorkloadIdentityAllowedLocationsRequest { + std::string project_id; + std::string pool_id; +}; + +struct WorkforceIdentityAllowedLocationsRequest { + std::string pool_id; +}; + /** * Interface for OAuth 2.0 credentials for use with Google's Unified Auth Client * (GUAC) library. Internally, GUAC credentials are mapped to the appropriate @@ -46,18 +59,32 @@ class Credentials { virtual ~Credentials() = default; /** - * Obtains an access token. + * Returns header pairs used for authentication. * - * Most implementations will cache the access token and (if possible) refresh - * the token before it expires. Refreshing the token may fail, as it often - * requires making HTTP requests. In that case, the last error is returned. + * This is the correct method to call for authentication headers for use in + * making an RPC to a GCP service. All the necessary headers are returned + * for whatever the combination of underlying Credential type and RPC + * endpoint. + * + * In most cases, this is the "Authorization" HTTP header. For API key + * credentials, it is the "X-Goog-Api-Key" header. It may also include the + * "x-allowed-locations" header if applicable. + * + * If unable to obtain a value for the header, which could happen for + * `Credentials` that need to be periodically refreshed, the underlying + * `Status` will indicate failure details from the refresh HTTP request. + * Otherwise, the returned value will contain the header pair to be used in + * HTTP requests. * * @param tp the current time, most callers should provide * `std::chrono::system_clock::now()`. In tests, other value may be * considered. + * + * @param endpoint the endpoint of the GCP service the RPC request will be + * sent to. */ - virtual StatusOr GetToken( - std::chrono::system_clock::time_point tp) = 0; + StatusOr> AuthenticationHeaders( + std::chrono::system_clock::time_point tp, std::string_view endpoint); /** * Try to sign @p string_to_sign using @p service_account. @@ -109,35 +136,58 @@ class Credentials { virtual StatusOr project_id(Options const&) const; /** - * Returns a header pair used for authentication. - * - * In most cases, this is the "Authorization" HTTP header. For API key - * credentials, it is the "X-Goog-Api-Key" header. + * Returns only the "authorization" header if applicable for the credential + * type. * - * If unable to obtain a value for the header, which could happen for - * `Credentials` that need to be periodically refreshed, the underlying - * `Status` will indicate failure details from the refresh HTTP request. - * Otherwise, the returned value will contain the header pair to be used in - * HTTP requests. + * @param tp the current time, most callers should provide + * `std::chrono::system_clock::now()`. In tests, other value may be + * considered. */ - virtual StatusOr> AuthenticationHeader( + virtual StatusOr Authorization( std::chrono::system_clock::time_point tp); -}; -/** - * Returns a header pair as a single string to be used for authentication. - * - * In most cases, this is the "Authorization" HTTP header. For API key - * credentials, it is the "X-Goog-Api-Key" header. - * - * If unable to obtain a value for the header, which could happen for - * `Credentials` that need to be periodically refreshed, the underlying `Status` - * will indicate failure details from the refresh HTTP request. Otherwise, the - * returned value will contain the header pair to be used in HTTP requests. - */ -StatusOr AuthenticationHeaderJoined( - Credentials& credentials, std::chrono::system_clock::time_point tp = - std::chrono::system_clock::now()); + /** + * Returns only the "x-allowed-locations" header if applicable for the + * credential type. + * + * @param tp the current time, most callers should provide + * `std::chrono::system_clock::now()`. In tests, other value may be + * considered. + * + * @param endpoint the endpoint of the GCP service the RPC request will be + * sent to. + */ + virtual StatusOr AllowedLocations( + std::chrono::system_clock::time_point tp, std::string_view endpoint); + + /** + * Obtains an access token. + * + * Most implementations will cache the access token and (if possible) refresh + * the token before it expires. Refreshing the token may fail, as it often + * requires making HTTP requests. In that case, the last error is returned. + * + * @param tp the current time, most callers should provide + * `std::chrono::system_clock::now()`. In tests, other value may be + * considered. + */ + virtual StatusOr GetToken( + std::chrono::system_clock::time_point tp) = 0; + + using AllowedLocationsRequestType = + std::variant; + /** + * Obtains the request type from the underlying credential, if supported. + * + * Not all credential types support the `x-allowed-locations` header, but + * those that do vary in the data needed to format the request to IAM. + */ + virtual AllowedLocationsRequestType AllowedLocationsRequest() const { + return std::monostate{}; + } +}; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oauth2_internal diff --git a/google/cloud/internal/oauth2_credentials_test.cc b/google/cloud/internal/oauth2_credentials_test.cc index 7bdadaac90fff..08f52e18727d6 100644 --- a/google/cloud/internal/oauth2_credentials_test.cc +++ b/google/cloud/internal/oauth2_credentials_test.cc @@ -26,15 +26,17 @@ namespace { using ::google::cloud::internal::UnavailableError; using ::google::cloud::testing_util::IsOk; using ::google::cloud::testing_util::IsOkAndHolds; -using ::testing::IsEmpty; +using ::testing::Contains; using ::testing::Not; -using ::testing::Pair; using ::testing::Return; class MockCredentials : public Credentials { public: MOCK_METHOD(StatusOr, GetToken, (std::chrono::system_clock::time_point), (override)); + MOCK_METHOD(StatusOr, AllowedLocations, + (std::chrono::system_clock::time_point, std::string_view), + (override)); }; TEST(Credentials, AuthorizationHeaderSuccess) { @@ -43,42 +45,30 @@ TEST(Credentials, AuthorizationHeaderSuccess) { auto const expiration = now + std::chrono::seconds(3600); EXPECT_CALL(mock, GetToken(now)) .WillOnce(Return(AccessToken{"test-token", expiration})); - auto actual = mock.AuthenticationHeader(now); - EXPECT_THAT(actual, IsOkAndHolds(Pair("Authorization", "Bearer test-token"))); -} - -TEST(Credentials, AuthenticationHeaderJoinedSuccess) { - MockCredentials mock; - auto const now = std::chrono::system_clock::now(); - auto const expiration = now + std::chrono::seconds(3600); - EXPECT_CALL(mock, GetToken(now)) - .WillOnce(Return(AccessToken{"test-token", expiration})); - auto actual = AuthenticationHeaderJoined(mock, now); - EXPECT_THAT(actual, IsOkAndHolds("Authorization: Bearer test-token")); -} - -TEST(Credentials, AuthenticationHeaderJoinedEmpty) { - MockCredentials mock; - auto const now = std::chrono::system_clock::now(); - auto const expiration = now + std::chrono::seconds(3600); - EXPECT_CALL(mock, GetToken(now)) - .WillOnce(Return(AccessToken{"", expiration})); - auto actual = AuthenticationHeaderJoined(mock, now); - EXPECT_THAT(actual, IsOkAndHolds(IsEmpty())); + EXPECT_CALL(mock, AllowedLocations) + .WillOnce(Return(rest_internal::HttpHeader{})); + auto actual = mock.AuthenticationHeaders(now, "my-endpoint"); + EXPECT_THAT(actual, IsOkAndHolds(Contains(rest_internal::HttpHeader( + "authorization", "Bearer test-token")))); } TEST(Credentials, AuthenticationHeaderError) { MockCredentials mock; EXPECT_CALL(mock, GetToken).WillOnce(Return(UnavailableError("try-again"))); - auto actual = mock.AuthenticationHeader(std::chrono::system_clock::now()); + auto actual = mock.AuthenticationHeaders(std::chrono::system_clock::now(), + "my-endpoint"); EXPECT_EQ(actual.status(), UnavailableError("try-again")); } -TEST(Credentials, AuthenticationHeaderJoinedError) { +TEST(Credentials, AuthenticationHeaderEmpty) { MockCredentials mock; - EXPECT_CALL(mock, GetToken).WillOnce(Return(UnavailableError("try-again"))); - auto actual = AuthenticationHeaderJoined(mock); - EXPECT_EQ(actual.status(), UnavailableError("try-again")); + EXPECT_CALL(mock, GetToken) + .WillOnce(Return(AccessToken{"", std::chrono::system_clock::now()})); + EXPECT_CALL(mock, AllowedLocations) + .WillOnce(Return(rest_internal::HttpHeader())); + auto actual = mock.AuthenticationHeaders(std::chrono::system_clock::now(), + "my-endpoint"); + EXPECT_THAT(actual, IsOkAndHolds(std::vector{})); } TEST(Credentials, ProjectId) { @@ -87,6 +77,41 @@ TEST(Credentials, ProjectId) { EXPECT_THAT(mock.project_id({}), Not(IsOk())); } +TEST(Credentials, AllowedLocationsSuccess) { + MockCredentials mock; + auto const now = std::chrono::system_clock::now(); + auto const expiration = now + std::chrono::seconds(3600); + EXPECT_CALL(mock, GetToken) + .WillOnce(Return(AccessToken{"test-token", expiration})); + EXPECT_CALL(mock, AllowedLocations) + .WillOnce(Return( + rest_internal::HttpHeader("x-allowed-locations", "my-location"))); + + auto auth_headers = mock.AuthenticationHeaders( + std::chrono::system_clock::now(), "my-endpoint"); + EXPECT_THAT( + auth_headers, + IsOkAndHolds(::testing::ElementsAre( + rest_internal::HttpHeader("authorization", "Bearer test-token"), + rest_internal::HttpHeader("x-allowed-locations", "my-location")))); +} + +TEST(Credentials, AllowedLocationsFailure) { + MockCredentials mock; + auto const now = std::chrono::system_clock::now(); + auto const expiration = now + std::chrono::seconds(3600); + EXPECT_CALL(mock, GetToken) + .WillOnce(Return(AccessToken{"test-token", expiration})); + EXPECT_CALL(mock, AllowedLocations) + .WillOnce(Return(internal::DeadlineExceededError("RPC took too long"))); + + auto auth_headers = mock.AuthenticationHeaders( + std::chrono::system_clock::now(), "my-endpoint"); + EXPECT_THAT(auth_headers, + IsOkAndHolds(::testing::ElementsAre(rest_internal::HttpHeader( + "authorization", "Bearer test-token")))); +} + } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oauth2_internal diff --git a/google/cloud/internal/oauth2_decorate_credentials.cc b/google/cloud/internal/oauth2_decorate_credentials.cc index d499a0737e04e..4df3206aec658 100644 --- a/google/cloud/internal/oauth2_decorate_credentials.cc +++ b/google/cloud/internal/oauth2_decorate_credentials.cc @@ -16,6 +16,7 @@ #include "google/cloud/common_options.h" #include "google/cloud/internal/oauth2_cached_credentials.h" #include "google/cloud/internal/oauth2_logging_credentials.h" +#include "google/cloud/internal/oauth2_regional_access_boundary_token_manager.h" namespace google { namespace cloud { @@ -23,10 +24,18 @@ namespace oauth2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN std::shared_ptr Decorate( - std::shared_ptr impl, Options const& opts) { + std::shared_ptr impl, + HttpClientFactory client_factory, Options const& opts) { impl = WithLogging(std::move(impl), opts, "refresh"); impl = WithCaching(std::move(impl)); - return WithLogging(std::move(impl), opts, "cached"); + impl = WithLogging(std::move(impl), opts, "cached"); + if (!std::holds_alternative( + impl->AllowedLocationsRequest())) { + impl = WithRegionalAccessBoundary(std::move(impl), + std::move(client_factory), opts); + impl = WithLogging(std::move(impl), opts, "rab"); + } + return impl; } std::shared_ptr WithLogging( @@ -42,6 +51,13 @@ std::shared_ptr WithCaching( return std::make_shared(std::move(impl)); } +std::shared_ptr WithRegionalAccessBoundary( + std::shared_ptr impl, + HttpClientFactory client_factory, Options options) { + return RegionalAccessBoundaryTokenManager::Create( + std::move(impl), std::move(client_factory), std::move(options)); +} + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oauth2_internal } // namespace cloud diff --git a/google/cloud/internal/oauth2_decorate_credentials.h b/google/cloud/internal/oauth2_decorate_credentials.h index 8863898f0044b..a0c27da4ecd98 100644 --- a/google/cloud/internal/oauth2_decorate_credentials.h +++ b/google/cloud/internal/oauth2_decorate_credentials.h @@ -16,6 +16,7 @@ #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_OAUTH2_DECORATE_CREDENTIALS_H #include "google/cloud/internal/oauth2_credentials.h" +#include "google/cloud/internal/oauth2_http_client_factory.h" #include "google/cloud/options.h" #include "google/cloud/version.h" #include @@ -29,7 +30,8 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN /// Add a full stack of logging (if requested in @p opts) and caching decorators /// to the credentials. std::shared_ptr Decorate( - std::shared_ptr impl, Options const& opts); + std::shared_ptr impl, + HttpClientFactory client_factory, Options const& opts); /// Add only a logging decorator to the credentials if requested in @p opts std::shared_ptr WithLogging( @@ -40,6 +42,11 @@ std::shared_ptr WithLogging( std::shared_ptr WithCaching( std::shared_ptr impl); +/// Add regional access boundary decorator to the credentials. +std::shared_ptr WithRegionalAccessBoundary( + std::shared_ptr impl, + HttpClientFactory client_factory, Options options); + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oauth2_internal } // namespace cloud diff --git a/google/cloud/internal/oauth2_external_account_credentials.cc b/google/cloud/internal/oauth2_external_account_credentials.cc index a9ab92ff1459a..c162b1d398719 100644 --- a/google/cloud/internal/oauth2_external_account_credentials.cc +++ b/google/cloud/internal/oauth2_external_account_credentials.cc @@ -25,6 +25,7 @@ #include "google/cloud/internal/rest_client.h" #include "absl/strings/str_cat.h" #include +#include namespace google { namespace cloud { @@ -49,8 +50,41 @@ StatusOr MakeExternalAccountTokenSource( GCP_ERROR_INFO().WithContext(ec)); } +std::variant +IdentityFederationFromAudience(std::string const& audience) { + auto constexpr kWorkloadPattern = + R"""(iam.googleapis.com/projects/([^/]+)/locations/global/workloadIdentityPools/([^/]+)/)"""; + static auto* workload_re = + new std::regex{kWorkloadPattern, std::regex::optimize}; + + auto constexpr kWorkforcePattern = + R"""(iam.googleapis.com/locations/global/workforcePools/([^/]+)/)"""; + static auto* workforce_re = + new std::regex{kWorkforcePattern, std::regex::optimize}; + + std::smatch match; + if (std::regex_search(audience, match, *workload_re)) { + return WorkloadIdentityFederationInfo{match[1], match[2]}; + } + if (std::regex_search(audience, match, *workforce_re)) { + return WorkforceIdentityFederationInfo{match[1]}; + } + return std::monostate{}; +} + } // namespace +bool ExternalAccountInfo::IsWorkforceIdentityFederation() const { + return std::holds_alternative( + identity_federation_info); +} + +bool ExternalAccountInfo::IsWorkloadIdentityFederation() const { + return std::holds_alternative( + identity_federation_info); +} + /// Parse a JSON string with an external account configuration. StatusOr ParseExternalAccountConfiguration( std::string const& configuration, internal::ErrorContext const& ec) { @@ -70,6 +104,8 @@ StatusOr ParseExternalAccountConfiguration( auto audience = ValidateStringField(json, "audience", "credentials-file", ec); if (!audience) return std::move(audience).status(); + auto identity_federation = IdentityFederationFromAudience(*audience); + auto subject_token_type = ValidateStringField(json, "subject_token_type", "credentials-file", ec); if (!subject_token_type) return std::move(subject_token_type).status(); @@ -108,7 +144,8 @@ StatusOr ParseExternalAccountConfiguration( *std::move(source), absl::nullopt, *std::move(universe_domain), - std::move(workforce_pool_user_project)}; + std::move(workforce_pool_user_project), + std::move(identity_federation)}; it = json.find("service_account_impersonation_url"); if (it == json.end()) return info; @@ -161,7 +198,8 @@ StatusOr ExternalAccountCredentials::GetToken( // Workforce Identity is handled at the org level and requires the userProject // header. Workload Identity is handled at the project level and doesn't // require the header. - if (info_.workforce_pool_user_project) { + if (info_.IsWorkforceIdentityFederation() && + info_.workforce_pool_user_project.has_value()) { form_data.emplace_back( "options", absl::StrCat(R"({"userProject": ")", *info_.workforce_pool_user_project, R"("})")); @@ -221,6 +259,25 @@ StatusOr ExternalAccountCredentials::GetToken( return AccessToken{*token, tp + std::chrono::seconds(*expires_in)}; } +Credentials::AllowedLocationsRequestType +ExternalAccountCredentials::AllowedLocationsRequest() const { + Credentials::AllowedLocationsRequestType request = std::monostate{}; + // TODO(#16079): Remove conditional and else clause when GA. +#ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB + if (info_.IsWorkforceIdentityFederation()) { + auto wif = std::get( + info_.identity_federation_info); + request = WorkforceIdentityAllowedLocationsRequest{wif.pool_id}; + } else if (info_.IsWorkloadIdentityFederation()) { + auto wif = std::get( + info_.identity_federation_info); + request = + WorkloadIdentityAllowedLocationsRequest{wif.project_id, wif.pool_id}; + } +#endif + return request; +} + StatusOr ExternalAccountCredentials::GetTokenImpersonation( std::string const& access_token, internal::ErrorContext const& ec) { auto request = rest_internal::RestRequest(info_.impersonation_config->url); diff --git a/google/cloud/internal/oauth2_external_account_credentials.h b/google/cloud/internal/oauth2_external_account_credentials.h index efd9c425f800c..c4f46d30a30d5 100644 --- a/google/cloud/internal/oauth2_external_account_credentials.h +++ b/google/cloud/internal/oauth2_external_account_credentials.h @@ -55,6 +55,15 @@ struct ExternalAccountImpersonationConfig { std::chrono::seconds token_lifetime; }; +struct WorkforceIdentityFederationInfo { + std::string pool_id; +}; + +struct WorkloadIdentityFederationInfo { + std::string project_id; + std::string pool_id; +}; + /** * An external account configuration. * @@ -69,6 +78,11 @@ struct ExternalAccountInfo { absl::optional impersonation_config; std::string universe_domain; absl::optional workforce_pool_user_project; + std::variant + identity_federation_info; + bool IsWorkforceIdentityFederation() const; + bool IsWorkloadIdentityFederation() const; }; /// Parse a JSON string with an external account configuration. @@ -89,6 +103,8 @@ class ExternalAccountCredentials : public oauth2_internal::Credentials { return info_.universe_domain; } + AllowedLocationsRequestType AllowedLocationsRequest() const override; + private: StatusOr GetTokenImpersonation(std::string const& access_token, internal::ErrorContext const& ec); diff --git a/google/cloud/internal/oauth2_external_account_credentials_test.cc b/google/cloud/internal/oauth2_external_account_credentials_test.cc index d28a262df96b4..4bb47dc7701c2 100644 --- a/google/cloud/internal/oauth2_external_account_credentials_test.cc +++ b/google/cloud/internal/oauth2_external_account_credentials_test.cc @@ -54,6 +54,7 @@ using ::testing::Property; using ::testing::ResultOf; using ::testing::Return; using ::testing::UnorderedElementsAre; +using ::testing::VariantWith; using MockClientFactory = ::testing::MockFunction( @@ -135,6 +136,15 @@ struct TestOnlyOption { using Type = std::string; }; +MATCHER_P(WorkforceIdentityIs, pool_id, "has pool_id") { + return pool_id == arg.pool_id; +} + +MATCHER_P2(WorkloadIdentityIs, project_id, pool_id, + "has project_id and pool_id") { + return project_id == arg.project_id && pool_id == arg.pool_id; +} + TEST(ExternalAccount, ParseAwsSuccess) { // To simplify the test we provide all the parameters via environment // variables and avoid using imdsv2. @@ -180,6 +190,9 @@ TEST(ExternalAccount, ParseAwsSuccess) { EXPECT_EQ(actual->subject_token_type, kTestTokenType); EXPECT_EQ(actual->token_url, "test-token-url"); EXPECT_EQ(actual->universe_domain, kUniverseDomain); + EXPECT_THAT(actual->identity_federation_info, + VariantWith( + WorkloadIdentityIs("$PROJECT_NUMBER", "$POOL_ID"))); MockClientFactory client_factory; EXPECT_CALL(client_factory, Call).Times(0); @@ -305,10 +318,13 @@ TEST(ExternalAccount, ParseWithImpersonationDefaultLifetimeSuccess) { std::chrono::seconds(3600)); } -TEST(ExternalAccount, ParseUserProjectSuccess) { +TEST(ExternalAccount, ParseWorkforceIdentityFederationSuccess) { + auto constexpr kWorkforceAudience = + "//iam.googleapis.com/locations/global/workforcePools/$POOL_ID/providers/" + "PROVIDER_ID"; auto const configuration = nlohmann::json{ {"type", "external_account"}, - {"audience", "test-audience"}, + {"audience", kWorkforceAudience}, {"subject_token_type", "test-subject-token-type"}, {"token_url", "test-token-url"}, {"credential_source", nlohmann::json{{"file", "/dev/null-test-only"}}}, @@ -319,11 +335,14 @@ TEST(ExternalAccount, ParseUserProjectSuccess) { auto const actual = ParseExternalAccountConfiguration(configuration.dump(), ec); ASSERT_STATUS_OK(actual); - EXPECT_EQ(actual->audience, "test-audience"); + EXPECT_EQ(actual->audience, kWorkforceAudience); EXPECT_EQ(actual->subject_token_type, "test-subject-token-type"); EXPECT_EQ(actual->token_url, "test-token-url"); EXPECT_THAT(actual->workforce_pool_user_project, Optional(std::string("project-id-or-name"))); + EXPECT_THAT(actual->identity_federation_info, + VariantWith( + WorkforceIdentityIs("$POOL_ID"))); } TEST(ExternalAccount, ParseNotJson) { @@ -676,11 +695,20 @@ TEST(ExternalAccount, Working) { auto mock_source = [](HttpClientFactory const&, Options const&) { return make_status_or(internal::SubjectToken{"test-subject-token"}); }; - auto const info = - ExternalAccountInfo{"test-audience", "test-subject-token-type", - test_url, mock_source, - absl::nullopt, {}, - absl::nullopt}; + + auto constexpr kTestAudience = + "//iam.googleapis.com/projects/$PROJECT_NUMBER/locations/global/" + "workloadIdentityPools/$POOL_ID/providers/$PROVIDER_ID"; + + auto const info = ExternalAccountInfo{ + kTestAudience, + "test-subject-token-type", + test_url, + mock_source, + absl::nullopt, + {}, + absl::nullopt, + WorkloadIdentityFederationInfo{"$PROJECT_NUMBER", "$POOL_ID"}}; MockClientFactory client_factory; EXPECT_CALL(client_factory, Call(make_expected_options())).WillOnce([&]() { @@ -693,7 +721,7 @@ TEST(ExternalAccount, Working) { Pair("requested_token_type", "urn:ietf:params:oauth:token-type:access_token"), Pair("scope", "https://www.googleapis.com/auth/cloud-platform"), - Pair("audience", "test-audience"), + Pair("audience", kTestAudience), Pair("subject_token_type", "test-subject-token-type"), Pair("subject_token", "test-subject-token"))); EXPECT_CALL(*mock, Post(_, expected_request, expected_payload)) @@ -710,6 +738,15 @@ TEST(ExternalAccount, Working) { ASSERT_STATUS_OK(access_token); EXPECT_EQ(access_token->expiration, now + expected_expires_in); EXPECT_EQ(access_token->token, expected_access_token); + // TODO(#16079): Remove conditional and else clause when GA. +#ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB + EXPECT_THAT(credentials.AllowedLocationsRequest(), + VariantWith( + WorkloadIdentityIs("$PROJECT_NUMBER", "$POOL_ID"))); +#else + EXPECT_THAT(credentials.AllowedLocationsRequest(), + VariantWith(std::monostate{})); +#endif } TEST(ExternalAccount, WorkingWorkforceIdentity) { @@ -725,13 +762,15 @@ TEST(ExternalAccount, WorkingWorkforceIdentity) { auto mock_source = [](HttpClientFactory const&, Options const&) { return make_status_or(internal::SubjectToken{"test-subject-token"}); }; - auto const info = ExternalAccountInfo{"test-audience", - "test-subject-token-type", - test_url, - mock_source, - absl::nullopt, - {}, - "project-id-or-name"}; + auto const info = + ExternalAccountInfo{"test-audience", + "test-subject-token-type", + test_url, + mock_source, + absl::nullopt, + {}, + "project-id-or-name", + WorkforceIdentityFederationInfo{"$POOL_ID"}}; MockClientFactory client_factory; EXPECT_CALL(client_factory, Call(make_expected_options())).WillOnce([&]() { @@ -762,6 +801,15 @@ TEST(ExternalAccount, WorkingWorkforceIdentity) { ASSERT_STATUS_OK(access_token); EXPECT_EQ(access_token->expiration, now + expected_expires_in); EXPECT_EQ(access_token->token, expected_access_token); + // TODO(#16079): Remove conditional and else clause when GA. +#ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB + EXPECT_THAT(credentials.AllowedLocationsRequest(), + VariantWith( + WorkforceIdentityIs("$POOL_ID"))); +#else + EXPECT_THAT(credentials.AllowedLocationsRequest(), + VariantWith(std::monostate{})); +#endif } TEST(ExternalAccount, WorkingWithImpersonation) { @@ -803,7 +851,8 @@ TEST(ExternalAccount, WorkingWithImpersonation) { ExternalAccountImpersonationConfig{ impersonate_test_url, impersonate_test_lifetime}, {}, - absl::nullopt}; + absl::nullopt, + std::monostate{}}; auto sts_client = [&] { auto expected_sts_request = Property(&RestRequest::path, sts_test_url); @@ -875,7 +924,7 @@ TEST(ExternalAccount, HandleHttpError) { ExternalAccountInfo{"test-audience", "test-subject-token-type", test_url, mock_source, absl::nullopt, {}, - absl::nullopt}; + absl::nullopt, std::monostate{}}; MockClientFactory client_factory; EXPECT_CALL(client_factory, Call).WillOnce([&]() { auto mock = std::make_unique(); @@ -914,7 +963,7 @@ TEST(ExternalAccount, HandleHttpPartialError) { ExternalAccountInfo{"test-audience", "test-subject-token-type", test_url, mock_source, absl::nullopt, {}, - absl::nullopt}; + absl::nullopt, std::monostate{}}; MockClientFactory client_factory; EXPECT_CALL(client_factory, Call).WillOnce([&]() { auto mock = std::make_unique(); @@ -954,7 +1003,7 @@ TEST(ExternalAccount, HandleNotJson) { ExternalAccountInfo{"test-audience", "test-subject-token-type", test_url, mock_source, absl::nullopt, {}, - absl::nullopt}; + absl::nullopt, std::monostate{}}; MockClientFactory client_factory; EXPECT_CALL(client_factory, Call).WillOnce([&]() { auto mock = std::make_unique(); @@ -994,7 +1043,7 @@ TEST(ExternalAccount, HandleNotJsonObject) { ExternalAccountInfo{"test-audience", "test-subject-token-type", test_url, mock_source, absl::nullopt, {}, - absl::nullopt}; + absl::nullopt, std::monostate{}}; MockClientFactory client_factory; EXPECT_CALL(client_factory, Call).WillOnce([&]() { auto mock = std::make_unique(); @@ -1040,7 +1089,7 @@ TEST(ExternalAccount, MissingToken) { ExternalAccountInfo{"test-audience", "test-subject-token-type", test_url, mock_source, absl::nullopt, {}, - absl::nullopt}; + absl::nullopt, std::monostate{}}; MockClientFactory client_factory; EXPECT_CALL(client_factory, Call).WillOnce([&]() { auto mock = std::make_unique(); @@ -1075,7 +1124,7 @@ TEST(ExternalAccount, MissingIssuedTokenType) { ExternalAccountInfo{"test-audience", "test-subject-token-type", test_url, mock_source, absl::nullopt, {}, - absl::nullopt}; + absl::nullopt, std::monostate{}}; MockClientFactory client_factory; EXPECT_CALL(client_factory, Call).WillOnce([&]() { auto mock = std::make_unique(); @@ -1110,7 +1159,7 @@ TEST(ExternalAccount, MissingTokenType) { ExternalAccountInfo{"test-audience", "test-subject-token-type", test_url, mock_source, absl::nullopt, {}, - absl::nullopt}; + absl::nullopt, std::monostate{}}; MockClientFactory client_factory; EXPECT_CALL(client_factory, Call).WillOnce([&]() { auto mock = std::make_unique(); @@ -1145,7 +1194,7 @@ TEST(ExternalAccount, InvalidIssuedTokenType) { ExternalAccountInfo{"test-audience", "test-subject-token-type", test_url, mock_source, absl::nullopt, {}, - absl::nullopt}; + absl::nullopt, std::monostate{}}; MockClientFactory client_factory; EXPECT_CALL(client_factory, Call).WillOnce([&]() { auto mock = std::make_unique(); @@ -1182,7 +1231,7 @@ TEST(ExternalAccount, InvalidTokenType) { ExternalAccountInfo{"test-audience", "test-subject-token-type", test_url, mock_source, absl::nullopt, {}, - absl::nullopt}; + absl::nullopt, std::monostate{}}; MockClientFactory client_factory; EXPECT_CALL(client_factory, Call).WillOnce([&]() { auto mock = std::make_unique(); @@ -1220,7 +1269,7 @@ TEST(ExternalAccount, MissingExpiresIn) { ExternalAccountInfo{"test-audience", "test-subject-token-type", test_url, mock_source, absl::nullopt, {}, - absl::nullopt}; + absl::nullopt, std::monostate{}}; MockClientFactory client_factory; EXPECT_CALL(client_factory, Call).WillOnce([&]() { auto mock = std::make_unique(); @@ -1256,7 +1305,7 @@ TEST(ExternalAccount, InvalidExpiresIn) { ExternalAccountInfo{"test-audience", "test-subject-token-type", test_url, mock_source, absl::nullopt, {}, - absl::nullopt}; + absl::nullopt, std::monostate{}}; MockClientFactory client_factory; EXPECT_CALL(client_factory, Call).WillOnce([&]() { auto mock = std::make_unique(); diff --git a/google/cloud/internal/oauth2_impersonate_service_account_credentials.cc b/google/cloud/internal/oauth2_impersonate_service_account_credentials.cc index a2da884ed20bc..ee1bc933f00ac 100644 --- a/google/cloud/internal/oauth2_impersonate_service_account_credentials.cc +++ b/google/cloud/internal/oauth2_impersonate_service_account_credentials.cc @@ -146,11 +146,23 @@ ImpersonateServiceAccountCredentials::ImpersonateServiceAccountCredentials( ImpersonateServiceAccountCredentials::ImpersonateServiceAccountCredentials( google::cloud::internal::ImpersonateServiceAccountConfig const& config, std::shared_ptr stub) - : stub_(std::move(stub)), request_(MakeRequest(config)) {} + : stub_(std::move(stub)), + access_token_request_(MakeRequest(config)), + allowed_locations_request_({config.target_service_account()}) {} StatusOr ImpersonateServiceAccountCredentials::GetToken( std::chrono::system_clock::time_point /*tp*/) { - return stub_->GenerateAccessToken(request_); + return stub_->GenerateAccessToken(access_token_request_); +} + +Credentials::AllowedLocationsRequestType +ImpersonateServiceAccountCredentials::AllowedLocationsRequest() const { + // TODO(#16079): Remove conditional and else clause when GA. +#ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB + return allowed_locations_request_; +#else + return std::monostate{}; +#endif } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/oauth2_impersonate_service_account_credentials.h b/google/cloud/internal/oauth2_impersonate_service_account_credentials.h index cdd9d82607fb6..c5d656ef7c589 100644 --- a/google/cloud/internal/oauth2_impersonate_service_account_credentials.h +++ b/google/cloud/internal/oauth2_impersonate_service_account_credentials.h @@ -66,9 +66,12 @@ class ImpersonateServiceAccountCredentials return stub_->universe_domain(options); } + AllowedLocationsRequestType AllowedLocationsRequest() const override; + private: std::shared_ptr stub_; - GenerateAccessTokenRequest request_; + GenerateAccessTokenRequest access_token_request_; + ServiceAccountAllowedLocationsRequest allowed_locations_request_; }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/oauth2_impersonate_service_account_credentials_test.cc b/google/cloud/internal/oauth2_impersonate_service_account_credentials_test.cc index 5747814b5147e..9a54e4c7c4ae7 100644 --- a/google/cloud/internal/oauth2_impersonate_service_account_credentials_test.cc +++ b/google/cloud/internal/oauth2_impersonate_service_account_credentials_test.cc @@ -36,6 +36,7 @@ using ::testing::ElementsAre; using ::testing::HasSubstr; using ::testing::Optional; using ::testing::Return; +using ::testing::VariantWith; auto constexpr kFullValidConfig = R"""({ "service_account_impersonation_url": "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/sa3@developer.gserviceaccount.com:generateAccessToken", @@ -155,10 +156,20 @@ class MockMinimalIamCredentialsRest : public MinimalIamCredentialsRest { public: MOCK_METHOD(StatusOr, GenerateAccessToken, (GenerateAccessTokenRequest const&), (override)); + MOCK_METHOD(StatusOr, AllowedLocations, + (ServiceAccountAllowedLocationsRequest const&), (override)); + MOCK_METHOD(StatusOr, AllowedLocations, + (WorkloadIdentityAllowedLocationsRequest const&), (override)); + MOCK_METHOD(StatusOr, AllowedLocations, + (WorkforceIdentityAllowedLocationsRequest const&), (override)); MOCK_METHOD(StatusOr, universe_domain, (Options const& options), (override, const)); }; +MATCHER_P(RequestServiceAccountEmailIs, email, "has service account email") { + return email == arg.service_account_email; +} + TEST(ImpersonateServiceAccountCredentialsTest, Basic) { auto const now = std::chrono::system_clock::now(); @@ -187,6 +198,16 @@ TEST(ImpersonateServiceAccountCredentialsTest, Basic) { token = under_test.GetToken(now + minutes(45)); ASSERT_THAT(token, StatusIs(StatusCode::kPermissionDenied)); + // TODO(#16079): Remove conditional and else clause when GA. +#ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB + EXPECT_THAT( + under_test.AllowedLocationsRequest(), + VariantWith( + RequestServiceAccountEmailIs("test-only-invalid@test.invalid"))); +#else + EXPECT_THAT(under_test.AllowedLocationsRequest(), + VariantWith(std::monostate())); +#endif } TEST(ParseImpersonatedServiceAccountCredentialsWithoutAction, Success) { diff --git a/google/cloud/internal/oauth2_logging_credentials.cc b/google/cloud/internal/oauth2_logging_credentials.cc index f88b1efc89c73..8d62adb6a0fc8 100644 --- a/google/cloud/internal/oauth2_logging_credentials.cc +++ b/google/cloud/internal/oauth2_logging_credentials.cc @@ -96,6 +96,12 @@ StatusOr LoggingCredentials::project_id( return impl_->project_id(options); } +Credentials::AllowedLocationsRequestType +LoggingCredentials::AllowedLocationsRequest() const { + GCP_LOG(DEBUG) << __func__ << "(" << phase_ << ")"; + return impl_->AllowedLocationsRequest(); +} + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oauth2_internal } // namespace cloud diff --git a/google/cloud/internal/oauth2_logging_credentials.h b/google/cloud/internal/oauth2_logging_credentials.h index 259f8baf03ffa..076a6bb6b881f 100644 --- a/google/cloud/internal/oauth2_logging_credentials.h +++ b/google/cloud/internal/oauth2_logging_credentials.h @@ -58,6 +58,8 @@ class LoggingCredentials : public Credentials { StatusOr universe_domain(Options const& options) const override; StatusOr project_id() const override; StatusOr project_id(Options const& options) const override; + Credentials::AllowedLocationsRequestType AllowedLocationsRequest() + const override; private: std::string phase_; diff --git a/google/cloud/internal/oauth2_minimal_iam_credentials_rest.cc b/google/cloud/internal/oauth2_minimal_iam_credentials_rest.cc index 46dd95d2d0fa2..9cea2ea5e0d8b 100644 --- a/google/cloud/internal/oauth2_minimal_iam_credentials_rest.cc +++ b/google/cloud/internal/oauth2_minimal_iam_credentials_rest.cc @@ -16,6 +16,7 @@ #include "google/cloud/common_options.h" #include "google/cloud/internal/api_client_header.h" #include "google/cloud/internal/format_time_point.h" +#include "google/cloud/internal/http_header.h" #include "google/cloud/internal/json_parsing.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/oauth2_credentials.h" @@ -32,6 +33,15 @@ namespace google { namespace cloud { namespace oauth2_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { + +std::string IamCredentialsEndpoint( + StatusOr const& universe_domain) { + return absl::StrCat("https://iamcredentials.", + universe_domain ? *universe_domain : "googleapis.com"); +} + +} // namespace using ::google::cloud::internal::InvalidArgumentError; @@ -45,12 +55,11 @@ MinimalIamCredentialsRestStub::MinimalIamCredentialsRestStub( StatusOr MinimalIamCredentialsRestStub::GenerateAccessToken( GenerateAccessTokenRequest const& request) { - auto auth_header = - credentials_->AuthenticationHeader(std::chrono::system_clock::now()); - if (!auth_header) return std::move(auth_header).status(); - + auto authorization_header = + credentials_->Authorization(std::chrono::system_clock::now()); + if (!authorization_header) return std::move(authorization_header).status(); rest_internal::RestRequest rest_request; - rest_request.AddHeader(auth_header.value()); + rest_request.AddHeader(*std::move(authorization_header)); rest_request.AddHeader("Content-Type", "application/json"); rest_request.SetPath(MakeRequestPath(request)); nlohmann::json payload{ @@ -73,12 +82,60 @@ MinimalIamCredentialsRestStub::GenerateAccessToken( std::string MinimalIamCredentialsRestStub::MakeRequestPath( GenerateAccessTokenRequest const& request) const { - auto ud = universe_domain(Options{}); - return absl::StrCat("https://iamcredentials.", ud ? *ud : "googleapis.com", + return absl::StrCat(IamCredentialsEndpoint(universe_domain(Options{})), "/v1/projects/-/serviceAccounts/", request.service_account, ":generateAccessToken"); } +StatusOr +MinimalIamCredentialsRestStub::AllowedLocationsHelper(std::string path) { + auto authorization_header = + credentials_->Authorization(std::chrono::system_clock::now()); + if (!authorization_header) return std::move(authorization_header).status(); + rest_internal::RestRequest rest_request; + rest_request.AddHeader(*std::move(authorization_header)); + rest_request.SetPath(std::move(path)); + + auto client = client_factory_(options_); + rest_internal::RestContext context; + auto response = client->Get(context, rest_request); + if (!response) return std::move(response).status(); + return ParseAllowedLocationsResponse( + **response, + internal::ErrorContext( + {{"gcloud-cpp.root.class", "MinimalIamCredentialsRestStub"}, + {"gcloud-cpp.root.function", __func__}, + {"path", rest_request.path()}})); +} + +StatusOr +MinimalIamCredentialsRestStub::AllowedLocations( + ServiceAccountAllowedLocationsRequest const& request) { + auto path = absl::StrCat(IamCredentialsEndpoint(universe_domain(Options{})), + "/v1/projects/-/serviceAccounts/", + request.service_account_email, "/allowedLocations"); + return AllowedLocationsHelper(std::move(path)); +} + +StatusOr +MinimalIamCredentialsRestStub::AllowedLocations( + WorkloadIdentityAllowedLocationsRequest const& request) { + auto path = absl::StrCat(IamCredentialsEndpoint(universe_domain(Options{})), + "/v1/projects/", request.project_id, + "/locations/global/workloadIdentityPools/", + request.pool_id, "/allowedLocations"); + return AllowedLocationsHelper(std::move(path)); +} + +StatusOr +MinimalIamCredentialsRestStub::AllowedLocations( + WorkforceIdentityAllowedLocationsRequest const& request) { + auto path = absl::StrCat(IamCredentialsEndpoint(universe_domain(Options{})), + "/v1/locations/global/workforcePools/", + request.pool_id, "/allowedLocations"); + return AllowedLocationsHelper(std::move(path)); +} + MinimalIamCredentialsRestLogging::MinimalIamCredentialsRestLogging( std::shared_ptr child) : child_(std::move(child)) {} @@ -104,6 +161,53 @@ MinimalIamCredentialsRestLogging::GenerateAccessToken( return response; } +StatusOr +MinimalIamCredentialsRestLogging::AllowedLocations( + ServiceAccountAllowedLocationsRequest const& request) { + GCP_LOG(INFO) << __func__ << "() << {service_account_email=" + << request.service_account_email << "}"; + auto response = child_->AllowedLocations(request); + if (!response) { + GCP_LOG(INFO) << __func__ << "() >> status={" << response.status() << "}"; + return response; + } + GCP_LOG(INFO) << __func__ << "() >> response={locations=" + << absl::StrJoin(response->locations, ",") + << ", encoded_locations=" << response->encoded_locations << "}"; + return response; +} + +StatusOr +MinimalIamCredentialsRestLogging::AllowedLocations( + WorkloadIdentityAllowedLocationsRequest const& request) { + GCP_LOG(INFO) << __func__ << "() << {project_id=" << request.project_id + << ", pool_id=" << request.pool_id << "}"; + auto response = child_->AllowedLocations(request); + if (!response) { + GCP_LOG(INFO) << __func__ << "() >> status={" << response.status() << "}"; + return response; + } + GCP_LOG(INFO) << __func__ << "() >> response={locations=" + << absl::StrJoin(response->locations, ",") + << ", encoded_locations=" << response->encoded_locations << "}"; + return response; +} + +StatusOr +MinimalIamCredentialsRestLogging::AllowedLocations( + WorkforceIdentityAllowedLocationsRequest const& request) { + GCP_LOG(INFO) << __func__ << "() << {pool_id=" << request.pool_id << "}"; + auto response = child_->AllowedLocations(request); + if (!response) { + GCP_LOG(INFO) << __func__ << "() >> status={" << response.status() << "}"; + return response; + } + GCP_LOG(INFO) << __func__ << "() >> response={locations=" + << absl::StrJoin(response->locations, ",") + << ", encoded_locations=" << response->encoded_locations << "}"; + return response; +} + StatusOr ParseGenerateAccessTokenResponse( rest_internal::RestResponse& response, google::cloud::internal::ErrorContext const& ec) { @@ -132,6 +236,29 @@ StatusOr ParseGenerateAccessTokenResponse( return google::cloud::AccessToken{*std::move(token), *expire_time}; } +StatusOr ParseAllowedLocationsResponse( + rest_internal::RestResponse& response, + google::cloud::internal::ErrorContext const& ec) { + if (IsHttpError(response)) return AsStatus(std::move(response)); + auto response_payload = + rest_internal::ReadAll(std::move(response).ExtractPayload()); + if (!response_payload) return std::move(response_payload).status(); + auto parsed = nlohmann::json::parse(*response_payload, nullptr, false); + if (!parsed.is_object()) { + return InvalidArgumentError("cannot parse response as a JSON object", + GCP_ERROR_INFO().WithContext(ec)); + } + auto locations = ValidateStringArrayField(parsed, "locations", + "AllowedLocations() response", ec); + if (!locations) return std::move(locations).status(); + + auto encoded_locations = ValidateStringField( + parsed, "encodedLocations", "AllowedLocations() response", ec); + if (!encoded_locations) return std::move(encoded_locations).status(); + return AllowedLocationsResponse{*std::move(locations), + *std::move(encoded_locations)}; +} + std::shared_ptr MakeMinimalIamCredentialsRestStub( std::shared_ptr credentials, Options options, HttpClientFactory client_factory) { diff --git a/google/cloud/internal/oauth2_minimal_iam_credentials_rest.h b/google/cloud/internal/oauth2_minimal_iam_credentials_rest.h index 0c1a8e241c5f9..95593624b618c 100644 --- a/google/cloud/internal/oauth2_minimal_iam_credentials_rest.h +++ b/google/cloud/internal/oauth2_minimal_iam_credentials_rest.h @@ -39,11 +39,20 @@ struct GenerateAccessTokenRequest { std::vector delegates; }; +struct AllowedLocationsResponse { + std::vector locations; + std::string encoded_locations; +}; + /// Parse the HTTP response from a `GenerateAccessToken()` call. StatusOr ParseGenerateAccessTokenResponse( rest_internal::RestResponse& response, google::cloud::internal::ErrorContext const& ec); +StatusOr ParseAllowedLocationsResponse( + rest_internal::RestResponse& response, + google::cloud::internal::ErrorContext const& ec); + /** * Wrapper for IAM Credentials intended for use with * `ImpersonateServiceAccountCredentials`. @@ -55,6 +64,13 @@ class MinimalIamCredentialsRest { virtual StatusOr GenerateAccessToken( GenerateAccessTokenRequest const& request) = 0; + virtual StatusOr AllowedLocations( + ServiceAccountAllowedLocationsRequest const& request) = 0; + virtual StatusOr AllowedLocations( + WorkloadIdentityAllowedLocationsRequest const& request) = 0; + virtual StatusOr AllowedLocations( + WorkforceIdentityAllowedLocationsRequest const& request) = 0; + virtual StatusOr universe_domain( Options const& options) const = 0; }; @@ -78,12 +94,20 @@ class MinimalIamCredentialsRestStub : public MinimalIamCredentialsRest { StatusOr GenerateAccessToken( GenerateAccessTokenRequest const& request) override; + StatusOr AllowedLocations( + ServiceAccountAllowedLocationsRequest const& request) override; + StatusOr AllowedLocations( + WorkloadIdentityAllowedLocationsRequest const& request) override; + StatusOr AllowedLocations( + WorkforceIdentityAllowedLocationsRequest const& request) override; + StatusOr universe_domain(Options const& options) const override { return credentials_->universe_domain(options); } private: std::string MakeRequestPath(GenerateAccessTokenRequest const& request) const; + StatusOr AllowedLocationsHelper(std::string path); std::shared_ptr credentials_; Options options_; @@ -101,6 +125,13 @@ class MinimalIamCredentialsRestLogging : public MinimalIamCredentialsRest { StatusOr GenerateAccessToken( GenerateAccessTokenRequest const& request) override; + StatusOr AllowedLocations( + ServiceAccountAllowedLocationsRequest const& request) override; + StatusOr AllowedLocations( + WorkloadIdentityAllowedLocationsRequest const& request) override; + StatusOr AllowedLocations( + WorkforceIdentityAllowedLocationsRequest const& request) override; + StatusOr universe_domain(Options const& options) const override { return child_->universe_domain(options); } diff --git a/google/cloud/internal/oauth2_minimal_iam_credentials_rest_test.cc b/google/cloud/internal/oauth2_minimal_iam_credentials_rest_test.cc index a84e856cec02b..7a81fe2ad43f2 100644 --- a/google/cloud/internal/oauth2_minimal_iam_credentials_rest_test.cc +++ b/google/cloud/internal/oauth2_minimal_iam_credentials_rest_test.cc @@ -44,8 +44,11 @@ using ::google::cloud::testing_util::StatusIs; using ::testing::_; using ::testing::A; using ::testing::ByMove; +using ::testing::ElementsAre; using ::testing::Eq; using ::testing::HasSubstr; +using ::testing::IsSupersetOf; +using ::testing::Pair; using ::testing::Return; class MockCredentials : public google::cloud::oauth2_internal::Credentials { @@ -250,6 +253,8 @@ TEST(MinimalIamCredentialsRestTest, GenerateAccessTokenSuccess) { EXPECT_CALL(*mock_credentials, GetToken).WillOnce([lifetime](auto tp) { return AccessToken{"test-token", tp + lifetime}; }); + EXPECT_CALL(*mock_credentials, universe_domain) + .WillOnce(::testing::Return(StatusOr{"googleapis.com"})); auto stub = MinimalIamCredentialsRestStub(std::move(mock_credentials), Options{}, @@ -341,6 +346,220 @@ TEST(MinimalIamCredentialsRestTest, GetUniverseDomainFromCredentials) { IsOkAndHolds(kExpectedUniverseDomain)); } +TEST(MinimalIamCredentialsRestTest, AllowedLocationsAuthorizationFailure) { + auto mock_credentials = std::make_shared(); + EXPECT_CALL(*mock_credentials, GetToken).WillOnce([] { + return Status(StatusCode::kPermissionDenied, "Permission Denied"); + }); + EXPECT_CALL(*mock_credentials, universe_domain) + .WillOnce(::testing::Return(StatusOr{"googleapis.com"})); + + MockHttpClientFactory mock_client_factory; + EXPECT_CALL(mock_client_factory, Call).Times(0); + auto stub = MinimalIamCredentialsRestStub( + std::move(mock_credentials), {}, mock_client_factory.AsStdFunction()); + ServiceAccountAllowedLocationsRequest request; + request.service_account_email = "foo@somewhere.com"; + auto access_token = stub.AllowedLocations(request); + EXPECT_THAT(access_token, StatusIs(StatusCode::kPermissionDenied)); +} + +TEST(MinimalIamCredentialsRestTest, AllowedLocationsMalformedResponseFailure) { + std::string service_account = "foo@somewhere.com"; + std::chrono::seconds lifetime(3600); + std::string response = R"""({})"""; + MockHttpClientFactory mock_client_factory; + EXPECT_CALL(mock_client_factory, Call).WillOnce([=](Options const&) { + auto client = std::make_unique(); + EXPECT_CALL(*client, Get) + .WillOnce([&](RestContext&, RestRequest const& request) { + auto mock_response = std::make_unique(); + EXPECT_CALL(*mock_response, StatusCode) + .WillRepeatedly(Return(rest_internal::HttpStatusCode::kOk)); + EXPECT_CALL(std::move(*mock_response), ExtractPayload) + .WillOnce([response] { + return testing_util::MakeMockHttpPayloadSuccess(response); + }); + EXPECT_THAT( + request.path(), + Eq(absl::StrCat("https://iamcredentials.googleapis.com/v1/", + "projects/-/serviceAccounts/", service_account, + "/allowedLocations"))); + return std::unique_ptr(std::move(mock_response)); + }); + return std::unique_ptr(std::move(client)); + }); + auto mock_credentials = std::make_shared(); + EXPECT_CALL(*mock_credentials, GetToken).WillOnce([lifetime](auto tp) { + return AccessToken{"test-token", tp + lifetime}; + }); + EXPECT_CALL(*mock_credentials, universe_domain) + .WillOnce(::testing::Return(StatusOr{"googleapis.com"})); + + auto stub = + MinimalIamCredentialsRestStub(std::move(mock_credentials), Options{}, + mock_client_factory.AsStdFunction()); + ServiceAccountAllowedLocationsRequest request; + request.service_account_email = service_account; + auto allowed_locations = stub.AllowedLocations(request); + EXPECT_THAT(allowed_locations, StatusIs(StatusCode::kInvalidArgument)); + EXPECT_THAT( + allowed_locations.status().error_info().metadata(), + IsSupersetOf( + {Pair("gcloud-cpp.root.class", "MinimalIamCredentialsRestStub"), + Pair("gcloud-cpp.root.function", "AllowedLocationsHelper"), + Pair("path", + "https://iamcredentials.googleapis.com/v1/projects/-/" + "serviceAccounts/foo@somewhere.com/allowedLocations")})); +} + +TEST(MinimalIamCredentialsRestTest, ServiceAccountAllowedLocations) { + std::string service_account = "foo@somewhere.com"; + std::chrono::seconds lifetime(3600); + std::string response = R"""({ + "locations": [ + "us-central1", "us-east1", "europe-west1", "asia-east1" + ], + "encodedLocations" : "0xA30"})"""; + MockHttpClientFactory mock_client_factory; + EXPECT_CALL(mock_client_factory, Call).WillOnce([=](Options const&) { + auto client = std::make_unique(); + EXPECT_CALL(*client, Get) + .WillOnce([&](RestContext&, RestRequest const& request) { + auto mock_response = std::make_unique(); + EXPECT_CALL(*mock_response, StatusCode) + .WillRepeatedly(Return(rest_internal::HttpStatusCode::kOk)); + EXPECT_CALL(std::move(*mock_response), ExtractPayload) + .WillOnce([response] { + return testing_util::MakeMockHttpPayloadSuccess(response); + }); + EXPECT_THAT( + request.path(), + Eq(absl::StrCat("https://iamcredentials.googleapis.com/v1/", + "projects/-/serviceAccounts/", service_account, + "/allowedLocations"))); + return std::unique_ptr(std::move(mock_response)); + }); + return std::unique_ptr(std::move(client)); + }); + auto mock_credentials = std::make_shared(); + EXPECT_CALL(*mock_credentials, GetToken).WillOnce([lifetime](auto tp) { + return AccessToken{"test-token", tp + lifetime}; + }); + EXPECT_CALL(*mock_credentials, universe_domain) + .WillOnce(::testing::Return(StatusOr{"googleapis.com"})); + + auto stub = + MinimalIamCredentialsRestStub(std::move(mock_credentials), Options{}, + mock_client_factory.AsStdFunction()); + ServiceAccountAllowedLocationsRequest request; + request.service_account_email = service_account; + auto allowed_locations = stub.AllowedLocations(request); + EXPECT_THAT( + allowed_locations->locations, + ElementsAre("us-central1", "us-east1", "europe-west1", "asia-east1")); + EXPECT_THAT(allowed_locations->encoded_locations, Eq("0xA30")); +} + +TEST(MinimalIamCredentialsRestTest, WorkloadIdentityAllowedLocations) { + std::string project_id = "my-project"; + std::string pool_id = "my-pool"; + std::chrono::seconds lifetime(3600); + std::string response = R"""({ + "locations": [ + "us-central1", "us-east1", "europe-west1", "asia-east1" + ], + "encodedLocations" : "0xA30"})"""; + MockHttpClientFactory mock_client_factory; + EXPECT_CALL(mock_client_factory, Call).WillOnce([=](Options const&) { + auto client = std::make_unique(); + EXPECT_CALL(*client, Get) + .WillOnce([&](RestContext&, RestRequest const& request) { + auto mock_response = std::make_unique(); + EXPECT_CALL(*mock_response, StatusCode) + .WillRepeatedly(Return(rest_internal::HttpStatusCode::kOk)); + EXPECT_CALL(std::move(*mock_response), ExtractPayload) + .WillOnce([response] { + return testing_util::MakeMockHttpPayloadSuccess(response); + }); + EXPECT_THAT( + request.path(), + Eq(absl::StrCat("https://iamcredentials.googleapis.com/v1/", + "projects/", project_id, + "/locations/global/workloadIdentityPools/", + pool_id, "/allowedLocations"))); + return std::unique_ptr(std::move(mock_response)); + }); + return std::unique_ptr(std::move(client)); + }); + auto mock_credentials = std::make_shared(); + EXPECT_CALL(*mock_credentials, GetToken).WillOnce([lifetime](auto tp) { + return AccessToken{"test-token", tp + lifetime}; + }); + EXPECT_CALL(*mock_credentials, universe_domain) + .WillOnce(::testing::Return(StatusOr{"googleapis.com"})); + + auto stub = + MinimalIamCredentialsRestStub(std::move(mock_credentials), Options{}, + mock_client_factory.AsStdFunction()); + WorkloadIdentityAllowedLocationsRequest request; + request.project_id = project_id; + request.pool_id = pool_id; + auto allowed_locations = stub.AllowedLocations(request); + EXPECT_THAT( + allowed_locations->locations, + ElementsAre("us-central1", "us-east1", "europe-west1", "asia-east1")); + EXPECT_THAT(allowed_locations->encoded_locations, Eq("0xA30")); +} + +TEST(MinimalIamCredentialsRestTest, WorkforceIdentityAllowedLocations) { + std::string pool_id = "my-pool"; + std::chrono::seconds lifetime(3600); + std::string response = R"""({ + "locations": [ + "us-central1", "us-east1", "europe-west1", "asia-east1" + ], + "encodedLocations" : "0xA30"})"""; + MockHttpClientFactory mock_client_factory; + EXPECT_CALL(mock_client_factory, Call).WillOnce([=](Options const&) { + auto client = std::make_unique(); + EXPECT_CALL(*client, Get) + .WillOnce([&](RestContext&, RestRequest const& request) { + auto mock_response = std::make_unique(); + EXPECT_CALL(*mock_response, StatusCode) + .WillRepeatedly(Return(rest_internal::HttpStatusCode::kOk)); + EXPECT_CALL(std::move(*mock_response), ExtractPayload) + .WillOnce([response] { + return testing_util::MakeMockHttpPayloadSuccess(response); + }); + EXPECT_THAT( + request.path(), + Eq(absl::StrCat("https://iamcredentials.googleapis.com/v1/", + "locations/global/workforcePools/", pool_id, + "/allowedLocations"))); + return std::unique_ptr(std::move(mock_response)); + }); + return std::unique_ptr(std::move(client)); + }); + auto mock_credentials = std::make_shared(); + EXPECT_CALL(*mock_credentials, GetToken).WillOnce([lifetime](auto tp) { + return AccessToken{"test-token", tp + lifetime}; + }); + EXPECT_CALL(*mock_credentials, universe_domain) + .WillOnce(::testing::Return(StatusOr{"googleapis.com"})); + + auto stub = + MinimalIamCredentialsRestStub(std::move(mock_credentials), Options{}, + mock_client_factory.AsStdFunction()); + WorkforceIdentityAllowedLocationsRequest request; + request.pool_id = pool_id; + auto allowed_locations = stub.AllowedLocations(request); + EXPECT_THAT( + allowed_locations->locations, + ElementsAre("us-central1", "us-east1", "europe-west1", "asia-east1")); + EXPECT_THAT(allowed_locations->encoded_locations, Eq("0xA30")); +} + } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oauth2_internal diff --git a/google/cloud/internal/oauth2_regional_access_boundary_token_manager.cc b/google/cloud/internal/oauth2_regional_access_boundary_token_manager.cc new file mode 100644 index 0000000000000..279fe542d6b11 --- /dev/null +++ b/google/cloud/internal/oauth2_regional_access_boundary_token_manager.cc @@ -0,0 +1,262 @@ +// Copyright 2026 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 "google/cloud/internal/oauth2_regional_access_boundary_token_manager.h" +#include "google/cloud/internal/algorithm.h" +#include "google/cloud/internal/rest_response.h" +#include "google/cloud/log.h" +#include "absl/strings/str_cat.h" + +namespace google { +namespace cloud { +namespace oauth2_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { + +auto constexpr kTokenTtl = std::chrono::seconds(6 * 3600); +auto constexpr kTtlGracePeriod = std::chrono::seconds(3600); +auto constexpr kMaximumRetryDuration = std::chrono::seconds(60); +auto constexpr kInitialBackoffDelay = std::chrono::seconds(1); +auto constexpr kMaximumBackoffDelay = std::chrono::seconds(5); +auto constexpr kBackoffScaling = 2.0; +auto constexpr kFailedLookupInitialBackoffDelay = std::chrono::seconds(15); +auto constexpr kFailedLookupMaximumBackoffDelay = std::chrono::seconds(120); +auto constexpr kFailedLookupBackoffScaling = 1.75; + +} // namespace + +bool RegionalAccessBoundaryTokenManager::RetryTraits::IsPermanentFailure( + Status const& s) { + // Http status codes 500, 502, 503, and 504 are mapped to kUnavailable, and + // some others that we don't mind retrying. + return s.code() != StatusCode::kUnavailable; +} + +class RegionalAccessBoundaryTokenManager::RefreshTokenLimitedTimeRetryPolicy + : public RefreshTokenRetryPolicy { + public: + template + explicit RefreshTokenLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + RefreshTokenLimitedTimeRetryPolicy( + RefreshTokenLimitedTimeRetryPolicy&& rhs) noexcept + : RefreshTokenLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + RefreshTokenLimitedTimeRetryPolicy( + RefreshTokenLimitedTimeRetryPolicy const& rhs) noexcept + : RefreshTokenLimitedTimeRetryPolicy(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 = RefreshTokenRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy impl_; +}; + +std::shared_ptr +RegionalAccessBoundaryTokenManager::Create(std::shared_ptr child, + HttpClientFactory client_factory, + Options options) { + auto iam_stub = MakeMinimalIamCredentialsRestStub(child, options, + std::move(client_factory)); + return std::shared_ptr( + new RegionalAccessBoundaryTokenManager( + std::move(child), std::move(iam_stub), + std::make_unique< + rest_internal::AutomaticallyCreatedRestPureBackgroundThreads>(), + std::move(options), FailedLookupBackoffPolicy, + std::make_shared())); +} + +std::shared_ptr +RegionalAccessBoundaryTokenManager::Create( + std::shared_ptr child, + std::shared_ptr iam_stub, Options options) { + return std::shared_ptr( + new RegionalAccessBoundaryTokenManager( + std::move(child), std::move(iam_stub), + std::make_unique< + rest_internal::AutomaticallyCreatedRestPureBackgroundThreads>(), + std::move(options), FailedLookupBackoffPolicy, + std::make_shared())); +} + +std::shared_ptr +RegionalAccessBoundaryTokenManager::Create( + std::shared_ptr child, + std::shared_ptr iam_stub, Options options, + std::function()> + failed_lookup_backoff_policy_fn, + std::shared_ptr clock, AllowedLocationsResponse allowed_locations) { + return std::shared_ptr( + new RegionalAccessBoundaryTokenManager( + std::move(child), std::move(iam_stub), + std::make_unique< + rest_internal::AutomaticallyCreatedRestPureBackgroundThreads>(), + std::move(options), std::move(failed_lookup_backoff_policy_fn), + std::move(clock), std::move(allowed_locations))); +} + +std::unique_ptr +RegionalAccessBoundaryTokenManager::FailedLookupBackoffPolicy() { + return std::make_unique( + kFailedLookupInitialBackoffDelay, kFailedLookupMaximumBackoffDelay, + kFailedLookupBackoffScaling); +} + +RegionalAccessBoundaryTokenManager::RegionalAccessBoundaryTokenManager( + std::shared_ptr child, + std::shared_ptr iam_stub, + std::unique_ptr background, + Options options, + std::function()> + failed_lookup_backoff_policy_fn, + std::shared_ptr clock, AllowedLocationsResponse allowed_locations) + : child_(std::move(child)), + background_(std::move(background)), + options_(std::move(options)), + clock_(std::move(clock)), + retry_policy_(std::make_unique( + kMaximumRetryDuration)), + backoff_policy_(std::make_unique( + kInitialBackoffDelay, kMaximumBackoffDelay, kBackoffScaling)), + failed_lookup_backoff_policy_fn_( + std::move(failed_lookup_backoff_policy_fn)), + iam_stub_(std::move(iam_stub)), + allowed_locations_(std::move(allowed_locations)) { + if (!allowed_locations_.encoded_locations.empty()) { + expire_time_ = clock_->Now() + TokenTtl(); + } +} + +bool RegionalAccessBoundaryTokenManager::DoesEndpointRequireToken( + std::string_view endpoint) { + return absl::EndsWithIgnoreCase(endpoint, ".googleapis.com") && + !absl::EndsWithIgnoreCase(endpoint, ".rep.googleapis.com") && + !absl::EndsWithIgnoreCase(endpoint, (".rep.sandbox.googleapis.com")); +} + +bool RegionalAccessBoundaryTokenManager::IsTokenValid( + std::scoped_lock const&, + std::chrono::system_clock::time_point tp) const { + return !allowed_locations_.encoded_locations.empty() && tp < expire_time_; +} + +std::chrono::seconds RegionalAccessBoundaryTokenManager::TtlGracePeriod() { + return kTtlGracePeriod; +} + +std::chrono::seconds RegionalAccessBoundaryTokenManager::TokenTtl() { + return kTokenTtl; +} + +StatusOr +RegionalAccessBoundaryTokenManager::AllowedLocations( + std::chrono::system_clock::time_point tp, std::string_view endpoint) { + auto request = child_->AllowedLocationsRequest(); + struct Visitor { + StatusOr operator()(std::monostate) const { + return rest_internal::HttpHeader{}; + } + StatusOr operator()( + ServiceAccountAllowedLocationsRequest const& r) const { + return m.GetAllowedLocationsHeader(r, tp, endpoint); + } + StatusOr operator()( + WorkforceIdentityAllowedLocationsRequest const& r) const { + return m.GetAllowedLocationsHeader(r, tp, endpoint); + } + StatusOr operator()( + WorkloadIdentityAllowedLocationsRequest const& r) const { + return m.GetAllowedLocationsHeader(r, tp, endpoint); + } + + RegionalAccessBoundaryTokenManager& m; + std::chrono::system_clock::time_point tp; + std::string_view endpoint; + }; + return std::visit(Visitor{*this, tp, endpoint}, request); +} + +StatusOr> +RegionalAccessBoundaryTokenManager::SignBlob( + absl::optional const& signing_service_account, + std::string const& string_to_sign) const { + return child_->SignBlob(signing_service_account, string_to_sign); +} + +std::string RegionalAccessBoundaryTokenManager::AccountEmail() const { + return child_->AccountEmail(); +} + +std::string RegionalAccessBoundaryTokenManager::KeyId() const { + return child_->KeyId(); +} + +StatusOr RegionalAccessBoundaryTokenManager::universe_domain() + const { + return child_->universe_domain(); +} + +StatusOr RegionalAccessBoundaryTokenManager::universe_domain( + google::cloud::Options const& options) const { + return child_->universe_domain(options); +} + +StatusOr RegionalAccessBoundaryTokenManager::project_id() const { + return child_->project_id(); +} + +StatusOr RegionalAccessBoundaryTokenManager::project_id( + Options const& options) const { + return child_->project_id(options); +} + +StatusOr +RegionalAccessBoundaryTokenManager::Authorization( + std::chrono::system_clock::time_point tp) { + return child_->Authorization(tp); +} + +StatusOr RegionalAccessBoundaryTokenManager::GetToken( + std::chrono::system_clock::time_point tp) { + return child_->GetToken(tp); +} + +Credentials::AllowedLocationsRequestType +RegionalAccessBoundaryTokenManager::AllowedLocationsRequest() const { + return child_->AllowedLocationsRequest(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace oauth2_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/internal/oauth2_regional_access_boundary_token_manager.h b/google/cloud/internal/oauth2_regional_access_boundary_token_manager.h new file mode 100644 index 0000000000000..85d1ba3f01245 --- /dev/null +++ b/google/cloud/internal/oauth2_regional_access_boundary_token_manager.h @@ -0,0 +1,252 @@ +// Copyright 2026 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. + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_OAUTH2_REGIONAL_ACCESS_BOUNDARY_TOKEN_MANAGER_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_OAUTH2_REGIONAL_ACCESS_BOUNDARY_TOKEN_MANAGER_H + +#include "google/cloud/backoff_policy.h" +#include "google/cloud/internal/clock.h" +#include "google/cloud/internal/http_header.h" +#include "google/cloud/internal/oauth2_minimal_iam_credentials_rest.h" +#include "google/cloud/internal/rest_pure_background_threads_impl.h" +#include "google/cloud/internal/rest_retry_loop.h" +#include "google/cloud/internal/retry_policy_impl.h" +#include "google/cloud/log.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include "absl/strings/match.h" +#include +#include + +namespace google { +namespace cloud { +namespace oauth2_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Manages fetching and caching routing tokens for RAB. + * + * Regional endpoints (those ending with ".rep.googleapis.com" or + * ".rep.sandbox.googleapis.com") do not require a routing token. Non-GDU + * endpoints, likewise do not require a routing token. + * + * The routing tokens are refreshed asynchronously by a background thread. + * + * Supported credential types: + * - Service Account + * - Impersonated Service Account + * - Workload Identity Federation + * - Workforce Identity Federation + * - Self Signed JWT + * + * Supported environments: + * - GDU only + */ +class RegionalAccessBoundaryTokenManager + : public Credentials, + public std::enable_shared_from_this { + public: + using Clock = ::google::cloud::internal::SystemClock; + + struct RetryTraits { + static bool IsPermanentFailure(Status const&); + }; + + static std::shared_ptr Create( + std::shared_ptr child, HttpClientFactory client_factory, + Options options); + + static std::shared_ptr Create( + std::shared_ptr child, + std::shared_ptr iam_stub, Options options); + + static std::chrono::seconds TtlGracePeriod(); + static std::chrono::seconds TokenTtl(); + + // Decorator overrides from Credentials that simply call the same method on + // child_. + StatusOr> SignBlob( + absl::optional const& signing_service_account, + std::string const& string_to_sign) const override; + std::string AccountEmail() const override; + std::string KeyId() const override; + StatusOr universe_domain() const override; + StatusOr universe_domain( + google::cloud::Options const& options) const override; + StatusOr project_id() const override; + StatusOr project_id(Options const&) const override; + StatusOr Authorization( + std::chrono::system_clock::time_point tp) override; + StatusOr GetToken( + std::chrono::system_clock::time_point tp) override; + Credentials::AllowedLocationsRequestType AllowedLocationsRequest() + const override; + + // Decorator override that has an implementation. + StatusOr AllowedLocations( + std::chrono::system_clock::time_point tp, + std::string_view endpoint) override; + + template + StatusOr GetAllowedLocationsHeader( + Request const& request, std::chrono::system_clock::time_point tp, + std::string_view endpoint) { + // If the endpoint does not need a token, return immediately. + if (!DoesEndpointRequireToken(endpoint)) return rest_internal::HttpHeader{}; + std::scoped_lock lock(mu_); + if (!refresh_in_progress_ && pending_refresh_.valid()) { + pending_refresh_.get(); + } + if (IsTokenValid(lock, tp)) { + // Check to see if we're near expiry and if so, start refresh process. + if (tp > (expire_time_ - TtlGracePeriod())) RefreshToken(lock, request); + return rest_internal::HttpHeader{"x-allowed-locations", + allowed_locations_.encoded_locations}; + } + RefreshToken(lock, request); + // Don't wait for a valid token, just return an empty header. + return rest_internal::HttpHeader{}; + } + + // Used for testing. + static std::shared_ptr Create( + std::shared_ptr child, + std::shared_ptr iam_stub, Options options, + std::function()> + failed_lookup_backoff_policy_fn, + std::shared_ptr clock = std::make_shared(), + AllowedLocationsResponse allowed_locations = AllowedLocationsResponse{}); + + // Snapshot read useful only in testing. + bool IsOnCooldown() const { + std::scoped_lock lock(mu_); + return failed_lookup_cooldown_.valid() && + !failed_lookup_cooldown_.is_ready(); + } + + // Snapshot read useful only in testing. + bool IsRefreshPending() const { + std::scoped_lock lock(mu_); + return refresh_in_progress_; + } + + private: + class RefreshTokenRetryPolicy : public ::google::cloud::RetryPolicy { + public: + virtual std::unique_ptr clone() const = 0; + }; + + class RefreshTokenLimitedTimeRetryPolicy; + + static bool DoesEndpointRequireToken(std::string_view endpoint); + static std::unique_ptr FailedLookupBackoffPolicy(); + + RegionalAccessBoundaryTokenManager( + std::shared_ptr child, + std::shared_ptr iam_stub, + std::unique_ptr background, + Options options, + std::function()> + failed_lookup_backoff_policy_fn, + std::shared_ptr clock = std::make_shared(), + AllowedLocationsResponse allowed_locations = AllowedLocationsResponse{}); + + bool IsTokenValid(std::scoped_lock const&, + std::chrono::system_clock::time_point tp) const; + + template + void RefreshToken(std::scoped_lock const&, + Request const& request) { + if (refresh_in_progress_) return; + if (failed_lookup_cooldown_.valid()) { + if (!failed_lookup_cooldown_.is_ready()) return; + (void)failed_lookup_cooldown_.get(); + } + + promise pending_refresh; + pending_refresh_ = pending_refresh.get_future(); + auto constexpr kLocation = __func__; + auto pending_refresh_fn = [p = std::move(pending_refresh), + weak = weak_from_this(), request, + stub = iam_stub_, + retry_policy = retry_policy_->clone(), + backoff_policy = backoff_policy_->clone(), + options = options_]() mutable { + auto refresh_attempt_fn = [stub](rest_internal::RestContext&, + Options const&, Request const& request) { + return stub->AllowedLocations(request); + }; + + StatusOr allowed_locations = + rest_internal::RestRetryLoop( + *retry_policy, *backoff_policy, Idempotency::kIdempotent, + refresh_attempt_fn, options, request, kLocation); + + if (!allowed_locations.ok()) { + GCP_LOG(WARNING) << "AllowedLocations refresh failed with status=" + << allowed_locations.status(); + } + + auto self = weak.lock(); + if (!self) return; + std::scoped_lock lock(self->mu_); + if (allowed_locations.ok()) { + self->allowed_locations_ = *allowed_locations; + self->expire_time_ = self->clock_->Now() + TokenTtl(); + self->failed_lookup_backoff_policy_.reset(); + p.set_value(Status{}); + } else { + self->allowed_locations_ = AllowedLocationsResponse{}; + if (!self->failed_lookup_backoff_policy_) { + self->failed_lookup_backoff_policy_ = + self->failed_lookup_backoff_policy_fn_(); + } + self->failed_lookup_cooldown_ = + self->background_->cq().MakeRelativeTimer( + self->failed_lookup_backoff_policy_->OnCompletion()); + p.set_value(allowed_locations.status()); + } + self->refresh_in_progress_ = false; + }; + + refresh_in_progress_ = true; + background_->cq().RunAsync(std::move(pending_refresh_fn)); + } + + mutable std::mutex mu_; + std::shared_ptr child_; + std::unique_ptr background_; + Options options_; + std::shared_ptr clock_; + std::unique_ptr retry_policy_; + std::unique_ptr backoff_policy_; + std::function()> + failed_lookup_backoff_policy_fn_; + std::unique_ptr failed_lookup_backoff_policy_; + std::shared_ptr iam_stub_; + future> + failed_lookup_cooldown_; + std::chrono::system_clock::time_point expire_time_; + AllowedLocationsResponse allowed_locations_; + future pending_refresh_; + bool refresh_in_progress_ = false; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace oauth2_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_OAUTH2_REGIONAL_ACCESS_BOUNDARY_TOKEN_MANAGER_H diff --git a/google/cloud/internal/oauth2_regional_access_boundary_token_manager_test.cc b/google/cloud/internal/oauth2_regional_access_boundary_token_manager_test.cc new file mode 100644 index 0000000000000..7a3e43e49b851 --- /dev/null +++ b/google/cloud/internal/oauth2_regional_access_boundary_token_manager_test.cc @@ -0,0 +1,380 @@ +// Copyright 2026 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 "google/cloud/internal/oauth2_regional_access_boundary_token_manager.h" +#include "google/cloud/internal/make_status.h" +#include "google/cloud/internal/rest_pure_background_threads_impl.h" +#include "google/cloud/internal/rest_response.h" +#include "google/cloud/internal/unified_rest_credentials.h" +#include "google/cloud/testing_util/fake_clock.h" +#include "google/cloud/testing_util/status_matchers.h" +#include + +namespace google { +namespace cloud { +namespace oauth2_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { + +using ::google::cloud::testing_util::IsOkAndHolds; +using ::testing::A; +using ::testing::Eq; +using ::testing::IsEmpty; +using ::testing::MockFunction; +using ::testing::Return; + +class MockCredentials : public Credentials { + public: + MOCK_METHOD(StatusOr>, SignBlob, + (absl::optional const&, std::string const&), + (const, override)); + MOCK_METHOD(std::string, AccountEmail, (), (const, override)); + MOCK_METHOD(std::string, KeyId, (), (const, override)); + MOCK_METHOD(StatusOr, universe_domain, (), (const, override)); + MOCK_METHOD(StatusOr, universe_domain, + (google::cloud::Options const&), (const, override)); + MOCK_METHOD(StatusOr, project_id, (), (const, override)); + MOCK_METHOD(StatusOr, project_id, (Options const&), + (const, override)); + MOCK_METHOD(StatusOr, Authorization, + (std::chrono::system_clock::time_point), (override)); + MOCK_METHOD(StatusOr, AllowedLocations, + (std::chrono::system_clock::time_point, std::string_view), + (override)); + MOCK_METHOD(StatusOr, GetToken, + (std::chrono::system_clock::time_point), (override)); + MOCK_METHOD(AllowedLocationsRequestType, AllowedLocationsRequest, (), + (const, override)); +}; + +class MockMinimalIamCredentialsRest : public MinimalIamCredentialsRest { + public: + MOCK_METHOD(StatusOr, GenerateAccessToken, + (GenerateAccessTokenRequest const&), (override)); + MOCK_METHOD(StatusOr, AllowedLocations, + (ServiceAccountAllowedLocationsRequest const&), (override)); + MOCK_METHOD(StatusOr, AllowedLocations, + (WorkloadIdentityAllowedLocationsRequest const&), (override)); + MOCK_METHOD(StatusOr, AllowedLocations, + (WorkforceIdentityAllowedLocationsRequest const&), (override)); + MOCK_METHOD(StatusOr, universe_domain, (Options const& options), + (override, const)); +}; + +class MockBackoffPolicy : public BackoffPolicy { + public: + MOCK_METHOD(std::unique_ptr, clone, (), (const, override)); + MOCK_METHOD(std::chrono::milliseconds, OnCompletion, (), (override)); +}; + +TEST(RegionalAccessBoundaryTokenManagerRetryTraitsTest, RetryTraits) { + auto http_status_500 = + rest_internal::AsStatus(rest_internal::kInternalServerError, {}); + auto http_status_502 = + rest_internal::AsStatus(rest_internal::kBadGateway, {}); + auto http_status_503 = + rest_internal::AsStatus(rest_internal::kServiceUnavailable, {}); + auto http_status_504 = + rest_internal::AsStatus(rest_internal::kGatewayTimeout, {}); + + using RetryTraits = RegionalAccessBoundaryTokenManager::RetryTraits; + + EXPECT_FALSE(RetryTraits::IsPermanentFailure(http_status_500)); + EXPECT_FALSE(RetryTraits::IsPermanentFailure(http_status_502)); + EXPECT_FALSE(RetryTraits::IsPermanentFailure(http_status_503)); + EXPECT_FALSE(RetryTraits::IsPermanentFailure(http_status_504)); + + auto http_status_404 = rest_internal::AsStatus(rest_internal::kNotFound, {}); + EXPECT_TRUE(RetryTraits::IsPermanentFailure(http_status_404)); +} + +class RegionalAccessBoundaryTokenManagerTest : public ::testing::Test { + protected: + RegionalAccessBoundaryTokenManagerTest() + : mock_credentials_(std::make_shared()), + mock_iam_stub_(std::make_shared()), + fake_clock_(std::make_shared()) {} + + std::shared_ptr mock_credentials_; + std::shared_ptr mock_iam_stub_; + std::shared_ptr fake_clock_; +}; + +TEST_F(RegionalAccessBoundaryTokenManagerTest, + GetAllowedLocationsHeaderNonApplicableEndpoints) { + auto manager = RegionalAccessBoundaryTokenManager::Create(mock_credentials_, + mock_iam_stub_, {}); + + ServiceAccountAllowedLocationsRequest request; + auto header = manager->GetAllowedLocationsHeader( + request, std::chrono::system_clock::now(), "service.rep.googleapis.com"); + EXPECT_THAT(header, IsOkAndHolds(IsEmpty())); + + auto header_sandbox = manager->GetAllowedLocationsHeader( + request, std::chrono::system_clock::now(), + "service.rep.sandbox.googleapis.com"); + EXPECT_THAT(header_sandbox, IsOkAndHolds(IsEmpty())); + + auto header_non_gdu = manager->GetAllowedLocationsHeader( + request, std::chrono::system_clock::now(), "service.bar.com"); + EXPECT_THAT(header_non_gdu, IsOkAndHolds(IsEmpty())); +} + +TEST_F(RegionalAccessBoundaryTokenManagerTest, + GetAllowedLocationsHeaderValidTokenSoftExpiry) { + fake_clock_->SetTime(std::chrono::system_clock::now()); + MockFunction()> backoff_fn; + EXPECT_CALL(backoff_fn, Call).Times(0); + + EXPECT_CALL(*mock_credentials_, AllowedLocationsRequest) + .WillRepeatedly(Return(WorkforceIdentityAllowedLocationsRequest{})); + + AllowedLocationsResponse allowed_locations; + allowed_locations.locations = {"location1"}; + allowed_locations.encoded_locations = "encoded-location"; + + auto manager = RegionalAccessBoundaryTokenManager::Create( + mock_credentials_, mock_iam_stub_, {}, backoff_fn.AsStdFunction(), + fake_clock_, allowed_locations); + + fake_clock_->AdvanceTime(std::chrono::seconds(1)); + + auto header = + manager->AllowedLocations(fake_clock_->Now(), "service.googleapis.com"); + EXPECT_THAT(header, + IsOkAndHolds(rest_internal::HttpHeader{ + "x-allowed-locations", allowed_locations.encoded_locations})); + + promise sync_threads; + AllowedLocationsResponse refreshed_allowed_locations; + refreshed_allowed_locations.locations = {"location2"}; + refreshed_allowed_locations.encoded_locations = "encoded-location-2"; + // Refresh is called due to soft expiry, but current token is still returned. + EXPECT_CALL( + *mock_iam_stub_, + AllowedLocations(A())) + .WillOnce([&, f = sync_threads.get_future()]( + WorkforceIdentityAllowedLocationsRequest const&) mutable { + f.get(); + return refreshed_allowed_locations; + }); + + fake_clock_->AdvanceTime( + RegionalAccessBoundaryTokenManager::TokenTtl() - + RegionalAccessBoundaryTokenManager::TtlGracePeriod()); + + header = + manager->AllowedLocations(fake_clock_->Now(), "service.googleapis.com"); + EXPECT_THAT(header, + IsOkAndHolds(rest_internal::HttpHeader{ + "x-allowed-locations", allowed_locations.encoded_locations})); + EXPECT_TRUE(manager->IsRefreshPending()); + sync_threads.set_value(); + + // Give background thread a chance to call AllowedLocations. + std::this_thread::sleep_for(std::chrono::seconds(2)); + header = + manager->AllowedLocations(fake_clock_->Now(), "service.googleapis.com"); + EXPECT_THAT(header, IsOkAndHolds(rest_internal::HttpHeader{ + "x-allowed-locations", + refreshed_allowed_locations.encoded_locations})); +} + +TEST_F(RegionalAccessBoundaryTokenManagerTest, + GetAllowedLocationsHeaderNoInitialValidTokenWithRetry) { + EXPECT_CALL(*mock_credentials_, AllowedLocationsRequest) + .WillRepeatedly(Return(WorkloadIdentityAllowedLocationsRequest{})); + + AllowedLocationsResponse response; + response.locations = {"location1"}; + response.encoded_locations = "encoded-location"; + EXPECT_CALL( + *mock_iam_stub_, + AllowedLocations(A())) + .WillOnce([&](WorkloadIdentityAllowedLocationsRequest const&) { + return internal::UnavailableError("unavailable"); + }) + .WillOnce([&](WorkloadIdentityAllowedLocationsRequest const&) { + return response; + }); + + auto manager = RegionalAccessBoundaryTokenManager::Create(mock_credentials_, + mock_iam_stub_, {}); + + auto header = manager->AllowedLocations(std::chrono::system_clock::now(), + "service.googleapis.com"); + EXPECT_THAT(header, IsOkAndHolds(IsEmpty())); + + // Give the background thread a chance to run the future::then callback + // and update the token. + std::this_thread::sleep_for(std::chrono::seconds(2)); + + header = manager->AllowedLocations(std::chrono::system_clock::now(), + "service.googleapis.com"); + EXPECT_THAT(header, IsOkAndHolds(rest_internal::HttpHeader{ + "x-allowed-locations", response.encoded_locations})); +} + +TEST_F(RegionalAccessBoundaryTokenManagerTest, + GetAllowedLocationsHeaderPermanentFailureAndRecovery) { + EXPECT_CALL(*mock_credentials_, AllowedLocationsRequest) + .WillRepeatedly(Return(ServiceAccountAllowedLocationsRequest{})); + + AllowedLocationsResponse response; + response.locations = {"location1"}; + response.encoded_locations = "encoded-location"; + EXPECT_CALL( + *mock_iam_stub_, + AllowedLocations(A())) + .WillOnce([&](ServiceAccountAllowedLocationsRequest const&) { + return internal::UnavailableError("unavailable"); + }) + .WillOnce([&](ServiceAccountAllowedLocationsRequest const&) { + return internal::InternalError("uh oh"); + }) + .WillOnce([&](ServiceAccountAllowedLocationsRequest const&) { + return response; + }); + + MockFunction()> backoff_fn; + EXPECT_CALL(backoff_fn, Call).WillOnce([]() { + auto mock_backoff = std::make_unique(); + EXPECT_CALL(*mock_backoff, OnCompletion) + .WillOnce(Return(std::chrono::milliseconds(1000))); + return mock_backoff; + }); + + auto manager = RegionalAccessBoundaryTokenManager::Create( + mock_credentials_, mock_iam_stub_, {}, backoff_fn.AsStdFunction()); + + auto header = manager->AllowedLocations(std::chrono::system_clock::now(), + "service.googleapis.com"); + EXPECT_THAT(header, IsOkAndHolds(IsEmpty())); + + // Give the background thread a chance to run and update the token. + std::this_thread::sleep_for(std::chrono::seconds(2)); + + header = manager->AllowedLocations(std::chrono::system_clock::now(), + "service.googleapis.com"); + EXPECT_THAT(header, IsOkAndHolds(IsEmpty())); + // Permanent error encountered; verify cooldown has been set. + EXPECT_TRUE(manager->IsOnCooldown()); + + // With no valid token and active cooldown, no call to AllowedLocations on the + // iam stub should occur. + header = manager->AllowedLocations(std::chrono::system_clock::now(), + "service.googleapis.com"); + EXPECT_THAT(header, IsOkAndHolds(IsEmpty())); + + // With the mock backoff returning a short failure cooldown, let it expire. + std::this_thread::sleep_for(std::chrono::seconds(1)); + + header = manager->AllowedLocations(std::chrono::system_clock::now(), + "service.googleapis.com"); + EXPECT_THAT(header, IsOkAndHolds(IsEmpty())); + + // Give the background thread a chance to run and update the token. + std::this_thread::sleep_for(std::chrono::seconds(2)); + + header = manager->AllowedLocations(std::chrono::system_clock::now(), + "service.googleapis.com"); + EXPECT_THAT(header, IsOkAndHolds(rest_internal::HttpHeader{ + "x-allowed-locations", response.encoded_locations})); +} + +TEST_F(RegionalAccessBoundaryTokenManagerTest, + GetAllowedLocationsMonostateRequest) { + EXPECT_CALL(*mock_credentials_, AllowedLocationsRequest) + .WillRepeatedly(Return(std::monostate{})); + + EXPECT_CALL( + *mock_iam_stub_, + AllowedLocations(A())) + .Times(0); + EXPECT_CALL( + *mock_iam_stub_, + AllowedLocations(A())) + .Times(0); + EXPECT_CALL( + *mock_iam_stub_, + AllowedLocations(A())) + .Times(0); + + auto manager = RegionalAccessBoundaryTokenManager::Create(mock_credentials_, + mock_iam_stub_, {}); + auto header = manager->AllowedLocations(std::chrono::system_clock::now(), + "service.googleapis.com"); + EXPECT_THAT(header, IsOkAndHolds(IsEmpty())); + + // Give the background thread a chance to run the future::then callback + // and update the token. + std::this_thread::sleep_for(std::chrono::seconds(2)); + + header = manager->AllowedLocations(std::chrono::system_clock::now(), + "service.googleapis.com"); + EXPECT_THAT(header, IsOkAndHolds(IsEmpty())); +} + +TEST_F(RegionalAccessBoundaryTokenManagerTest, DecoratorMethodPassThrough) { + auto now = std::chrono::system_clock::now(); + auto options = Options{}.set("my-user-project"); + + EXPECT_CALL(*mock_credentials_, SignBlob(Eq("sa"), Eq("string"))) + .WillOnce(Return(StatusOr>({42}))); + EXPECT_CALL(*mock_credentials_, AccountEmail).WillOnce(Return("my-email")); + EXPECT_CALL(*mock_credentials_, KeyId).WillOnce(Return("my-keyid")); + EXPECT_CALL(*mock_credentials_, universe_domain()) + .WillOnce(Return(StatusOr("my-ud"))); + EXPECT_CALL(*mock_credentials_, + universe_domain(A())) + .WillOnce([](Options const& opts) -> StatusOr { + EXPECT_EQ(opts.get(), "my-user-project"); + return std::string{"my-ud"}; + }); + EXPECT_CALL(*mock_credentials_, project_id()) + .WillOnce(Return(StatusOr("my-project"))); + EXPECT_CALL(*mock_credentials_, + project_id(A())) + .WillOnce([](Options const& opts) -> StatusOr { + EXPECT_EQ(opts.get(), "my-user-project"); + return std::string{"my-project"}; + }); + EXPECT_CALL(*mock_credentials_, Authorization(Eq(now))) + .WillOnce(Return(StatusOr{})); + EXPECT_CALL(*mock_credentials_, GetToken(Eq(now))) + .WillOnce(Return(StatusOr{})); + EXPECT_CALL(*mock_credentials_, AllowedLocationsRequest) + .WillOnce( + Return(Credentials::AllowedLocationsRequestType{std::monostate{}})); + + auto manager = RegionalAccessBoundaryTokenManager::Create(mock_credentials_, + mock_iam_stub_, {}); + + (void)manager->SignBlob("sa", "string"); + (void)manager->AccountEmail(); + (void)manager->KeyId(); + (void)manager->universe_domain(); + (void)manager->universe_domain(options); + (void)manager->project_id(); + (void)manager->project_id(options); + (void)manager->Authorization(now); + (void)manager->GetToken(now); + (void)manager->AllowedLocationsRequest(); +} + +} // namespace +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace oauth2_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/internal/oauth2_service_account_credentials.cc b/google/cloud/internal/oauth2_service_account_credentials.cc index 849f572211bfe..9bfb7281eaf69 100644 --- a/google/cloud/internal/oauth2_service_account_credentials.cc +++ b/google/cloud/internal/oauth2_service_account_credentials.cc @@ -370,6 +370,16 @@ StatusOr ServiceAccountCredentials::project_id( return project_id(); } +Credentials::AllowedLocationsRequestType +ServiceAccountCredentials::AllowedLocationsRequest() const { + // TODO(#16079): Remove conditional and else clause when GA. +#ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB + return ServiceAccountAllowedLocationsRequest{info_.client_email}; +#else + return std::monostate{}; +#endif +} + bool ServiceAccountUseOAuth(ServiceAccountCredentialsInfo const& info) { // Custom universe domains are only supported with JWT, not OAuth tokens. if (info.universe_domain.has_value() && diff --git a/google/cloud/internal/oauth2_service_account_credentials.h b/google/cloud/internal/oauth2_service_account_credentials.h index 6a62388c18ec9..748af3e9903d5 100644 --- a/google/cloud/internal/oauth2_service_account_credentials.h +++ b/google/cloud/internal/oauth2_service_account_credentials.h @@ -293,6 +293,8 @@ class ServiceAccountCredentials : public oauth2_internal::Credentials { StatusOr project_id() const override; StatusOr project_id(Options const&) const override; + AllowedLocationsRequestType AllowedLocationsRequest() const override; + private: bool UseOAuth(); StatusOr GetTokenOAuth( diff --git a/google/cloud/internal/oauth2_service_account_credentials_test.cc b/google/cloud/internal/oauth2_service_account_credentials_test.cc index a8bd0b6e23e0d..07531618f20f5 100644 --- a/google/cloud/internal/oauth2_service_account_credentials_test.cc +++ b/google/cloud/internal/oauth2_service_account_credentials_test.cc @@ -56,6 +56,7 @@ using ::testing::Not; using ::testing::Pair; using ::testing::Property; using ::testing::Return; +using ::testing::VariantWith; using MockHttpClientFactory = ::testing::MockFunction( @@ -138,6 +139,10 @@ std::string MakeUniverseDomainTestContents() { return json.dump(); } +MATCHER_P(RequestServiceAccountEmailIs, email, "has service account email") { + return email == arg.service_account_email; +} + void CheckInfoYieldsExpectedAssertion(ServiceAccountCredentialsInfo const& info, std::string const& assertion, std::time_t assertion_time) { @@ -181,6 +186,15 @@ void CheckInfoYieldsExpectedAssertion(ServiceAccountCredentialsInfo const& info, ASSERT_STATUS_OK(token); EXPECT_EQ(token->token, "access-token-value"); EXPECT_EQ(token->expiration, tp + std::chrono::seconds(1234)); + // TODO(#16079): Remove conditional and else clause when GA. +#ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB + EXPECT_THAT(credentials.AllowedLocationsRequest(), + VariantWith( + RequestServiceAccountEmailIs(kClientEmail))); +#else + EXPECT_THAT(credentials.AllowedLocationsRequest(), + VariantWith(std::monostate())); +#endif } TEST(ServiceAccountCredentialsTest, ServiceAccountUseOAuth) { diff --git a/google/cloud/internal/rest_completion_queue_impl.cc b/google/cloud/internal/rest_completion_queue_impl.cc index b9c6e9c6ff32a..0791c471a1daf 100644 --- a/google/cloud/internal/rest_completion_queue_impl.cc +++ b/google/cloud/internal/rest_completion_queue_impl.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/internal/rest_completion_queue_impl.h" -#include "google/cloud/internal/timer_queue.h" namespace google { namespace cloud { @@ -21,42 +20,28 @@ namespace rest_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN RestCompletionQueueImpl::RestCompletionQueueImpl() - : tq_(internal::TimerQueue::Create()) {} + : impl_(std::make_shared()) {} -void RestCompletionQueueImpl::Run() { tq_->Service(); } +void RestCompletionQueueImpl::Run() { impl_->Run(); } -void RestCompletionQueueImpl::Shutdown() { tq_->Shutdown(); } +void RestCompletionQueueImpl::Shutdown() { impl_->Shutdown(); } void RestCompletionQueueImpl::CancelAll() {} future> RestCompletionQueueImpl::MakeDeadlineTimer( std::chrono::system_clock::time_point deadline) { - return tq_->Schedule(deadline); + return impl_->MakeDeadlineTimer(deadline); } future> RestCompletionQueueImpl::MakeRelativeTimer(std::chrono::nanoseconds duration) { - using std::chrono::system_clock; - auto d = std::chrono::duration_cast(duration); - if (d < duration) d += system_clock::duration{1}; - return MakeDeadlineTimer(system_clock::now() + d); + return impl_->MakeRelativeTimer(duration); } -// Use an "immediately" expiring timer in order to get the thread(s) servicing -// the TimerQueue to execute the function. However, if the timer -// expires before .then() is invoked, the lambda will be immediately called and -// the passing of execution to the queue servicing thread will not occur. void RestCompletionQueueImpl::RunAsync( std::unique_ptr function) { - ++run_async_counter_; - tq_->Schedule([f = std::move(function)](auto) { f->exec(); }); -} - -void RestCompletionQueueImpl::StartOperation( - std::shared_ptr, - absl::FunctionRef) { - GCP_LOG(FATAL) << " function not supported.\n"; + impl_->RunAsync(std::move(function)); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/rest_completion_queue_impl.h b/google/cloud/internal/rest_completion_queue_impl.h index b90df4cde65eb..44ccea0528fe2 100644 --- a/google/cloud/internal/rest_completion_queue_impl.h +++ b/google/cloud/internal/rest_completion_queue_impl.h @@ -17,6 +17,7 @@ #include "google/cloud/future.h" #include "google/cloud/internal/completion_queue_impl.h" +#include "google/cloud/internal/rest_pure_completion_queue_impl.h" #include "google/cloud/internal/timer_queue.h" #include "google/cloud/log.h" #include "google/cloud/status_or.h" @@ -69,19 +70,18 @@ class RestCompletionQueueImpl final /// This function is not supported by RestCompletionQueueImpl, but as the /// function is pure virtual, it must be overridden. void StartOperation(std::shared_ptr, - absl::FunctionRef) override; + absl::FunctionRef) override { + GCP_LOG(FATAL) << " function not supported.\n"; + } /// The underlying gRPC completion queue, which does not exist. grpc::CompletionQueue* cq() override { return nullptr; } /// Some counters for testing and debugging. - std::int64_t run_async_counter() const { return run_async_counter_.load(); } + std::int64_t run_async_counter() const { return impl_->run_async_counter(); } private: - std::shared_ptr tq_; - - // These are metrics used in testing. - std::atomic run_async_counter_{0}; + std::shared_ptr impl_; }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/internal/rest_context.cc b/google/cloud/internal/rest_context.cc index 4c128564aa9f4..7d8eb3acdaa78 100644 --- a/google/cloud/internal/rest_context.cc +++ b/google/cloud/internal/rest_context.cc @@ -13,35 +13,29 @@ // limitations under the License. #include "google/cloud/internal/rest_context.h" +#include "absl/strings/strip.h" #include -#include namespace google { namespace cloud { namespace rest_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -RestContext& RestContext::AddHeader(std::string header, std::string value) & { - std::transform(header.begin(), header.end(), header.begin(), - [](unsigned char c) { return std::tolower(c); }); - auto iter = headers_.find(header); +RestContext& RestContext::AddHeader(HttpHeader header) & { + auto iter = headers_.find(header.name()); if (iter == headers_.end()) { - std::vector v = {std::move(value)}; - headers_.emplace(std::move(header), std::move(v)); + headers_.emplace(header.name(), std::move(header)); } else { - iter->second.push_back(value); + iter->second.MergeHeader(std::move(header)); } return *this; } -RestContext& RestContext::AddHeader( - std::pair header) & { - return AddHeader(std::move(header.first), std::move(header.second)); +RestContext& RestContext::AddHeader(std::string header, std::string value) & { + return AddHeader(HttpHeader(std::move(header), std::move(value))); } -std::vector RestContext::GetHeader(std::string header) const { - std::transform(header.begin(), header.end(), header.begin(), - [](unsigned char c) { return std::tolower(c); }); +HttpHeader RestContext::GetHeader(HttpHeaderName const& header) const { auto iter = headers_.find(header); if (iter == headers_.end()) { return {}; diff --git a/google/cloud/internal/rest_context.h b/google/cloud/internal/rest_context.h index 5f19a9e191d36..780207cb48113 100644 --- a/google/cloud/internal/rest_context.h +++ b/google/cloud/internal/rest_context.h @@ -15,15 +15,13 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_CONTEXT_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_CONTEXT_H +#include "google/cloud/internal/http_header.h" #include "google/cloud/options.h" #include "google/cloud/version.h" #include "absl/types/optional.h" #include -#include #include -#include #include -#include namespace google { namespace cloud { @@ -36,7 +34,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN */ class RestContext { public: - using HttpHeaders = std::unordered_map>; RestContext() = default; explicit RestContext(Options options, HttpHeaders headers) : options_(std::move(options)), headers_(std::move(headers)) {} @@ -50,18 +47,17 @@ class RestContext { // Adding a header/value pair that already exists results in the new value // appended to the list of values for the existing header. + RestContext& AddHeader(HttpHeader header) &; + RestContext&& AddHeader(HttpHeader header) && { + return std::move(AddHeader(std::move(header))); + } RestContext& AddHeader(std::string header, std::string value) &; RestContext&& AddHeader(std::string header, std::string value) && { return std::move(AddHeader(std::move(header), std::move(value))); } - RestContext& AddHeader(std::pair header) &; - RestContext&& AddHeader(std::pair header) && { - return std::move(AddHeader(std::move(header))); - } - // Vector is empty if header name is not found. // Header names are case-insensitive; header values are case-sensitive. - std::vector GetHeader(std::string header) const; + HttpHeader GetHeader(HttpHeaderName const& header) const; absl::optional local_ip_address() const { return local_ip_address_; diff --git a/google/cloud/internal/rest_context_test.cc b/google/cloud/internal/rest_context_test.cc index edc46bc91972c..82fd3c854b866 100644 --- a/google/cloud/internal/rest_context_test.cc +++ b/google/cloud/internal/rest_context_test.cc @@ -30,17 +30,17 @@ using ::testing::Pair; class RestContextTest : public ::testing::Test { protected: void SetUp() override { - headers_["header1"] = {"value1"}; - headers_["header2"] = {"value2a", "value2b"}; + headers_["header1"] = HttpHeader{"header1", "value1"}; + headers_["header2"] = HttpHeader{"header2", {"value2a", "value2b"}}; } - RestContext::HttpHeaders headers_; + HttpHeaders headers_; }; TEST_F(RestContextTest, RvalueBuilder) { auto context = RestContext() .AddHeader("header1", "value1") - .AddHeader(std::make_pair("header2", "value2a")) + .AddHeader(HttpHeader("header2", "value2a")) .AddHeader("header2", "value2b"); EXPECT_THAT(context.headers(), Contains(Pair("header1", ElementsAre("value1")))); diff --git a/google/cloud/internal/rest_opentelemetry.cc b/google/cloud/internal/rest_opentelemetry.cc index aaf2034dcd2e8..4d5d1d839b194 100644 --- a/google/cloud/internal/rest_opentelemetry.cc +++ b/google/cloud/internal/rest_opentelemetry.cc @@ -81,16 +81,16 @@ opentelemetry::nostd::shared_ptr MakeSpanHttp( {/*sc::kUrlFull=*/"url.full", request.path()}}, options); for (auto const& kv : request.headers()) { - auto const name = "http.request.header." + kv.first; - if (kv.second.empty()) { + auto const name = "http.request.header." + std::string{kv.first}; + if (kv.second.EmptyValues()) { span->SetAttribute(name, ""); continue; } if (absl::EqualsIgnoreCase(kv.first, "authorization")) { - span->SetAttribute(name, kv.second.front().substr(0, 32)); + span->SetAttribute(name, kv.second.values().front().substr(0, 32)); continue; } - span->SetAttribute(name, kv.second.front()); + span->SetAttribute(name, kv.second.values().front()); } return span; } diff --git a/google/cloud/internal/rest_opentelemetry_test.cc b/google/cloud/internal/rest_opentelemetry_test.cc index 672e60ab86f03..114a731871a76 100644 --- a/google/cloud/internal/rest_opentelemetry_test.cc +++ b/google/cloud/internal/rest_opentelemetry_test.cc @@ -42,7 +42,7 @@ TEST(RestOpentelemetry, MakeSpanHttp) { auto span_catcher = InstallSpanCatcher(); auto constexpr kUrl = "https://storage.googleapis.com/storage/v1/b/my-bucket"; - RestRequest request(kUrl, RestRequest::HttpHeaders{{"empty", {}}}); + RestRequest request(kUrl, HttpHeaders{{"empty", {}}}); auto const secret = std::string{"Bearer secret-0123456789aaaaabbbbbcccccddddd"}; ASSERT_THAT(secret.size(), Gt(static_cast(32))); @@ -81,7 +81,7 @@ TEST(RestOpentelemetry, MakeSpanHttp) { TEST(RestOpentelemetry, InjectTraceContext) { auto span_catcher = InstallSpanCatcher(); auto constexpr kUrl = "https://storage.googleapis.com/storage/v1/b/my-bucket"; - RestRequest request(kUrl, RestRequest::HttpHeaders{{"empty", {}}}); + RestRequest request(kUrl, HttpHeaders{{"empty", {}}}); auto span = MakeSpanHttp(request, "GET"); auto scope = opentelemetry::trace::Scope(span); diff --git a/google/cloud/internal/rest_pure_background_threads_impl.cc b/google/cloud/internal/rest_pure_background_threads_impl.cc new file mode 100644 index 0000000000000..525b92c0adb79 --- /dev/null +++ b/google/cloud/internal/rest_pure_background_threads_impl.cc @@ -0,0 +1,73 @@ +// Copyright 2026 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 "google/cloud/internal/rest_pure_background_threads_impl.h" +#include "google/cloud/future.h" +#include "google/cloud/internal/call_context.h" +#include "google/cloud/internal/rest_pure_completion_queue_impl.h" +#include "google/cloud/log.h" +#include +#include + +namespace google { +namespace cloud { +namespace rest_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AutomaticallyCreatedRestPureBackgroundThreads:: + AutomaticallyCreatedRestPureBackgroundThreads(std::size_t thread_count) + : cq_(std::make_shared()), + pool_(thread_count == 0 ? 1 : thread_count) { + std::generate_n(pool_.begin(), pool_.size(), [this] { + promise started; + auto thread = std::thread( + [](RestPureCompletionQueue cq, promise& started, + internal::CallContext c) { + internal::ScopedCallContext scope(std::move(c)); + started.set_value(); + cq.Run(); + }, + cq_, std::ref(started), internal::CallContext{}); + started.get_future().wait(); + return thread; + }); +} + +AutomaticallyCreatedRestPureBackgroundThreads:: + ~AutomaticallyCreatedRestPureBackgroundThreads() { + Shutdown(); +} + +void AutomaticallyCreatedRestPureBackgroundThreads::Shutdown() { + cq_.Shutdown(); + for (auto& t : pool_) { +#if GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS + try { +#endif + t.join(); +#if GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS + } catch (std::system_error const& e) { + GCP_LOG(FATAL) + << "AutomaticallyCreatedRestPureBackgroundThreads::Shutdown: " + << e.what(); + } +#endif + } + pool_.clear(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace rest_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/internal/rest_pure_background_threads_impl.h b/google/cloud/internal/rest_pure_background_threads_impl.h new file mode 100644 index 0000000000000..4061729dd7f63 --- /dev/null +++ b/google/cloud/internal/rest_pure_background_threads_impl.h @@ -0,0 +1,62 @@ +// Copyright 2026 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. + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_PURE_BACKGROUND_THREADS_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_PURE_BACKGROUND_THREADS_IMPL_H + +#include "google/cloud/internal/rest_pure_completion_queue_impl.h" +#include "google/cloud/version.h" +#include +#include + +namespace google { +namespace cloud { +namespace rest_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// This interface mimics `google::cloud::BackgroundThreads` except it returns +/// a `RestPureCompletionQueue` instead of a `CompletionQueue`. This is +/// important as `CompletionQueue` has gRPC dependencies we need to avoid in a +/// pure REST library. +class RestPureBackgroundThreads { + public: + virtual ~RestPureBackgroundThreads() = default; + + /// The completion queue used for the background operations. + virtual RestPureCompletionQueue cq() const = 0; +}; + +/// Background threads that run on a RestPureCompletionQueue. +class AutomaticallyCreatedRestPureBackgroundThreads + : public RestPureBackgroundThreads { + public: + explicit AutomaticallyCreatedRestPureBackgroundThreads( + std::size_t thread_count = 1U); + ~AutomaticallyCreatedRestPureBackgroundThreads() override; + + RestPureCompletionQueue cq() const override { return cq_; } + void Shutdown(); + std::size_t pool_size() const { return pool_.size(); } + + private: + RestPureCompletionQueue cq_; + std::vector pool_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace rest_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_PURE_BACKGROUND_THREADS_IMPL_H diff --git a/google/cloud/internal/rest_pure_completion_queue_impl.cc b/google/cloud/internal/rest_pure_completion_queue_impl.cc new file mode 100644 index 0000000000000..5eb70581d1358 --- /dev/null +++ b/google/cloud/internal/rest_pure_completion_queue_impl.cc @@ -0,0 +1,63 @@ +// Copyright 2026 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 "google/cloud/internal/rest_pure_completion_queue_impl.h" +#include "google/cloud/internal/timer_queue.h" + +namespace google { +namespace cloud { +namespace rest_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +RestPureCompletionQueue::RestPureCompletionQueue() + : impl_(std::make_shared()) {} + +RestPureCompletionQueueImpl::RestPureCompletionQueueImpl() + : tq_(internal::TimerQueue::Create()) {} + +void RestPureCompletionQueueImpl::Run() { tq_->Service(); } + +void RestPureCompletionQueueImpl::Shutdown() { tq_->Shutdown(); } + +void RestPureCompletionQueueImpl::CancelAll() {} + +future> +RestPureCompletionQueueImpl::MakeDeadlineTimer( + std::chrono::system_clock::time_point deadline) { + return tq_->Schedule(deadline); +} + +future> +RestPureCompletionQueueImpl::MakeRelativeTimer( + std::chrono::nanoseconds duration) { + using std::chrono::system_clock; + auto d = std::chrono::duration_cast(duration); + if (d < duration) d += system_clock::duration{1}; + return MakeDeadlineTimer(system_clock::now() + d); +} + +// Use an "immediately" expiring timer in order to get the thread(s) servicing +// the TimerQueue to execute the function. However, if the timer +// expires before .then() is invoked, the lambda will be immediately called and +// the passing of execution to the queue servicing thread will not occur. +void RestPureCompletionQueueImpl::RunAsync( + std::unique_ptr function) { + ++run_async_counter_; + tq_->Schedule([f = std::move(function)](auto) { f->exec(); }); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace rest_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/internal/rest_pure_completion_queue_impl.h b/google/cloud/internal/rest_pure_completion_queue_impl.h new file mode 100644 index 0000000000000..d1e8d77bcb365 --- /dev/null +++ b/google/cloud/internal/rest_pure_completion_queue_impl.h @@ -0,0 +1,266 @@ +// Copyright 2026 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. + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_PURE_COMPLETION_QUEUE_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_PURE_COMPLETION_QUEUE_IMPL_H + +#include "google/cloud/future.h" +#include "google/cloud/internal/run_async_base.h" +#include "google/cloud/internal/timer_queue.h" +#include "google/cloud/log.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace rest_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Interface for CompletionQueue that does NOT use a grpc::CompletionQueue. + * + * Due to the lack of a completion queue that can manage multiple, simultaneous + * REST requests, asynchronous calls should be launched on a thread of their own + * and RunAsync should only be called with a function to join that thread after + * it completes its work. + * + * This class differs from RestCompletionQueueImpl as it does not contain a + * method that returns a `grpc::CompletionQueue*` nor a `StartOperation` method + * as that method takes an `internal::AsyncGrpcOperation` as a parameter. + */ +class RestPureCompletionQueueInterface { + public: + virtual ~RestPureCompletionQueueInterface() = default; + + /// Run the event loop until Shutdown() is called. + virtual void Run() = 0; + + /// Terminate the event loop. + virtual void Shutdown() = 0; + + /// Cancel all existing operations. + virtual void CancelAll() = 0; + + /// Create a new timer. + virtual future> + MakeDeadlineTimer(std::chrono::system_clock::time_point deadline) = 0; + + /// Create a new timer. + virtual future> + MakeRelativeTimer(std::chrono::nanoseconds duration) = 0; + + /// Enqueue a new asynchronous function. + virtual void RunAsync(std::unique_ptr function) = 0; +}; + +class RestPureCompletionQueue; + +std::shared_ptr +GetRestPureCompletionQueueImpl(RestPureCompletionQueue const& cq); +std::shared_ptr +GetRestPureCompletionQueueImpl(RestPureCompletionQueue&& cq); + +template +using CheckRunAsyncCallback = + google::cloud::internal::is_invocable; + +/// A pure REST version of `google::cloud::CompletionQueue` that wraps an +/// implementation of `RestPureCompletionQueueInterface`. +class RestPureCompletionQueue { + public: + RestPureCompletionQueue(); + explicit RestPureCompletionQueue( + std::shared_ptr impl) + : impl_(std::move(impl)) {} + + /** + * Run the completion queue event loop. + * + * Note that more than one thread can call this member function, to create a + * pool of threads completing asynchronous operations. + */ + void Run() { impl_->Run(); } + + /// Terminate the completion queue event loop. + void Shutdown() { impl_->Shutdown(); } + + /// Cancel all pending operations. + void CancelAll() { impl_->CancelAll(); } + + /** + * Create a timer that fires at @p deadline. + * + * @param deadline when should the timer expire. + * + * @return a future that becomes satisfied after @p deadline. + * The result of the future is the time at which it expired, or an error + * Status if the timer did not run to expiration (e.g. it was cancelled). + */ + google::cloud::future> + MakeDeadlineTimer(std::chrono::system_clock::time_point deadline) { + return impl_->MakeDeadlineTimer(deadline); + } + + /** + * Create a timer that fires after the @p duration. + * + * @tparam Rep a placeholder to match the Rep tparam for @p duration 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 Period a placeholder to match the Period tparam for @p duration + * 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 duration when should the timer expire relative to the current time. + * + * @return a future that becomes satisfied after @p duration time has elapsed. + * The result of the future is the time at which it expired, or an error + * Status if the timer did not run to expiration (e.g. it was cancelled). + */ + template + future> MakeRelativeTimer( + std::chrono::duration duration) { + return impl_->MakeRelativeTimer( + std::chrono::duration_cast(duration)); + } + + /** + * Asynchronously run a functor on a thread `Run()`ning the `CompletionQueue`. + * + * @param functor the functor to invoke in one of the CompletionQueue's + * threads. + * + * @tparam Functor the type of @p functor. It must satisfy + * `std::is_invocable` + */ + template ::value, int> = 0 + /// @endcond + > + void RunAsync(Functor&& functor) { + class Wrapper : public internal::RunAsyncBase { + public: + Wrapper(std::weak_ptr impl, Functor&& f) + : impl_(std::move(impl)), fun_(std::forward(f)) {} + ~Wrapper() override = default; + void exec() override { + auto impl = impl_.lock(); + if (!impl) return; + RestPureCompletionQueue cq(std::move(impl)); + fun_(cq); + } + + private: + std::weak_ptr impl_; + std::decay_t fun_; + }; + impl_->RunAsync( + std::make_unique(impl_, std::forward(functor))); + } + + /** + * Asynchronously run a functor on a thread `Run()`ning the `CompletionQueue`. + * + * @param functor the functor to call in one of the CompletionQueue's threads. + * @tparam Functor the type of @p functor. It must satisfy + * `std::is_invocable`. + */ + template ::value, int> = 0 + /// @endcond + > + void RunAsync(Functor&& functor) { + class Wrapper : public internal::RunAsyncBase { + public: + explicit Wrapper(Functor&& f) : fun_(std::forward(f)) {} + ~Wrapper() override = default; + void exec() override { fun_(); } + + private: + std::decay_t fun_; + }; + impl_->RunAsync(std::make_unique(std::forward(functor))); + } + + private: + friend std::shared_ptr + GetRestPureCompletionQueueImpl(RestPureCompletionQueue const& cq); + friend std::shared_ptr + GetRestPureCompletionQueueImpl(RestPureCompletionQueue&& cq); + std::shared_ptr impl_; +}; + +inline std::shared_ptr +GetRestPureCompletionQueueImpl(RestPureCompletionQueue const& cq) { + return cq.impl_; +} + +inline std::shared_ptr +GetRestPureCompletionQueueImpl(RestPureCompletionQueue&& cq) { + return std::move(cq.impl_); +} + +/// Default implementation of `RestPureCompletionQueueInterface` that uses a +/// `TimerQueue` under the hood. +class RestPureCompletionQueueImpl final + : public RestPureCompletionQueueInterface, + public std::enable_shared_from_this { + public: + ~RestPureCompletionQueueImpl() override = default; + RestPureCompletionQueueImpl(); + + /// Run the event loop until Shutdown() is called. + void Run() override; + + /// Terminate the event loop. + void Shutdown() override; + + /// Cancel all existing operations. + void CancelAll() override; + + /// Create a new timer. + future> MakeDeadlineTimer( + std::chrono::system_clock::time_point deadline) override; + + /// Create a new timer. + future> MakeRelativeTimer( + std::chrono::nanoseconds duration) override; + + /// Enqueue a new asynchronous function. + void RunAsync(std::unique_ptr function) override; + + /// Some counters for testing and debugging. + std::int64_t run_async_counter() const { return run_async_counter_.load(); } + + private: + std::shared_ptr tq_; + // These are metrics used in testing. + std::atomic run_async_counter_{0}; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace rest_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_PURE_COMPLETION_QUEUE_IMPL_H diff --git a/google/cloud/internal/rest_request.cc b/google/cloud/internal/rest_request.cc index 778fc673b6d82..cee621e5f83b5 100644 --- a/google/cloud/internal/rest_request.cc +++ b/google/cloud/internal/rest_request.cc @@ -23,33 +23,19 @@ namespace google { namespace cloud { namespace rest_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -namespace { - -// NOLINTNEXTLINE(performance-unnecessary-value-param) -RestRequest::HttpHeaders NormalizeHeaders(RestRequest::HttpHeaders headers) { - RestRequest::HttpHeaders result; - for (auto& kv : headers) { - auto& entry = result[absl::AsciiStrToLower(kv.first)]; - entry.insert(entry.end(), std::make_move_iterator(kv.second.begin()), - std::make_move_iterator(kv.second.end())); - } - return result; -} - -} // namespace RestRequest::RestRequest() = default; RestRequest::RestRequest(std::string path) : path_(std::move(path)) {} RestRequest::RestRequest(RestContext const& rest_context) - : headers_(NormalizeHeaders(rest_context.headers())) {} + : headers_(rest_context.headers()) {} RestRequest::RestRequest(std::string path, HttpHeaders headers) - : path_(std::move(path)), headers_(NormalizeHeaders(std::move(headers))) {} + : path_(std::move(path)), headers_(std::move(headers)) {} RestRequest::RestRequest(std::string path, HttpParameters parameters) : path_(std::move(path)), parameters_(std::move(parameters)) {} RestRequest::RestRequest(std::string path, HttpHeaders headers, HttpParameters parameters) : path_(std::move(path)), - headers_(NormalizeHeaders(std::move(headers))), + headers_(std::move(headers)), parameters_(std::move(parameters)) {} RestRequest& RestRequest::SetPath(std::string path) & { @@ -64,21 +50,18 @@ RestRequest& RestRequest::AppendPath(std::string path) & { return *this; } -RestRequest& RestRequest::AddHeader(std::string header, std::string value) & { - absl::AsciiStrToLower(&header); - auto iter = headers_.find(header); +RestRequest& RestRequest::AddHeader(HttpHeader header) & { + auto iter = headers_.find(header.name()); if (iter == headers_.end()) { - std::vector v = {std::move(value)}; - headers_.emplace(std::move(header), std::move(v)); + headers_.emplace(header.name(), std::move(header)); } else { - iter->second.push_back(value); + iter->second.MergeHeader(std::move(header)); } return *this; } -RestRequest& RestRequest::AddHeader( - std::pair header) & { - return AddHeader(std::move(header.first), std::move(header.second)); +RestRequest& RestRequest::AddHeader(std::string header, std::string value) & { + return AddHeader(HttpHeader(std::move(header), std::move(value))); } RestRequest& RestRequest::AddQueryParameter(std::string parameter, @@ -93,8 +76,7 @@ RestRequest& RestRequest::AddQueryParameter( std::move(parameter.second)); } -std::vector RestRequest::GetHeader(std::string header) const { - absl::AsciiStrToLower(&header); +HttpHeader RestRequest::GetHeader(HttpHeaderName const& header) const { auto iter = headers_.find(header); if (iter == headers_.end()) { return {}; diff --git a/google/cloud/internal/rest_request.h b/google/cloud/internal/rest_request.h index 4fb4ad052bb76..44150be1928b6 100644 --- a/google/cloud/internal/rest_request.h +++ b/google/cloud/internal/rest_request.h @@ -15,10 +15,9 @@ #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_REQUEST_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_REST_REQUEST_H +#include "google/cloud/internal/http_header.h" #include "google/cloud/internal/rest_context.h" -#include "google/cloud/status_or.h" #include "google/cloud/version.h" -#include #include namespace google { @@ -34,7 +33,6 @@ class RestClient; // payload if required. class RestRequest { public: - using HttpHeaders = std::unordered_map>; using HttpParameters = std::vector>; RestRequest(); @@ -60,14 +58,15 @@ class RestRequest { // Adding a header/value pair that already exists results in the new value // appended to the list of values for the existing header. + RestRequest& AddHeader(HttpHeader header) &; + RestRequest&& AddHeader(HttpHeader header) && { + return std::move(AddHeader(std::move(header))); + } + RestRequest& AddHeader(std::string header, std::string value) &; RestRequest&& AddHeader(std::string header, std::string value) && { return std::move(AddHeader(std::move(header), std::move(value))); } - RestRequest& AddHeader(std::pair header) &; - RestRequest&& AddHeader(std::pair header) && { - return std::move(AddHeader(std::move(header))); - } // Adding a duplicate param and or value results in both the new and original // pairs stored in order of addition. @@ -84,7 +83,7 @@ class RestRequest { // Vector is empty if header name is not found. // Header names are case-insensitive; header values are case-sensitive. - std::vector GetHeader(std::string header) const; + HttpHeader GetHeader(HttpHeaderName const& header) const; // Returns all values associated with parameter name. // Parameter names and values are case-sensitive. diff --git a/google/cloud/internal/rest_request_test.cc b/google/cloud/internal/rest_request_test.cc index 6c5ff0620e419..a498a913a0363 100644 --- a/google/cloud/internal/rest_request_test.cc +++ b/google/cloud/internal/rest_request_test.cc @@ -27,12 +27,12 @@ using ::testing::Eq; class RestRequestTest : public ::testing::Test { protected: void SetUp() override { - headers_["Header1"] = {"value1"}; - headers_["header2"] = {"value2a", "value2b"}; + headers_["header1"] = {"Header1", "value1"}; + headers_["header2"] = {"header2", {"value2a", "value2b"}}; parameters_.emplace_back("param1", "value1"); } - RestRequest::HttpHeaders headers_; + HttpHeaders headers_; RestRequest::HttpParameters parameters_; }; @@ -49,10 +49,10 @@ TEST_F(RestRequestTest, ConstructorPathHeaders) { EXPECT_TRUE(request.parameters().empty()); EXPECT_THAT( request.headers(), - Contains(std::make_pair("header1", std::vector{"value1"}))); + Contains(std::make_pair("header1", HttpHeader("header1", "value1")))); EXPECT_THAT(request.headers(), Contains(std::make_pair( - "header2", std::vector{"value2a", "value2b"}))); + "header2", HttpHeader("header2", {"value2a", "value2b"})))); } TEST_F(RestRequestTest, ConstructorPathParameters) { @@ -68,10 +68,10 @@ TEST_F(RestRequestTest, ConstructorPathHeadersParameters) { EXPECT_THAT(request.path(), Eq("foo/bar")); EXPECT_THAT( request.headers(), - Contains(std::make_pair("header1", std::vector{"value1"}))); + Contains(std::make_pair("header1", HttpHeader{"header1", "value1"}))); EXPECT_THAT(request.headers(), Contains(std::make_pair( - "header2", std::vector{"value2a", "value2b"}))); + "header2", HttpHeader{"header2", {"value2a", "value2b"}}))); EXPECT_THAT(request.parameters(), Contains(std::make_pair("param1", "value1"))); } @@ -80,17 +80,17 @@ TEST_F(RestRequestTest, RvalueBuilder) { auto request = RestRequest() .SetPath("foo/bar") .AddHeader("header1", "value1") - .AddHeader(std::make_pair("header2", "value2a")) + .AddHeader(HttpHeader("header2", "value2a")) .AddHeader("header2", "value2b") .AddQueryParameter("param1", "value1") .AddQueryParameter(std::make_pair("param2", "value2")); EXPECT_THAT(request.path(), Eq("foo/bar")); EXPECT_THAT( request.headers(), - Contains(std::make_pair("header1", std::vector{"value1"}))); + Contains(std::make_pair("header1", HttpHeader{"header1", "value1"}))); EXPECT_THAT(request.headers(), Contains(std::make_pair( - "header2", std::vector{"value2a", "value2b"}))); + "header2", HttpHeader{"header2", {"value2a", "value2b"}}))); ASSERT_THAT(request.parameters().size(), Eq(2)); EXPECT_THAT(request.parameters()[0], Eq(std::make_pair(std::string("param1"), std::string("value1")))); @@ -120,11 +120,11 @@ TEST_F(RestRequestTest, GetHeaderNotFound) { TEST_F(RestRequestTest, GetHeaderFound) { RestRequest request("foo/bar", headers_); auto result = request.GetHeader("Header1"); - EXPECT_THAT(result.size(), Eq(1)); - EXPECT_THAT(result, Contains("value1")); + EXPECT_THAT(result.values().size(), Eq(1)); + EXPECT_THAT(result.values(), Contains("value1")); result = request.GetHeader("header1"); - EXPECT_THAT(result.size(), Eq(1)); - EXPECT_THAT(result, Contains("value1")); + EXPECT_THAT(result.values().size(), Eq(1)); + EXPECT_THAT(result.values(), Contains("value1")); } TEST_F(RestRequestTest, GetQueryParameterNotFound) { diff --git a/google/cloud/internal/rest_response.cc b/google/cloud/internal/rest_response.cc index 53383bfe2b779..7eb750e3e40d6 100644 --- a/google/cloud/internal/rest_response.cc +++ b/google/cloud/internal/rest_response.cc @@ -120,6 +120,9 @@ StatusCode MapHttpCodeToStatus5xx(std::int32_t code) { if (code == HttpStatusCode::kServiceUnavailable) { return StatusCode::kUnavailable; } + if (code == HttpStatusCode::kGatewayTimeout) { + return StatusCode::kUnavailable; + } // 5XX - server errors are mapped to kInternal. return StatusCode::kInternal; } @@ -153,8 +156,12 @@ Status AsStatus(HttpStatusCode http_status_code, std::string payload) { if (payload.empty()) { // If there's no payload, create one to make sure the original http status // code received is available. - return Status(status_code, "Received HTTP status code: " + - std::to_string(http_status_code)); + ErrorInfo error_info{ + {}, {}, {{"http_status_code", std::to_string(http_status_code)}}}; + return Status( + status_code, + "Received HTTP status code: " + std::to_string(http_status_code), + std::move(error_info)); } auto p = ParseJsonError(static_cast(http_status_code), std::move(payload)); diff --git a/google/cloud/internal/rest_response.h b/google/cloud/internal/rest_response.h index 2a5aae8a50db4..0cb7bb0ea6f50 100644 --- a/google/cloud/internal/rest_response.h +++ b/google/cloud/internal/rest_response.h @@ -67,6 +67,7 @@ enum HttpStatusCode : std::int32_t { kInternalServerError = 500, kBadGateway = 502, kServiceUnavailable = 503, + kGatewayTimeout = 504, }; // This class contains the results of making a request to a RESTful service. diff --git a/google/cloud/internal/rest_response_test.cc b/google/cloud/internal/rest_response_test.cc index 1d2245095b915..7a9f0878fbeda 100644 --- a/google/cloud/internal/rest_response_test.cc +++ b/google/cloud/internal/rest_response_test.cc @@ -83,7 +83,8 @@ INSTANTIATE_TEST_SUITE_P( std::make_pair(HttpStatusCode::kBadGateway, StatusCode::kUnavailable), std::make_pair(HttpStatusCode::kServiceUnavailable, StatusCode::kUnavailable), - std::make_pair(static_cast(504), StatusCode::kInternal), + std::make_pair(HttpStatusCode::kGatewayTimeout, + StatusCode::kUnavailable), std::make_pair(static_cast(601), StatusCode::kUnknown)), [](testing::TestParamInfo const& info) { return std::to_string(std::get<0>(info.param)); @@ -135,6 +136,8 @@ TEST(AsStatus, RestResponseIsNotOkNoPayload) { EXPECT_THAT(status, StatusIs(StatusCode::kNotFound)); EXPECT_THAT(status.message(), Eq("Received HTTP status code: 404")); EXPECT_TRUE(status.error_info().reason().empty()); + EXPECT_THAT(status.error_info().metadata(), + Contains(::testing::Pair("http_status_code", "404"))); } TEST(AsStatus, RestResponseIsNotOkPayload) { diff --git a/google/cloud/internal/run_async_base.h b/google/cloud/internal/run_async_base.h new file mode 100644 index 0000000000000..e01e99be6f65d --- /dev/null +++ b/google/cloud/internal/run_async_base.h @@ -0,0 +1,36 @@ +// Copyright 2026 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. + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_RUN_ASYNC_BASE_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_RUN_ASYNC_BASE_H + +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace internal { + +// Type erase the callables in RunAsync() +struct RunAsyncBase { + virtual ~RunAsyncBase() = default; + virtual void exec() = 0; +}; + +} // namespace internal +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_RUN_ASYNC_BASE_H diff --git a/google/cloud/internal/tracing_rest_client.cc b/google/cloud/internal/tracing_rest_client.cc index 84139c2ef3dd5..0e92b092919e7 100644 --- a/google/cloud/internal/tracing_rest_client.cc +++ b/google/cloud/internal/tracing_rest_client.cc @@ -71,21 +71,22 @@ StatusOr> EndResponseSpan( *context.local_port()); } for (auto const& kv : context.headers()) { - auto const name = "http.request.header." + kv.first; - if (kv.second.empty()) { + auto const name = "http.request.header." + std::string{kv.first}; + if (kv.second.EmptyValues()) { span->SetAttribute(name, ""); continue; } if (absl::EqualsIgnoreCase(kv.first, "authorization")) { - span->SetAttribute(name, kv.second.front().substr(0, 32)); + span->SetAttribute(name, kv.second.values().front().substr(0, 32)); continue; } if (absl::EqualsIgnoreCase(kv.first, "x-goog-api-key")) { span->SetAttribute( - name, kv.second.front().substr(0, kApiKeyHintLength) + "..."); + name, + kv.second.values().front().substr(0, kApiKeyHintLength) + "..."); continue; } - span->SetAttribute(name, kv.second.front()); + span->SetAttribute(name, kv.second.values().front()); } if (!request_result || !(*request_result)) { return internal::EndSpan(*span, std::move(request_result)); diff --git a/google/cloud/internal/unified_rest_credentials.cc b/google/cloud/internal/unified_rest_credentials.cc index 34c9ef726c53d..596617c57d7d9 100644 --- a/google/cloud/internal/unified_rest_credentials.cc +++ b/google/cloud/internal/unified_rest_credentials.cc @@ -81,9 +81,10 @@ std::shared_ptr MapCredentials( void visit(GoogleDefaultCredentialsConfig const& cfg) override { auto credentials = google::cloud::oauth2_internal::GoogleDefaultCredentials( - cfg.options(), std::move(client_factory_)); + cfg.options(), client_factory_); if (credentials) { - result = Decorate(*std::move(credentials), cfg.options()); + result = Decorate(*std::move(credentials), std::move(client_factory_), + cfg.options()); return; } result = MakeErrorCredentials(std::move(credentials).status()); @@ -97,19 +98,20 @@ std::shared_ptr MapCredentials( void visit(ImpersonateServiceAccountConfig const& cfg) override { result = std::make_shared< oauth2_internal::ImpersonateServiceAccountCredentials>( - cfg, std::move(client_factory_)); - result = Decorate(std::move(result), cfg.options()); + cfg, client_factory_); + result = Decorate(std::move(result), std::move(client_factory_), + cfg.options()); } void visit(ServiceAccountConfig const& cfg) override { StatusOr> creds; if (cfg.file_path().has_value()) { creds = oauth2_internal::CreateServiceAccountCredentialsFromFilePath( - *cfg.file_path(), cfg.options(), std::move(client_factory_)); + *cfg.file_path(), cfg.options(), client_factory_); } else if (cfg.json_object().has_value()) { creds = oauth2_internal::CreateServiceAccountCredentialsFromJsonContents( - *cfg.json_object(), cfg.options(), std::move(client_factory_)); + *cfg.json_object(), cfg.options(), client_factory_); } else { creds = MakeErrorCredentials(internal::InternalError( "ServiceAccountConfig has neither json_object nor file_path", @@ -117,7 +119,7 @@ std::shared_ptr MapCredentials( } if (creds.ok()) { - result = Decorate(*creds, cfg.options()); + result = Decorate(*creds, std::move(client_factory_), cfg.options()); } else { result = MakeErrorCredentials(std::move(creds).status()); } @@ -131,10 +133,11 @@ std::shared_ptr MapCredentials( result = MakeErrorCredentials(std::move(info).status()); return; } - result = Decorate( + auto creds = std::make_shared( - *std::move(info), std::move(client_factory_), cfg.options()), - cfg.options()); + *std::move(info), client_factory_, cfg.options()); + result = + Decorate(std::move(creds), std::move(client_factory_), cfg.options()); } void visit(ApiKeyConfig const& cfg) override { @@ -143,11 +146,11 @@ std::shared_ptr MapCredentials( } void visit(ComputeEngineCredentialsConfig const& cfg) override { - result = Decorate( - std::make_shared< - google::cloud::oauth2_internal::ComputeEngineCredentials>( - cfg.options(), std::move(client_factory_)), - cfg.options()); + auto creds = std::make_shared< + google::cloud::oauth2_internal::ComputeEngineCredentials>( + cfg.options(), client_factory_); + result = + Decorate(std::move(creds), std::move(client_factory_), cfg.options()); } private: diff --git a/google/cloud/internal/unified_rest_credentials_test.cc b/google/cloud/internal/unified_rest_credentials_test.cc index 48760cfa8f0ca..ab66fa764858d 100644 --- a/google/cloud/internal/unified_rest_credentials_test.cc +++ b/google/cloud/internal/unified_rest_credentials_test.cc @@ -244,7 +244,7 @@ TEST(UnifiedRestCredentialsTest, AdcIsComputeEngine) { ScopedEnvironment(oauth2_internal::GoogleGcloudAdcFileEnvVar(), filename); auto const now = std::chrono::system_clock::now(); - auto metadata_client = []() { + auto metadata_client_1 = []() { auto client = std::make_unique(); auto expected_request = AllOf( Property(&RestRequest::path, @@ -258,6 +258,27 @@ TEST(UnifiedRestCredentialsTest, AdcIsComputeEngine) { Status{StatusCode::kPermissionDenied, "uh-oh - GCE metadata"})); return client; }(); + + // TODO(#16079): Remove conditional and else clause when GA. +#ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB + // If the first MDS call is not successful in updating the service account + // email, we will try again. + auto metadata_client_2 = []() { + auto client = std::make_unique(); + auto expected_request = AllOf( + Property(&RestRequest::path, + absl::StrCat("http://metadata.google.internal/", + "computeMetadata/v1/instance/service-accounts/", + "default/")), + Property(&RestRequest::headers, + Contains(Pair("metadata-flavor", Contains("Google"))))); + EXPECT_CALL(*client, Get(_, expected_request)) + .WillOnce(Return( + Status{StatusCode::kPermissionDenied, "uh-oh - GCE metadata"})); + return client; + }(); +#endif + auto token_client = []() { auto client = std::make_unique(); auto expected_request = AllOf( @@ -275,7 +296,11 @@ TEST(UnifiedRestCredentialsTest, AdcIsComputeEngine) { MockClientFactory client_factory; EXPECT_CALL(client_factory, Call) - .WillOnce(Return(ByMove(std::move(metadata_client)))) + .WillOnce(Return(ByMove(std::move(metadata_client_1)))) + // TODO(#16079): Remove conditional and else clause when GA. +#ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB + .WillOnce(Return(ByMove(std::move(metadata_client_2)))) +#endif .WillOnce(Return(ByMove(std::move(token_client)))); auto const config = internal::GoogleDefaultCredentialsConfig(Options{}); @@ -470,8 +495,9 @@ TEST(UnifiedRestCredentialsTest, ApiKey) { ASSERT_THAT(oauth2_creds, NotNull()); auto header = - oauth2_creds->AuthenticationHeader(std::chrono::system_clock::now()); - EXPECT_THAT(header, IsOkAndHolds(Pair("x-goog-api-key", "api-key"))); + oauth2_creds->AuthenticationHeaders(std::chrono::system_clock::now(), ""); + EXPECT_THAT(header, + IsOkAndHolds(Contains(HttpHeader("x-goog-api-key", "api-key")))); } TEST(UnifiedRestCredentialsTest, LoadError) { diff --git a/google/cloud/internal/version_info.h b/google/cloud/internal/version_info.h index d205f3a1bf3db..27173b2d238b8 100644 --- a/google/cloud/internal/version_info.h +++ b/google/cloud/internal/version_info.h @@ -18,9 +18,9 @@ // NOLINTNEXTLINE(modernize-macro-to-enum) #define GOOGLE_CLOUD_CPP_VERSION_MAJOR 3 // NOLINTNEXTLINE(modernize-macro-to-enum) -#define GOOGLE_CLOUD_CPP_VERSION_MINOR 2 +#define GOOGLE_CLOUD_CPP_VERSION_MINOR 5 // NOLINTNEXTLINE(modernize-macro-to-enum) #define GOOGLE_CLOUD_CPP_VERSION_PATCH 0 -#define GOOGLE_CLOUD_CPP_VERSION_PRE_RELEASE "" +#define GOOGLE_CLOUD_CPP_VERSION_PRE_RELEASE "rc" #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_VERSION_INFO_H diff --git a/google/cloud/kms/quickstart/.bazelversion b/google/cloud/kms/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/kms/quickstart/.bazelversion +++ b/google/cloud/kms/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/kms/quickstart/WORKSPACE.bazel b/google/cloud/kms/quickstart/WORKSPACE.bazel index 7254eb70e66a1..ddecbc96da011 100644 --- a/google/cloud/kms/quickstart/WORKSPACE.bazel +++ b/google/cloud/kms/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/language/quickstart/.bazelversion b/google/cloud/language/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/language/quickstart/.bazelversion +++ b/google/cloud/language/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/language/quickstart/WORKSPACE.bazel b/google/cloud/language/quickstart/WORKSPACE.bazel index eb7167918abce..71f2d02717dc9 100644 --- a/google/cloud/language/quickstart/WORKSPACE.bazel +++ b/google/cloud/language/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/licensemanager/quickstart/WORKSPACE.bazel b/google/cloud/licensemanager/quickstart/WORKSPACE.bazel index 773d58393780a..c91586eb0b3d0 100644 --- a/google/cloud/licensemanager/quickstart/WORKSPACE.bazel +++ b/google/cloud/licensemanager/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/licensemanager/v1/license_manager_client.h b/google/cloud/licensemanager/v1/license_manager_client.h index e6ba530eb27b6..a526896164afc 100644 --- a/google/cloud/licensemanager/v1/license_manager_client.h +++ b/google/cloud/licensemanager/v1/license_manager_client.h @@ -1511,7 +1511,7 @@ class LicenseManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1550,7 +1550,7 @@ class LicenseManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/logging/quickstart/.bazelversion b/google/cloud/logging/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/logging/quickstart/.bazelversion +++ b/google/cloud/logging/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/logging/quickstart/WORKSPACE.bazel b/google/cloud/logging/quickstart/WORKSPACE.bazel index 514ddfa450182..62b280425a89c 100644 --- a/google/cloud/logging/quickstart/WORKSPACE.bazel +++ b/google/cloud/logging/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/logging/v2/config_service_v2_client.h b/google/cloud/logging/v2/config_service_v2_client.h index d83861f0f3c04..e70480951ab09 100644 --- a/google/cloud/logging/v2/config_service_v2_client.h +++ b/google/cloud/logging/v2/config_service_v2_client.h @@ -2314,7 +2314,7 @@ class ConfigServiceV2Client { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2353,7 +2353,7 @@ class ConfigServiceV2Client { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/logging/v2/logging_service_v2_client.h b/google/cloud/logging/v2/logging_service_v2_client.h index f794b8083c100..b7374050b3380 100644 --- a/google/cloud/logging/v2/logging_service_v2_client.h +++ b/google/cloud/logging/v2/logging_service_v2_client.h @@ -680,7 +680,7 @@ class LoggingServiceV2Client { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -719,7 +719,7 @@ class LoggingServiceV2Client { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/logging/v2/metrics_service_v2_client.h b/google/cloud/logging/v2/metrics_service_v2_client.h index dc9b0d6aedb32..ea40eba9696dd 100644 --- a/google/cloud/logging/v2/metrics_service_v2_client.h +++ b/google/cloud/logging/v2/metrics_service_v2_client.h @@ -563,7 +563,7 @@ class MetricsServiceV2Client { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -602,7 +602,7 @@ class MetricsServiceV2Client { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/lustre/quickstart/WORKSPACE.bazel b/google/cloud/lustre/quickstart/WORKSPACE.bazel index 175079e3dd7fb..3a0204afd3069 100644 --- a/google/cloud/lustre/quickstart/WORKSPACE.bazel +++ b/google/cloud/lustre/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/lustre/v1/lustre_client.h b/google/cloud/lustre/v1/lustre_client.h index 5c1f6663d926c..213553864c400 100644 --- a/google/cloud/lustre/v1/lustre_client.h +++ b/google/cloud/lustre/v1/lustre_client.h @@ -1049,7 +1049,7 @@ class LustreClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1088,7 +1088,7 @@ class LustreClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/maintenance/quickstart/WORKSPACE.bazel b/google/cloud/maintenance/quickstart/WORKSPACE.bazel index 87a9f136efb8a..f407dcfad5b26 100644 --- a/google/cloud/maintenance/quickstart/WORKSPACE.bazel +++ b/google/cloud/maintenance/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/managedidentities/quickstart/.bazelversion b/google/cloud/managedidentities/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/managedidentities/quickstart/.bazelversion +++ b/google/cloud/managedidentities/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/managedidentities/quickstart/WORKSPACE.bazel b/google/cloud/managedidentities/quickstart/WORKSPACE.bazel index e3d6e6954de94..a50602a470a5e 100644 --- a/google/cloud/managedidentities/quickstart/WORKSPACE.bazel +++ b/google/cloud/managedidentities/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/managedkafka/quickstart/.bazelversion b/google/cloud/managedkafka/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/managedkafka/quickstart/.bazelversion +++ b/google/cloud/managedkafka/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/managedkafka/quickstart/WORKSPACE.bazel b/google/cloud/managedkafka/quickstart/WORKSPACE.bazel index 462ec7fef26d6..6e704a9fec1c8 100644 --- a/google/cloud/managedkafka/quickstart/WORKSPACE.bazel +++ b/google/cloud/managedkafka/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/managedkafka/schemaregistry/v1/managed_schema_registry_client.h b/google/cloud/managedkafka/schemaregistry/v1/managed_schema_registry_client.h index 36ba777e3c487..a0ae9ad522ce1 100644 --- a/google/cloud/managedkafka/schemaregistry/v1/managed_schema_registry_client.h +++ b/google/cloud/managedkafka/schemaregistry/v1/managed_schema_registry_client.h @@ -2113,7 +2113,7 @@ class ManagedSchemaRegistryClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2152,7 +2152,7 @@ class ManagedSchemaRegistryClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/managedkafka/v1/managed_kafka_client.h b/google/cloud/managedkafka/v1/managed_kafka_client.h index 5a5d942fb4d98..0e7fc3b7bd492 100644 --- a/google/cloud/managedkafka/v1/managed_kafka_client.h +++ b/google/cloud/managedkafka/v1/managed_kafka_client.h @@ -1886,7 +1886,7 @@ class ManagedKafkaClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1925,7 +1925,7 @@ class ManagedKafkaClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/memcache/quickstart/.bazelversion b/google/cloud/memcache/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/memcache/quickstart/.bazelversion +++ b/google/cloud/memcache/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/memcache/quickstart/WORKSPACE.bazel b/google/cloud/memcache/quickstart/WORKSPACE.bazel index 092ef3ffef535..df1dfc5e59ea5 100644 --- a/google/cloud/memcache/quickstart/WORKSPACE.bazel +++ b/google/cloud/memcache/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/memcache/v1/cloud_memcache_client.h b/google/cloud/memcache/v1/cloud_memcache_client.h index 4ac2c9a7cbc1a..9eaa528f2cdd3 100644 --- a/google/cloud/memcache/v1/cloud_memcache_client.h +++ b/google/cloud/memcache/v1/cloud_memcache_client.h @@ -1263,7 +1263,7 @@ class CloudMemcacheClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1302,7 +1302,7 @@ class CloudMemcacheClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/memorystore/quickstart/WORKSPACE.bazel b/google/cloud/memorystore/quickstart/WORKSPACE.bazel index 7198f8c8e0d74..ed5f27a94102e 100644 --- a/google/cloud/memorystore/quickstart/WORKSPACE.bazel +++ b/google/cloud/memorystore/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.cc b/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.cc index 09c34e7faeef5..fe2f0aa2e5f7a 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.cc @@ -145,6 +145,17 @@ MemorystoreAuth::GetCertificateAuthority( return child_->GetCertificateAuthority(context, options, request); } +StatusOr +MemorystoreAuth::GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetSharedRegionalCertificateAuthority(context, options, + request); +} + future> MemorystoreAuth::AsyncRescheduleMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.h b/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.h index 34674275f5973..37a98749da4ee 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.h +++ b/google/cloud/memorystore/v1/internal/memorystore_auth_decorator.h @@ -94,6 +94,12 @@ class MemorystoreAuth : public MemorystoreStub { google::cloud::memorystore::v1::GetCertificateAuthorityRequest const& request) override; + StatusOr + GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> AsyncRescheduleMaintenance( google::cloud::CompletionQueue& cq, std::shared_ptr context, diff --git a/google/cloud/memorystore/v1/internal/memorystore_connection_impl.cc b/google/cloud/memorystore/v1/internal/memorystore_connection_impl.cc index 2e07d3096abaf..123343fa206f0 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_connection_impl.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_connection_impl.cc @@ -409,6 +409,24 @@ MemorystoreConnectionImpl::GetCertificateAuthority( *current, request, __func__); } +StatusOr +MemorystoreConnectionImpl::GetSharedRegionalCertificateAuthority( + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetSharedRegionalCertificateAuthority( + request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + return stub_->GetSharedRegionalCertificateAuthority(context, options, + request); + }, + *current, request, __func__); +} + future> MemorystoreConnectionImpl::RescheduleMaintenance( google::cloud::memorystore::v1::RescheduleMaintenanceRequest const& diff --git a/google/cloud/memorystore/v1/internal/memorystore_connection_impl.h b/google/cloud/memorystore/v1/internal/memorystore_connection_impl.h index 6d01a2a3504e0..26214e1a38a5e 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_connection_impl.h +++ b/google/cloud/memorystore/v1/internal/memorystore_connection_impl.h @@ -99,6 +99,11 @@ class MemorystoreConnectionImpl : public memorystore_v1::MemorystoreConnection { google::cloud::memorystore::v1::GetCertificateAuthorityRequest const& request) override; + StatusOr + GetSharedRegionalCertificateAuthority( + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> RescheduleMaintenance( google::cloud::memorystore::v1::RescheduleMaintenanceRequest const& diff --git a/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.cc b/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.cc index cea8f99fc2ef9..b077c80817691 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.cc @@ -172,6 +172,21 @@ MemorystoreLogging::GetCertificateAuthority( context, options, request, __func__, tracing_options_); } +StatusOr +MemorystoreLogging::GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + return child_->GetSharedRegionalCertificateAuthority(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + future> MemorystoreLogging::AsyncRescheduleMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.h b/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.h index e530f8bee50a0..dc09744ccbbf4 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.h +++ b/google/cloud/memorystore/v1/internal/memorystore_logging_decorator.h @@ -94,6 +94,12 @@ class MemorystoreLogging : public MemorystoreStub { google::cloud::memorystore::v1::GetCertificateAuthorityRequest const& request) override; + StatusOr + GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> AsyncRescheduleMaintenance( google::cloud::CompletionQueue& cq, std::shared_ptr context, diff --git a/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.cc b/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.cc index 5854060114af0..23971741b0056 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.cc @@ -138,6 +138,17 @@ MemorystoreMetadata::GetCertificateAuthority( return child_->GetCertificateAuthority(context, options, request); } +StatusOr +MemorystoreMetadata::GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetSharedRegionalCertificateAuthority(context, options, + request); +} + future> MemorystoreMetadata::AsyncRescheduleMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.h b/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.h index 75bab966cdf35..7794480678efa 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.h +++ b/google/cloud/memorystore/v1/internal/memorystore_metadata_decorator.h @@ -94,6 +94,12 @@ class MemorystoreMetadata : public MemorystoreStub { google::cloud::memorystore::v1::GetCertificateAuthorityRequest const& request) override; + StatusOr + GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> AsyncRescheduleMaintenance( google::cloud::CompletionQueue& cq, std::shared_ptr context, diff --git a/google/cloud/memorystore/v1/internal/memorystore_stub.cc b/google/cloud/memorystore/v1/internal/memorystore_stub.cc index c715b252b667d..014d26d0bb042 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_stub.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_stub.cc @@ -162,6 +162,20 @@ DefaultMemorystoreStub::GetCertificateAuthority( return response; } +StatusOr +DefaultMemorystoreStub::GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const&, + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + google::cloud::memorystore::v1::SharedRegionalCertificateAuthority response; + auto status = grpc_stub_->GetSharedRegionalCertificateAuthority( + &context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + future> DefaultMemorystoreStub::AsyncRescheduleMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/memorystore/v1/internal/memorystore_stub.h b/google/cloud/memorystore/v1/internal/memorystore_stub.h index 7c4cf71efd0f7..b8b095a656a77 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_stub.h +++ b/google/cloud/memorystore/v1/internal/memorystore_stub.h @@ -87,6 +87,13 @@ class MemorystoreStub { google::cloud::memorystore::v1::GetCertificateAuthorityRequest const& request) = 0; + virtual StatusOr< + google::cloud::memorystore::v1::SharedRegionalCertificateAuthority> + GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) = 0; + virtual future> AsyncRescheduleMaintenance( google::cloud::CompletionQueue& cq, @@ -256,6 +263,12 @@ class DefaultMemorystoreStub : public MemorystoreStub { google::cloud::memorystore::v1::GetCertificateAuthorityRequest const& request) override; + StatusOr + GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> AsyncRescheduleMaintenance( google::cloud::CompletionQueue& cq, std::shared_ptr context, diff --git a/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.cc b/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.cc index d8bdf7b00f138..639f90b41b70f 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.cc @@ -148,6 +148,18 @@ MemorystoreTracingConnection::GetCertificateAuthority( return internal::EndSpan(*span, child_->GetCertificateAuthority(request)); } +StatusOr +MemorystoreTracingConnection::GetSharedRegionalCertificateAuthority( + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + auto span = internal::MakeSpan( + "memorystore_v1::MemorystoreConnection::" + "GetSharedRegionalCertificateAuthority"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan( + *span, child_->GetSharedRegionalCertificateAuthority(request)); +} + future> MemorystoreTracingConnection::RescheduleMaintenance( google::cloud::memorystore::v1::RescheduleMaintenanceRequest const& diff --git a/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.h b/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.h index 14e6862ce4b83..6786e90483a9a 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.h +++ b/google/cloud/memorystore/v1/internal/memorystore_tracing_connection.h @@ -86,6 +86,11 @@ class MemorystoreTracingConnection google::cloud::memorystore::v1::GetCertificateAuthorityRequest const& request) override; + StatusOr + GetSharedRegionalCertificateAuthority( + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> RescheduleMaintenance( google::cloud::memorystore::v1::RescheduleMaintenanceRequest const& diff --git a/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.cc b/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.cc index c9432d789aecb..71331e84f4204 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.cc +++ b/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.cc @@ -149,6 +149,20 @@ MemorystoreTracingStub::GetCertificateAuthority( child_->GetCertificateAuthority(context, options, request)); } +StatusOr +MemorystoreTracingStub::GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.memorystore.v1.Memorystore", + "GetSharedRegionalCertificateAuthority"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->GetSharedRegionalCertificateAuthority(context, options, request)); +} + future> MemorystoreTracingStub::AsyncRescheduleMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.h b/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.h index c5a9bd9094564..421b06db25f84 100644 --- a/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.h +++ b/google/cloud/memorystore/v1/internal/memorystore_tracing_stub.h @@ -91,6 +91,12 @@ class MemorystoreTracingStub : public MemorystoreStub { google::cloud::memorystore::v1::GetCertificateAuthorityRequest const& request) override; + StatusOr + GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> AsyncRescheduleMaintenance( google::cloud::CompletionQueue& cq, std::shared_ptr context, diff --git a/google/cloud/memorystore/v1/memorystore_client.cc b/google/cloud/memorystore/v1/memorystore_client.cc index 47e393e3aa405..18336dc5f634a 100644 --- a/google/cloud/memorystore/v1/memorystore_client.cc +++ b/google/cloud/memorystore/v1/memorystore_client.cc @@ -213,6 +213,25 @@ MemorystoreClient::GetCertificateAuthority( return connection_->GetCertificateAuthority(request); } +StatusOr +MemorystoreClient::GetSharedRegionalCertificateAuthority( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::memorystore::v1::GetSharedRegionalCertificateAuthorityRequest + request; + request.set_name(name); + return connection_->GetSharedRegionalCertificateAuthority(request); +} + +StatusOr +MemorystoreClient::GetSharedRegionalCertificateAuthority( + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetSharedRegionalCertificateAuthority(request); +} + future> MemorystoreClient::RescheduleMaintenance( std::string const& name, diff --git a/google/cloud/memorystore/v1/memorystore_client.h b/google/cloud/memorystore/v1/memorystore_client.h index 91b2ad9b99734..0c00cf16c5d2f 100644 --- a/google/cloud/memorystore/v1/memorystore_client.h +++ b/google/cloud/memorystore/v1/memorystore_client.h @@ -116,8 +116,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L262} - /// [google.cloud.memorystore.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1282} + /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L277} + /// [google.cloud.memorystore.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1346} /// // clang-format on StreamRange ListInstances( @@ -155,8 +155,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L262} - /// [google.cloud.memorystore.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1282} + /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L277} + /// [google.cloud.memorystore.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1346} /// // clang-format on StreamRange ListInstances( @@ -182,8 +182,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1323} - /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L262} + /// [google.cloud.memorystore.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1387} + /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L277} /// // clang-format on StatusOr GetInstance( @@ -212,8 +212,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1323} - /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L262} + /// [google.cloud.memorystore.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1387} + /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L277} /// // clang-format on StatusOr GetInstance( @@ -257,8 +257,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.CreateInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1335} - /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L262} + /// [google.cloud.memorystore.v1.CreateInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1399} + /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L277} /// // clang-format on future> CreateInstance( @@ -312,8 +312,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.CreateInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1335} - /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L262} + /// [google.cloud.memorystore.v1.CreateInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1399} + /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L277} /// // clang-format on future> CreateInstance( @@ -375,8 +375,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L262} - /// [google.cloud.memorystore.v1.UpdateInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1380} + /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L277} + /// [google.cloud.memorystore.v1.UpdateInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1444} /// // clang-format on future> UpdateInstance( @@ -428,8 +428,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L262} - /// [google.cloud.memorystore.v1.UpdateInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1380} + /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L277} + /// [google.cloud.memorystore.v1.UpdateInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1444} /// // clang-format on future> UpdateInstance( @@ -490,8 +490,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.DeleteInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1409} - /// [google.cloud.memorystore.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1654} + /// [google.cloud.memorystore.v1.DeleteInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1473} + /// [google.cloud.memorystore.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1766} /// // clang-format on future> @@ -541,8 +541,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.DeleteInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1409} - /// [google.cloud.memorystore.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1654} + /// [google.cloud.memorystore.v1.DeleteInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1473} + /// [google.cloud.memorystore.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1766} /// // clang-format on future> @@ -599,8 +599,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.CertificateAuthority]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1621} - /// [google.cloud.memorystore.v1.GetCertificateAuthorityRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1608} + /// [google.cloud.memorystore.v1.CertificateAuthority]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1685} + /// [google.cloud.memorystore.v1.GetCertificateAuthorityRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1672} /// // clang-format on StatusOr @@ -629,8 +629,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.CertificateAuthority]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1621} - /// [google.cloud.memorystore.v1.GetCertificateAuthorityRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1608} + /// [google.cloud.memorystore.v1.CertificateAuthority]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1685} + /// [google.cloud.memorystore.v1.GetCertificateAuthorityRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1672} /// // clang-format on StatusOr @@ -639,6 +639,69 @@ class MemorystoreClient { request, Options opts = {}); + // clang-format off + /// + /// Gets the details of shared regional certificate authority information for + /// Memorystore instance. + /// + /// @param name Required. Regional certificate authority resource name using the form: + /// `projects/{project}/locations/{location}/sharedRegionalCertificateAuthority` + /// where `location_id` refers to a Google Cloud region. + /// @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.memorystore.v1.SharedRegionalCertificateAuthority]) + /// 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.memorystore.v1.GetSharedRegionalCertificateAuthorityRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1753} + /// [google.cloud.memorystore.v1.SharedRegionalCertificateAuthority]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1718} + /// + // clang-format on + StatusOr + GetSharedRegionalCertificateAuthority(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Gets the details of shared regional certificate authority information for + /// Memorystore instance. + /// + /// @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.memorystore.v1.GetSharedRegionalCertificateAuthorityRequest]. + /// 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.memorystore.v1.SharedRegionalCertificateAuthority]) + /// 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.memorystore.v1.GetSharedRegionalCertificateAuthorityRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1753} + /// [google.cloud.memorystore.v1.SharedRegionalCertificateAuthority]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1718} + /// + // clang-format on + StatusOr + GetSharedRegionalCertificateAuthority( + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request, + Options opts = {}); + // clang-format off /// /// Reschedules upcoming maintenance event. @@ -669,8 +732,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L262} - /// [google.cloud.memorystore.v1.RescheduleMaintenanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1249} + /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L277} + /// [google.cloud.memorystore.v1.RescheduleMaintenanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1313} /// // clang-format on future> @@ -727,8 +790,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L262} - /// [google.cloud.memorystore.v1.RescheduleMaintenanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1249} + /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L277} + /// [google.cloud.memorystore.v1.RescheduleMaintenanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1313} /// // clang-format on future> @@ -801,8 +864,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.BackupCollection]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L677} - /// [google.cloud.memorystore.v1.ListBackupCollectionsRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1439} + /// [google.cloud.memorystore.v1.BackupCollection]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L741} + /// [google.cloud.memorystore.v1.ListBackupCollectionsRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1503} /// // clang-format on StreamRange @@ -844,8 +907,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.BackupCollection]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L677} - /// [google.cloud.memorystore.v1.ListBackupCollectionsRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1439} + /// [google.cloud.memorystore.v1.BackupCollection]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L741} + /// [google.cloud.memorystore.v1.ListBackupCollectionsRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1503} /// // clang-format on StreamRange @@ -873,8 +936,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.BackupCollection]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L677} - /// [google.cloud.memorystore.v1.GetBackupCollectionRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1488} + /// [google.cloud.memorystore.v1.BackupCollection]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L741} + /// [google.cloud.memorystore.v1.GetBackupCollectionRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1552} /// // clang-format on StatusOr @@ -903,8 +966,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.BackupCollection]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L677} - /// [google.cloud.memorystore.v1.GetBackupCollectionRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1488} + /// [google.cloud.memorystore.v1.BackupCollection]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L741} + /// [google.cloud.memorystore.v1.GetBackupCollectionRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1552} /// // clang-format on StatusOr @@ -940,8 +1003,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.Backup]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L735} - /// [google.cloud.memorystore.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1501} + /// [google.cloud.memorystore.v1.Backup]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L799} + /// [google.cloud.memorystore.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1565} /// // clang-format on StreamRange ListBackups( @@ -979,8 +1042,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.Backup]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L735} - /// [google.cloud.memorystore.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1501} + /// [google.cloud.memorystore.v1.Backup]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L799} + /// [google.cloud.memorystore.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1565} /// // clang-format on StreamRange ListBackups( @@ -1006,8 +1069,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.Backup]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L735} - /// [google.cloud.memorystore.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1539} + /// [google.cloud.memorystore.v1.Backup]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L799} + /// [google.cloud.memorystore.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1603} /// // clang-format on StatusOr GetBackup( @@ -1036,8 +1099,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.Backup]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L735} - /// [google.cloud.memorystore.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1539} + /// [google.cloud.memorystore.v1.Backup]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L799} + /// [google.cloud.memorystore.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1603} /// // clang-format on StatusOr GetBackup( @@ -1070,8 +1133,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.DeleteBackupRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1551} - /// [google.cloud.memorystore.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1654} + /// [google.cloud.memorystore.v1.DeleteBackupRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1615} + /// [google.cloud.memorystore.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1766} /// // clang-format on future> @@ -1122,8 +1185,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.DeleteBackupRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1551} - /// [google.cloud.memorystore.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1654} + /// [google.cloud.memorystore.v1.DeleteBackupRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1615} + /// [google.cloud.memorystore.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1766} /// // clang-format on future> @@ -1190,8 +1253,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.Backup]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L735} - /// [google.cloud.memorystore.v1.ExportBackupRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1569} + /// [google.cloud.memorystore.v1.Backup]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L799} + /// [google.cloud.memorystore.v1.ExportBackupRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1633} /// // clang-format on future> ExportBackup( @@ -1264,8 +1327,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.BackupInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1587} - /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L262} + /// [google.cloud.memorystore.v1.BackupInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1651} + /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L277} /// // clang-format on future> BackupInstance( @@ -1326,8 +1389,8 @@ class MemorystoreClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.memorystore.v1.BackupInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1587} - /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L262} + /// [google.cloud.memorystore.v1.BackupInstanceRequest]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L1651} + /// [google.cloud.memorystore.v1.Instance]: @googleapis_reference_link{google/cloud/memorystore/v1/memorystore.proto#L277} /// // clang-format on future> BackupInstance( @@ -1652,7 +1715,7 @@ class MemorystoreClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1691,7 +1754,7 @@ class MemorystoreClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/memorystore/v1/memorystore_connection.cc b/google/cloud/memorystore/v1/memorystore_connection.cc index 09801c5396dd5..2ceb44125ebcd 100644 --- a/google/cloud/memorystore/v1/memorystore_connection.cc +++ b/google/cloud/memorystore/v1/memorystore_connection.cc @@ -121,6 +121,13 @@ MemorystoreConnection::GetCertificateAuthority( return Status(StatusCode::kUnimplemented, "not implemented"); } +StatusOr +MemorystoreConnection::GetSharedRegionalCertificateAuthority( + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + future> MemorystoreConnection::RescheduleMaintenance( google::cloud::memorystore::v1::RescheduleMaintenanceRequest const&) { diff --git a/google/cloud/memorystore/v1/memorystore_connection.h b/google/cloud/memorystore/v1/memorystore_connection.h index c1c53d007403a..82ed665dd7f87 100644 --- a/google/cloud/memorystore/v1/memorystore_connection.h +++ b/google/cloud/memorystore/v1/memorystore_connection.h @@ -229,6 +229,12 @@ class MemorystoreConnection { google::cloud::memorystore::v1::GetCertificateAuthorityRequest const& request); + virtual StatusOr< + google::cloud::memorystore::v1::SharedRegionalCertificateAuthority> + GetSharedRegionalCertificateAuthority( + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request); + virtual future> RescheduleMaintenance( google::cloud::memorystore::v1::RescheduleMaintenanceRequest const& diff --git a/google/cloud/memorystore/v1/memorystore_connection_idempotency_policy.cc b/google/cloud/memorystore/v1/memorystore_connection_idempotency_policy.cc index dbff49633e89d..1a181983ef6ea 100644 --- a/google/cloud/memorystore/v1/memorystore_connection_idempotency_policy.cc +++ b/google/cloud/memorystore/v1/memorystore_connection_idempotency_policy.cc @@ -64,6 +64,13 @@ Idempotency MemorystoreConnectionIdempotencyPolicy::GetCertificateAuthority( return Idempotency::kIdempotent; } +Idempotency +MemorystoreConnectionIdempotencyPolicy::GetSharedRegionalCertificateAuthority( + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const&) { + return Idempotency::kIdempotent; +} + Idempotency MemorystoreConnectionIdempotencyPolicy::RescheduleMaintenance( google::cloud::memorystore::v1::RescheduleMaintenanceRequest const&) { return Idempotency::kNonIdempotent; diff --git a/google/cloud/memorystore/v1/memorystore_connection_idempotency_policy.h b/google/cloud/memorystore/v1/memorystore_connection_idempotency_policy.h index a4ac953d6307c..6d4ffc65da39c 100644 --- a/google/cloud/memorystore/v1/memorystore_connection_idempotency_policy.h +++ b/google/cloud/memorystore/v1/memorystore_connection_idempotency_policy.h @@ -57,6 +57,10 @@ class MemorystoreConnectionIdempotencyPolicy { google::cloud::memorystore::v1::GetCertificateAuthorityRequest const& request); + virtual google::cloud::Idempotency GetSharedRegionalCertificateAuthority( + google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request); + virtual google::cloud::Idempotency RescheduleMaintenance( google::cloud::memorystore::v1::RescheduleMaintenanceRequest const& request); diff --git a/google/cloud/memorystore/v1/mocks/mock_memorystore_connection.h b/google/cloud/memorystore/v1/mocks/mock_memorystore_connection.h index a58579b9e4174..ecedbdbe8055c 100644 --- a/google/cloud/memorystore/v1/mocks/mock_memorystore_connection.h +++ b/google/cloud/memorystore/v1/mocks/mock_memorystore_connection.h @@ -181,6 +181,14 @@ class MockMemorystoreConnection : public memorystore_v1::MemorystoreConnection { request), (override)); + MOCK_METHOD( + StatusOr< + google::cloud::memorystore::v1::SharedRegionalCertificateAuthority>, + GetSharedRegionalCertificateAuthority, + (google::cloud::memorystore::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request), + (override)); + /// To disambiguate calls, use: /// /// @code diff --git a/google/cloud/metastore/quickstart/.bazelversion b/google/cloud/metastore/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/metastore/quickstart/.bazelversion +++ b/google/cloud/metastore/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/metastore/quickstart/WORKSPACE.bazel b/google/cloud/metastore/quickstart/WORKSPACE.bazel index 70ccd850ce134..b07dee820745d 100644 --- a/google/cloud/metastore/quickstart/WORKSPACE.bazel +++ b/google/cloud/metastore/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/metastore/v1/dataproc_metastore_client.h b/google/cloud/metastore/v1/dataproc_metastore_client.h index 7951db6d2f690..2fa8fd8910a8a 100644 --- a/google/cloud/metastore/v1/dataproc_metastore_client.h +++ b/google/cloud/metastore/v1/dataproc_metastore_client.h @@ -2173,7 +2173,7 @@ class DataprocMetastoreClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2212,7 +2212,7 @@ class DataprocMetastoreClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/metastore/v1/dataproc_metastore_federation_client.h b/google/cloud/metastore/v1/dataproc_metastore_federation_client.h index b7da299782b6a..d5fff171a3d4f 100644 --- a/google/cloud/metastore/v1/dataproc_metastore_federation_client.h +++ b/google/cloud/metastore/v1/dataproc_metastore_federation_client.h @@ -999,7 +999,7 @@ class DataprocMetastoreFederationClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1038,7 +1038,7 @@ class DataprocMetastoreFederationClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/migrationcenter/quickstart/.bazelversion b/google/cloud/migrationcenter/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/migrationcenter/quickstart/.bazelversion +++ b/google/cloud/migrationcenter/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/migrationcenter/quickstart/WORKSPACE.bazel b/google/cloud/migrationcenter/quickstart/WORKSPACE.bazel index 520dbe0ea15b0..a9ceb310ec342 100644 --- a/google/cloud/migrationcenter/quickstart/WORKSPACE.bazel +++ b/google/cloud/migrationcenter/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/migrationcenter/v1/migration_center_client.h b/google/cloud/migrationcenter/v1/migration_center_client.h index 852b17fe37e46..12570633c81d0 100644 --- a/google/cloud/migrationcenter/v1/migration_center_client.h +++ b/google/cloud/migrationcenter/v1/migration_center_client.h @@ -4653,7 +4653,7 @@ class MigrationCenterClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -4692,7 +4692,7 @@ class MigrationCenterClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/monitoring/quickstart/.bazelversion b/google/cloud/monitoring/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/monitoring/quickstart/.bazelversion +++ b/google/cloud/monitoring/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/monitoring/quickstart/WORKSPACE.bazel b/google/cloud/monitoring/quickstart/WORKSPACE.bazel index 9cbd47b3a233c..1f18eb7991c66 100644 --- a/google/cloud/monitoring/quickstart/WORKSPACE.bazel +++ b/google/cloud/monitoring/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/netapp/quickstart/.bazelversion b/google/cloud/netapp/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/netapp/quickstart/.bazelversion +++ b/google/cloud/netapp/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/netapp/quickstart/WORKSPACE.bazel b/google/cloud/netapp/quickstart/WORKSPACE.bazel index 3fee23e6c04c8..676f5334c36eb 100644 --- a/google/cloud/netapp/quickstart/WORKSPACE.bazel +++ b/google/cloud/netapp/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/netapp/v1/internal/net_app_auth_decorator.cc b/google/cloud/netapp/v1/internal/net_app_auth_decorator.cc index 39971658e6c06..e9220d25847fc 100644 --- a/google/cloud/netapp/v1/internal/net_app_auth_decorator.cc +++ b/google/cloud/netapp/v1/internal/net_app_auth_decorator.cc @@ -316,6 +316,34 @@ StatusOr NetAppAuth::RevertVolume( return child_->RevertVolume(context, options, request); } +future> +NetAppAuth::AsyncEstablishVolumePeering( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest 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->AsyncEstablishVolumePeering(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr NetAppAuth::EstablishVolumePeering( + grpc::ClientContext& context, Options options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->EstablishVolumePeering(context, options, request); +} + StatusOr NetAppAuth::ListSnapshots( grpc::ClientContext& context, Options const& options, @@ -1431,6 +1459,42 @@ StatusOr NetAppAuth::DeleteHostGroup( return child_->DeleteHostGroup(context, options, request); } +StatusOr +NetAppAuth::ExecuteOntapPost( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ExecuteOntapPost(context, options, request); +} + +StatusOr +NetAppAuth::ExecuteOntapGet( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ExecuteOntapGet(context, options, request); +} + +StatusOr +NetAppAuth::ExecuteOntapDelete( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ExecuteOntapDelete(context, options, request); +} + +StatusOr +NetAppAuth::ExecuteOntapPatch( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ExecuteOntapPatch(context, options, request); +} + StatusOr NetAppAuth::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/netapp/v1/internal/net_app_auth_decorator.h b/google/cloud/netapp/v1/internal/net_app_auth_decorator.h index c2db4c139e214..1acc0c58472b7 100644 --- a/google/cloud/netapp/v1/internal/net_app_auth_decorator.h +++ b/google/cloud/netapp/v1/internal/net_app_auth_decorator.h @@ -160,6 +160,18 @@ class NetAppAuth : public NetAppStub { grpc::ClientContext& context, Options options, google::cloud::netapp::v1::RevertVolumeRequest const& request) override; + future> AsyncEstablishVolumePeering( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + + StatusOr EstablishVolumePeering( + grpc::ClientContext& context, Options options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + StatusOr ListSnapshots( grpc::ClientContext& context, Options const& options, google::cloud::netapp::v1::ListSnapshotsRequest const& request) override; @@ -639,6 +651,26 @@ class NetAppAuth : public NetAppStub { google::cloud::netapp::v1::DeleteHostGroupRequest const& request) override; + StatusOr + ExecuteOntapPost(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPostRequest const& + request) override; + + StatusOr ExecuteOntapGet( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) + override; + + StatusOr + ExecuteOntapDelete(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& + request) override; + + StatusOr + ExecuteOntapPatch(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/netapp/v1/internal/net_app_connection_impl.cc b/google/cloud/netapp/v1/internal/net_app_connection_impl.cc index 706bdfd96d38c..2698109295da3 100644 --- a/google/cloud/netapp/v1/internal/net_app_connection_impl.cc +++ b/google/cloud/netapp/v1/internal/net_app_connection_impl.cc @@ -969,6 +969,98 @@ NetAppConnectionImpl::RevertVolume( polling_policy(*current), __func__); } +future> +NetAppConnectionImpl::EstablishVolumePeering( + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->EstablishVolumePeering(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::netapp::v1::Volume>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& + request) { + return stub->AsyncEstablishVolumePeering(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::netapp::v1::Volume>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetAppConnectionImpl::EstablishVolumePeering( + NoAwaitTag, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->EstablishVolumePeering(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& + request) { + return stub_->EstablishVolumePeering(context, options, request); + }, + *current, request, __func__); +} + +future> +NetAppConnectionImpl::EstablishVolumePeering( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to EstablishVolumePeering", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::netapp::v1::Volume>( + 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::netapp::v1::Volume>, + polling_policy(*current), __func__); +} + StreamRange NetAppConnectionImpl::ListSnapshots( google::cloud::netapp::v1::ListSnapshotsRequest request) { @@ -4489,6 +4581,65 @@ NetAppConnectionImpl::DeleteHostGroup( polling_policy(*current), __func__); } +StatusOr +NetAppConnectionImpl::ExecuteOntapPost( + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ExecuteOntapPost(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request) { + return stub_->ExecuteOntapPost(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +NetAppConnectionImpl::ExecuteOntapGet( + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ExecuteOntapGet(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) { + return stub_->ExecuteOntapGet(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +NetAppConnectionImpl::ExecuteOntapDelete( + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ExecuteOntapDelete(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request) { + return stub_->ExecuteOntapDelete(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +NetAppConnectionImpl::ExecuteOntapPatch( + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ExecuteOntapPatch(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request) { + return stub_->ExecuteOntapPatch(context, options, request); + }, + *current, request, __func__); +} + StreamRange NetAppConnectionImpl::ListLocations( google::cloud::location::ListLocationsRequest request) { diff --git a/google/cloud/netapp/v1/internal/net_app_connection_impl.h b/google/cloud/netapp/v1/internal/net_app_connection_impl.h index c43b744c92fbc..230266c557a78 100644 --- a/google/cloud/netapp/v1/internal/net_app_connection_impl.h +++ b/google/cloud/netapp/v1/internal/net_app_connection_impl.h @@ -166,6 +166,18 @@ class NetAppConnectionImpl : public netapp_v1::NetAppConnection { future> RevertVolume( google::longrunning::Operation const& operation) override; + future> EstablishVolumePeering( + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + + StatusOr EstablishVolumePeering( + NoAwaitTag, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + + future> EstablishVolumePeering( + google::longrunning::Operation const& operation) override; + StreamRange ListSnapshots( google::cloud::netapp::v1::ListSnapshotsRequest request) override; @@ -628,6 +640,22 @@ class NetAppConnectionImpl : public netapp_v1::NetAppConnection { future> DeleteHostGroup(google::longrunning::Operation const& operation) override; + StatusOr + ExecuteOntapPost(google::cloud::netapp::v1::ExecuteOntapPostRequest const& + request) override; + + StatusOr ExecuteOntapGet( + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) + override; + + StatusOr + ExecuteOntapDelete(google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& + request) override; + + StatusOr + ExecuteOntapPatch(google::cloud::netapp::v1::ExecuteOntapPatchRequest const& + request) override; + StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; diff --git a/google/cloud/netapp/v1/internal/net_app_logging_decorator.cc b/google/cloud/netapp/v1/internal/net_app_logging_decorator.cc index bd2ebd14eea39..cfca2d2dd7f98 100644 --- a/google/cloud/netapp/v1/internal/net_app_logging_decorator.cc +++ b/google/cloud/netapp/v1/internal/net_app_logging_decorator.cc @@ -357,6 +357,37 @@ StatusOr NetAppLogging::RevertVolume( context, options, request, __func__, tracing_options_); } +future> +NetAppLogging::AsyncEstablishVolumePeering( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& + request) { + return child_->AsyncEstablishVolumePeering(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr NetAppLogging::EstablishVolumePeering( + grpc::ClientContext& context, Options options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& + request) { + return child_->EstablishVolumePeering(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr NetAppLogging::ListSnapshots( grpc::ClientContext& context, Options const& options, @@ -1606,6 +1637,57 @@ StatusOr NetAppLogging::DeleteHostGroup( context, options, request, __func__, tracing_options_); } +StatusOr +NetAppLogging::ExecuteOntapPost( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request) { + return child_->ExecuteOntapPost(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +NetAppLogging::ExecuteOntapGet( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) { + return child_->ExecuteOntapGet(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +NetAppLogging::ExecuteOntapDelete( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request) { + return child_->ExecuteOntapDelete(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +NetAppLogging::ExecuteOntapPatch( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request) { + return child_->ExecuteOntapPatch(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr NetAppLogging::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/netapp/v1/internal/net_app_logging_decorator.h b/google/cloud/netapp/v1/internal/net_app_logging_decorator.h index 2912956773d50..cab1e6415e106 100644 --- a/google/cloud/netapp/v1/internal/net_app_logging_decorator.h +++ b/google/cloud/netapp/v1/internal/net_app_logging_decorator.h @@ -160,6 +160,18 @@ class NetAppLogging : public NetAppStub { grpc::ClientContext& context, Options options, google::cloud::netapp::v1::RevertVolumeRequest const& request) override; + future> AsyncEstablishVolumePeering( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + + StatusOr EstablishVolumePeering( + grpc::ClientContext& context, Options options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + StatusOr ListSnapshots( grpc::ClientContext& context, Options const& options, google::cloud::netapp::v1::ListSnapshotsRequest const& request) override; @@ -639,6 +651,26 @@ class NetAppLogging : public NetAppStub { google::cloud::netapp::v1::DeleteHostGroupRequest const& request) override; + StatusOr + ExecuteOntapPost(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPostRequest const& + request) override; + + StatusOr ExecuteOntapGet( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) + override; + + StatusOr + ExecuteOntapDelete(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& + request) override; + + StatusOr + ExecuteOntapPatch(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/netapp/v1/internal/net_app_metadata_decorator.cc b/google/cloud/netapp/v1/internal/net_app_metadata_decorator.cc index 0b4c24fd748dc..96ae9e0c90e8f 100644 --- a/google/cloud/netapp/v1/internal/net_app_metadata_decorator.cc +++ b/google/cloud/netapp/v1/internal/net_app_metadata_decorator.cc @@ -268,6 +268,26 @@ StatusOr NetAppMetadata::RevertVolume( return child_->RevertVolume(context, options, request); } +future> +NetAppMetadata::AsyncEstablishVolumePeering( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncEstablishVolumePeering(cq, std::move(context), + std::move(options), request); +} + +StatusOr NetAppMetadata::EstablishVolumePeering( + grpc::ClientContext& context, Options options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->EstablishVolumePeering(context, options, request); +} + StatusOr NetAppMetadata::ListSnapshots( grpc::ClientContext& context, Options const& options, @@ -1137,6 +1157,46 @@ StatusOr NetAppMetadata::DeleteHostGroup( return child_->DeleteHostGroup(context, options, request); } +StatusOr +NetAppMetadata::ExecuteOntapPost( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("ontap_path=", internal::UrlEncode(request.ontap_path()))); + return child_->ExecuteOntapPost(context, options, request); +} + +StatusOr +NetAppMetadata::ExecuteOntapGet( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("ontap_path=", internal::UrlEncode(request.ontap_path()))); + return child_->ExecuteOntapGet(context, options, request); +} + +StatusOr +NetAppMetadata::ExecuteOntapDelete( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("ontap_path=", internal::UrlEncode(request.ontap_path()))); + return child_->ExecuteOntapDelete(context, options, request); +} + +StatusOr +NetAppMetadata::ExecuteOntapPatch( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("ontap_path=", internal::UrlEncode(request.ontap_path()))); + return child_->ExecuteOntapPatch(context, options, request); +} + StatusOr NetAppMetadata::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/netapp/v1/internal/net_app_metadata_decorator.h b/google/cloud/netapp/v1/internal/net_app_metadata_decorator.h index df38e38c3fed4..5c604c8763e8b 100644 --- a/google/cloud/netapp/v1/internal/net_app_metadata_decorator.h +++ b/google/cloud/netapp/v1/internal/net_app_metadata_decorator.h @@ -160,6 +160,18 @@ class NetAppMetadata : public NetAppStub { grpc::ClientContext& context, Options options, google::cloud::netapp::v1::RevertVolumeRequest const& request) override; + future> AsyncEstablishVolumePeering( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + + StatusOr EstablishVolumePeering( + grpc::ClientContext& context, Options options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + StatusOr ListSnapshots( grpc::ClientContext& context, Options const& options, google::cloud::netapp::v1::ListSnapshotsRequest const& request) override; @@ -639,6 +651,26 @@ class NetAppMetadata : public NetAppStub { google::cloud::netapp::v1::DeleteHostGroupRequest const& request) override; + StatusOr + ExecuteOntapPost(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPostRequest const& + request) override; + + StatusOr ExecuteOntapGet( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) + override; + + StatusOr + ExecuteOntapDelete(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& + request) override; + + StatusOr + ExecuteOntapPatch(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/netapp/v1/internal/net_app_stub.cc b/google/cloud/netapp/v1/internal/net_app_stub.cc index aa12edd06d01b..70d8ca278c7b8 100644 --- a/google/cloud/netapp/v1/internal/net_app_stub.cc +++ b/google/cloud/netapp/v1/internal/net_app_stub.cc @@ -348,6 +348,38 @@ StatusOr DefaultNetAppStub::RevertVolume( return response; } +future> +DefaultNetAppStub::AsyncEstablishVolumePeering( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::netapp::v1::EstablishVolumePeeringRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncEstablishVolumePeering(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetAppStub::EstablishVolumePeering( + grpc::ClientContext& context, Options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->EstablishVolumePeering(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultNetAppStub::ListSnapshots( grpc::ClientContext& context, Options const&, @@ -1574,6 +1606,54 @@ StatusOr DefaultNetAppStub::DeleteHostGroup( return response; } +StatusOr +DefaultNetAppStub::ExecuteOntapPost( + grpc::ClientContext& context, Options const&, + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request) { + google::cloud::netapp::v1::ExecuteOntapPostResponse response; + auto status = grpc_stub_->ExecuteOntapPost(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultNetAppStub::ExecuteOntapGet( + grpc::ClientContext& context, Options const&, + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) { + google::cloud::netapp::v1::ExecuteOntapGetResponse response; + auto status = grpc_stub_->ExecuteOntapGet(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultNetAppStub::ExecuteOntapDelete( + grpc::ClientContext& context, Options const&, + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request) { + google::cloud::netapp::v1::ExecuteOntapDeleteResponse response; + auto status = grpc_stub_->ExecuteOntapDelete(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultNetAppStub::ExecuteOntapPatch( + grpc::ClientContext& context, Options const&, + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request) { + google::cloud::netapp::v1::ExecuteOntapPatchResponse response; + auto status = grpc_stub_->ExecuteOntapPatch(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultNetAppStub::ListLocations( grpc::ClientContext& context, Options const&, diff --git a/google/cloud/netapp/v1/internal/net_app_stub.h b/google/cloud/netapp/v1/internal/net_app_stub.h index ef4b555190db5..44adb315e76af 100644 --- a/google/cloud/netapp/v1/internal/net_app_stub.h +++ b/google/cloud/netapp/v1/internal/net_app_stub.h @@ -158,6 +158,19 @@ class NetAppStub { grpc::ClientContext& context, Options options, google::cloud::netapp::v1::RevertVolumeRequest const& request) = 0; + virtual future> + AsyncEstablishVolumePeering( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& + request) = 0; + + virtual StatusOr EstablishVolumePeering( + grpc::ClientContext& context, Options options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& + request) = 0; + virtual StatusOr ListSnapshots( grpc::ClientContext& context, Options const& options, @@ -609,6 +622,26 @@ class NetAppStub { grpc::ClientContext& context, Options options, google::cloud::netapp::v1::DeleteHostGroupRequest const& request) = 0; + virtual StatusOr + ExecuteOntapPost( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request) = 0; + + virtual StatusOr + ExecuteOntapGet( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) = 0; + + virtual StatusOr + ExecuteOntapDelete( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request) = 0; + + virtual StatusOr + ExecuteOntapPatch( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request) = 0; + virtual StatusOr ListLocations( grpc::ClientContext& context, Options const& options, @@ -778,6 +811,18 @@ class DefaultNetAppStub : public NetAppStub { grpc::ClientContext& context, Options options, google::cloud::netapp::v1::RevertVolumeRequest const& request) override; + future> AsyncEstablishVolumePeering( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + + StatusOr EstablishVolumePeering( + grpc::ClientContext& context, Options options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + StatusOr ListSnapshots( grpc::ClientContext& context, Options const& options, google::cloud::netapp::v1::ListSnapshotsRequest const& request) override; @@ -1257,6 +1302,26 @@ class DefaultNetAppStub : public NetAppStub { google::cloud::netapp::v1::DeleteHostGroupRequest const& request) override; + StatusOr + ExecuteOntapPost(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPostRequest const& + request) override; + + StatusOr ExecuteOntapGet( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) + override; + + StatusOr + ExecuteOntapDelete(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& + request) override; + + StatusOr + ExecuteOntapPatch(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/netapp/v1/internal/net_app_tracing_connection.cc b/google/cloud/netapp/v1/internal/net_app_tracing_connection.cc index c66e36e456b10..f059db549ae4e 100644 --- a/google/cloud/netapp/v1/internal/net_app_tracing_connection.cc +++ b/google/cloud/netapp/v1/internal/net_app_tracing_connection.cc @@ -311,6 +311,37 @@ NetAppTracingConnection::RevertVolume( return internal::EndSpan(std::move(span), child_->RevertVolume(operation)); } +future> +NetAppTracingConnection::EstablishVolumePeering( + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) { + auto span = + internal::MakeSpan("netapp_v1::NetAppConnection::EstablishVolumePeering"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->EstablishVolumePeering(request)); +} + +StatusOr +NetAppTracingConnection::EstablishVolumePeering( + NoAwaitTag, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) { + auto span = + internal::MakeSpan("netapp_v1::NetAppConnection::EstablishVolumePeering"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->EstablishVolumePeering(NoAwaitTag{}, request)); +} + +future> +NetAppTracingConnection::EstablishVolumePeering( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("netapp_v1::NetAppConnection::EstablishVolumePeering"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->EstablishVolumePeering(operation)); +} + StreamRange NetAppTracingConnection::ListSnapshots( google::cloud::netapp::v1::ListSnapshotsRequest request) { @@ -1470,6 +1501,42 @@ NetAppTracingConnection::DeleteHostGroup( return internal::EndSpan(std::move(span), child_->DeleteHostGroup(operation)); } +StatusOr +NetAppTracingConnection::ExecuteOntapPost( + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request) { + auto span = + internal::MakeSpan("netapp_v1::NetAppConnection::ExecuteOntapPost"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->ExecuteOntapPost(request)); +} + +StatusOr +NetAppTracingConnection::ExecuteOntapGet( + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) { + auto span = + internal::MakeSpan("netapp_v1::NetAppConnection::ExecuteOntapGet"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->ExecuteOntapGet(request)); +} + +StatusOr +NetAppTracingConnection::ExecuteOntapDelete( + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request) { + auto span = + internal::MakeSpan("netapp_v1::NetAppConnection::ExecuteOntapDelete"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->ExecuteOntapDelete(request)); +} + +StatusOr +NetAppTracingConnection::ExecuteOntapPatch( + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request) { + auto span = + internal::MakeSpan("netapp_v1::NetAppConnection::ExecuteOntapPatch"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->ExecuteOntapPatch(request)); +} + StreamRange NetAppTracingConnection::ListLocations( google::cloud::location::ListLocationsRequest request) { diff --git a/google/cloud/netapp/v1/internal/net_app_tracing_connection.h b/google/cloud/netapp/v1/internal/net_app_tracing_connection.h index efa5d29e25007..4f7ae30e4b849 100644 --- a/google/cloud/netapp/v1/internal/net_app_tracing_connection.h +++ b/google/cloud/netapp/v1/internal/net_app_tracing_connection.h @@ -153,6 +153,18 @@ class NetAppTracingConnection : public netapp_v1::NetAppConnection { future> RevertVolume( google::longrunning::Operation const& operation) override; + future> EstablishVolumePeering( + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + + StatusOr EstablishVolumePeering( + NoAwaitTag, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + + future> EstablishVolumePeering( + google::longrunning::Operation const& operation) override; + StreamRange ListSnapshots( google::cloud::netapp::v1::ListSnapshotsRequest request) override; @@ -615,6 +627,22 @@ class NetAppTracingConnection : public netapp_v1::NetAppConnection { future> DeleteHostGroup(google::longrunning::Operation const& operation) override; + StatusOr + ExecuteOntapPost(google::cloud::netapp::v1::ExecuteOntapPostRequest const& + request) override; + + StatusOr ExecuteOntapGet( + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) + override; + + StatusOr + ExecuteOntapDelete(google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& + request) override; + + StatusOr + ExecuteOntapPatch(google::cloud::netapp::v1::ExecuteOntapPatchRequest const& + request) override; + StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; diff --git a/google/cloud/netapp/v1/internal/net_app_tracing_stub.cc b/google/cloud/netapp/v1/internal/net_app_tracing_stub.cc index cae9272ea4f95..649bfaf2b9d5e 100644 --- a/google/cloud/netapp/v1/internal/net_app_tracing_stub.cc +++ b/google/cloud/netapp/v1/internal/net_app_tracing_stub.cc @@ -313,6 +313,34 @@ StatusOr NetAppTracingStub::RevertVolume( child_->RevertVolume(context, options, request)); } +future> +NetAppTracingStub::AsyncEstablishVolumePeering( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.netapp.v1.NetApp", + "EstablishVolumePeering"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncEstablishVolumePeering(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetAppTracingStub::EstablishVolumePeering( + grpc::ClientContext& context, Options options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.netapp.v1.NetApp", + "EstablishVolumePeering"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->EstablishVolumePeering(context, options, request)); +} + StatusOr NetAppTracingStub::ListSnapshots( grpc::ClientContext& context, Options const& options, @@ -1424,6 +1452,54 @@ StatusOr NetAppTracingStub::DeleteHostGroup( child_->DeleteHostGroup(context, options, request)); } +StatusOr +NetAppTracingStub::ExecuteOntapPost( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.netapp.v1.NetApp", + "ExecuteOntapPost"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ExecuteOntapPost(context, options, request)); +} + +StatusOr +NetAppTracingStub::ExecuteOntapGet( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.netapp.v1.NetApp", + "ExecuteOntapGet"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ExecuteOntapGet(context, options, request)); +} + +StatusOr +NetAppTracingStub::ExecuteOntapDelete( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.netapp.v1.NetApp", + "ExecuteOntapDelete"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ExecuteOntapDelete(context, options, request)); +} + +StatusOr +NetAppTracingStub::ExecuteOntapPatch( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.netapp.v1.NetApp", + "ExecuteOntapPatch"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ExecuteOntapPatch(context, options, request)); +} + StatusOr NetAppTracingStub::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/netapp/v1/internal/net_app_tracing_stub.h b/google/cloud/netapp/v1/internal/net_app_tracing_stub.h index bae1a7401e7e9..a670a9df3ea52 100644 --- a/google/cloud/netapp/v1/internal/net_app_tracing_stub.h +++ b/google/cloud/netapp/v1/internal/net_app_tracing_stub.h @@ -157,6 +157,18 @@ class NetAppTracingStub : public NetAppStub { grpc::ClientContext& context, Options options, google::cloud::netapp::v1::RevertVolumeRequest const& request) override; + future> AsyncEstablishVolumePeering( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + + StatusOr EstablishVolumePeering( + grpc::ClientContext& context, Options options, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request) + override; + StatusOr ListSnapshots( grpc::ClientContext& context, Options const& options, google::cloud::netapp::v1::ListSnapshotsRequest const& request) override; @@ -636,6 +648,26 @@ class NetAppTracingStub : public NetAppStub { google::cloud::netapp::v1::DeleteHostGroupRequest const& request) override; + StatusOr + ExecuteOntapPost(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPostRequest const& + request) override; + + StatusOr ExecuteOntapGet( + grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request) + override; + + StatusOr + ExecuteOntapDelete(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& + request) override; + + StatusOr + ExecuteOntapPatch(grpc::ClientContext& context, Options const& options, + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/netapp/v1/mocks/mock_net_app_connection.h b/google/cloud/netapp/v1/mocks/mock_net_app_connection.h index 2e1aced1c6dc1..eddb6c5736339 100644 --- a/google/cloud/netapp/v1/mocks/mock_net_app_connection.h +++ b/google/cloud/netapp/v1/mocks/mock_net_app_connection.h @@ -403,6 +403,45 @@ class MockNetAppConnection : public netapp_v1::NetAppConnection { MOCK_METHOD(future>, RevertVolume, (google::longrunning::Operation const& operation), (override)); + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// EstablishVolumePeering(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + EstablishVolumePeering, + (google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, EstablishVolumePeering(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, EstablishVolumePeering, + (NoAwaitTag, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// EstablishVolumePeering(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + EstablishVolumePeering, + (google::longrunning::Operation const& operation), (override)); + MOCK_METHOD((StreamRange), ListSnapshots, (google::cloud::netapp::v1::ListSnapshotsRequest request), (override)); @@ -1794,6 +1833,30 @@ class MockNetAppConnection : public netapp_v1::NetAppConnection { DeleteHostGroup, (google::longrunning::Operation const& operation), (override)); + MOCK_METHOD( + StatusOr, + ExecuteOntapPost, + (google::cloud::netapp::v1::ExecuteOntapPostRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, + ExecuteOntapGet, + (google::cloud::netapp::v1::ExecuteOntapGetRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, + ExecuteOntapDelete, + (google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, + ExecuteOntapPatch, + (google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request), + (override)); + MOCK_METHOD((StreamRange), ListLocations, (google::cloud::location::ListLocationsRequest request), (override)); diff --git a/google/cloud/netapp/v1/net_app_client.cc b/google/cloud/netapp/v1/net_app_client.cc index 01cd4b0803ccc..216768f236212 100644 --- a/google/cloud/netapp/v1/net_app_client.cc +++ b/google/cloud/netapp/v1/net_app_client.cc @@ -408,6 +408,29 @@ future> NetAppClient::RevertVolume( return connection_->RevertVolume(operation); } +future> +NetAppClient::EstablishVolumePeering( + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->EstablishVolumePeering(request); +} + +StatusOr NetAppClient::EstablishVolumePeering( + NoAwaitTag, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->EstablishVolumePeering(NoAwaitTag{}, request); +} + +future> +NetAppClient::EstablishVolumePeering( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->EstablishVolumePeering(operation); +} + StreamRange NetAppClient::ListSnapshots( std::string const& parent, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); @@ -2013,6 +2036,38 @@ NetAppClient::DeleteHostGroup(google::longrunning::Operation const& operation, return connection_->DeleteHostGroup(operation); } +StatusOr +NetAppClient::ExecuteOntapPost( + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExecuteOntapPost(request); +} + +StatusOr +NetAppClient::ExecuteOntapGet( + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExecuteOntapGet(request); +} + +StatusOr +NetAppClient::ExecuteOntapDelete( + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExecuteOntapDelete(request); +} + +StatusOr +NetAppClient::ExecuteOntapPatch( + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExecuteOntapPatch(request); +} + StreamRange NetAppClient::ListLocations( google::cloud::location::ListLocationsRequest request, Options opts) { internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); diff --git a/google/cloud/netapp/v1/net_app_client.h b/google/cloud/netapp/v1/net_app_client.h index 8ef57d88aa926..e1e3f514c0652 100644 --- a/google/cloud/netapp/v1/net_app_client.h +++ b/google/cloud/netapp/v1/net_app_client.h @@ -113,8 +113,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.ListStoragePoolsRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L45} - /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L141} + /// [google.cloud.netapp.v1.ListStoragePoolsRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L58} + /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L154} /// // clang-format on StreamRange ListStoragePools( @@ -152,8 +152,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.ListStoragePoolsRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L45} - /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L141} + /// [google.cloud.netapp.v1.ListStoragePoolsRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L58} + /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L154} /// // clang-format on StreamRange ListStoragePools( @@ -190,8 +190,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.CreateStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L82} - /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L141} + /// [google.cloud.netapp.v1.CreateStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L95} + /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L154} /// // clang-format on future> CreateStoragePool( @@ -245,8 +245,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.CreateStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L82} - /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L141} + /// [google.cloud.netapp.v1.CreateStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L95} + /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L154} /// // clang-format on future> CreateStoragePool( @@ -299,8 +299,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.GetStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L34} - /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L141} + /// [google.cloud.netapp.v1.GetStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L47} + /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L154} /// // clang-format on StatusOr GetStoragePool( @@ -329,8 +329,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.GetStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L34} - /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L141} + /// [google.cloud.netapp.v1.GetStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L47} + /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L154} /// // clang-format on StatusOr GetStoragePool( @@ -367,8 +367,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L141} - /// [google.cloud.netapp.v1.UpdateStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L102} + /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L154} + /// [google.cloud.netapp.v1.UpdateStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L115} /// // clang-format on future> UpdateStoragePool( @@ -420,8 +420,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L141} - /// [google.cloud.netapp.v1.UpdateStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L102} + /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L154} + /// [google.cloud.netapp.v1.UpdateStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L115} /// // clang-format on future> UpdateStoragePool( @@ -481,8 +481,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.DeleteStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L116} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.DeleteStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L129} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -532,8 +532,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.DeleteStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L116} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.DeleteStoragePoolRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L129} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -601,8 +601,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} - /// [google.cloud.netapp.v1.ValidateDirectoryServiceRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L313} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} + /// [google.cloud.netapp.v1.ValidateDirectoryServiceRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L330} /// // clang-format on future> @@ -670,8 +670,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L141} - /// [google.cloud.netapp.v1.SwitchActiveReplicaZoneRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L128} + /// [google.cloud.netapp.v1.StoragePool]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L154} + /// [google.cloud.netapp.v1.SwitchActiveReplicaZoneRequest]: @googleapis_reference_link{google/cloud/netapp/v1/storage_pool.proto#L141} /// // clang-format on future> @@ -1101,7 +1101,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteVolumeRequest]: @googleapis_reference_link{google/cloud/netapp/v1/volume.proto#L202} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> DeleteVolume( @@ -1153,7 +1153,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteVolumeRequest]: @googleapis_reference_link{google/cloud/netapp/v1/volume.proto#L202} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> DeleteVolume( @@ -1254,6 +1254,73 @@ class NetAppClient { future> RevertVolume( google::longrunning::Operation const& operation, Options opts = {}); + // clang-format off + /// + /// Establish volume peering. This is used to establish cluster and svm + /// peerings between the GCNV and OnPrem clusters. + /// + /// @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.netapp.v1.EstablishVolumePeeringRequest]. + /// 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.netapp.v1.Volume] 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.netapp.v1.EstablishVolumePeeringRequest]: @googleapis_reference_link{google/cloud/netapp/v1/volume.proto#L999} + /// [google.cloud.netapp.v1.Volume]: @googleapis_reference_link{google/cloud/netapp/v1/volume.proto#L231} + /// + // clang-format on + future> EstablishVolumePeering( + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief EstablishVolumePeering + /// + /// 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 EstablishVolumePeering( + NoAwaitTag, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief EstablishVolumePeering + /// + /// 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> EstablishVolumePeering( + google::longrunning::Operation const& operation, Options opts = {}); + // clang-format off /// /// Returns descriptions of all snapshots for a volume. @@ -1536,7 +1603,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteSnapshotRequest]: @googleapis_reference_link{google/cloud/netapp/v1/snapshot.proto#L103} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> DeleteSnapshot( @@ -1587,7 +1654,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteSnapshotRequest]: @googleapis_reference_link{google/cloud/netapp/v1/snapshot.proto#L103} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> DeleteSnapshot( @@ -2143,7 +2210,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteActiveDirectoryRequest]: @googleapis_reference_link{google/cloud/netapp/v1/active_directory.proto#L114} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -2194,7 +2261,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteActiveDirectoryRequest]: @googleapis_reference_link{google/cloud/netapp/v1/active_directory.proto#L114} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -2725,7 +2792,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteKmsConfigRequest]: @googleapis_reference_link{google/cloud/netapp/v1/kms.proto#L118} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -2776,7 +2843,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteKmsConfigRequest]: @googleapis_reference_link{google/cloud/netapp/v1/kms.proto#L118} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -3095,7 +3162,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteReplicationRequest]: @googleapis_reference_link{google/cloud/netapp/v1/replication.proto#L403} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -3146,7 +3213,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteReplicationRequest]: @googleapis_reference_link{google/cloud/netapp/v1/replication.proto#L403} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -4037,7 +4104,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteBackupVaultRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup_vault.proto#L280} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -4088,7 +4155,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteBackupVaultRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup_vault.proto#L280} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -4161,7 +4228,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.Backup]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L33} - /// [google.cloud.netapp.v1.CreateBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L218} + /// [google.cloud.netapp.v1.CreateBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L219} /// // clang-format on future> CreateBackup( @@ -4219,7 +4286,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.Backup]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L33} - /// [google.cloud.netapp.v1.CreateBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L218} + /// [google.cloud.netapp.v1.CreateBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L219} /// // clang-format on future> CreateBackup( @@ -4273,7 +4340,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.Backup]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L33} - /// [google.cloud.netapp.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L208} + /// [google.cloud.netapp.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L209} /// // clang-format on StatusOr GetBackup(std::string const& name, @@ -4303,7 +4370,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.Backup]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L33} - /// [google.cloud.netapp.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L208} + /// [google.cloud.netapp.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L209} /// // clang-format on StatusOr GetBackup( @@ -4346,7 +4413,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.Backup]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L33} - /// [google.cloud.netapp.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L158} + /// [google.cloud.netapp.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L159} /// // clang-format on StreamRange ListBackups( @@ -4385,7 +4452,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.Backup]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L33} - /// [google.cloud.netapp.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L158} + /// [google.cloud.netapp.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L159} /// // clang-format on StreamRange ListBackups( @@ -4417,8 +4484,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.DeleteBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L240} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.DeleteBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L241} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> DeleteBackup( @@ -4469,8 +4536,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.DeleteBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L240} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.DeleteBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L241} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> DeleteBackup( @@ -4535,7 +4602,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.Backup]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L33} - /// [google.cloud.netapp.v1.UpdateBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L250} + /// [google.cloud.netapp.v1.UpdateBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L251} /// // clang-format on future> UpdateBackup( @@ -4588,7 +4655,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.Backup]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L33} - /// [google.cloud.netapp.v1.UpdateBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L250} + /// [google.cloud.netapp.v1.UpdateBackupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup.proto#L251} /// // clang-format on future> UpdateBackup( @@ -5022,7 +5089,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteBackupPolicyRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup_policy.proto#L186} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -5073,7 +5140,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteBackupPolicyRequest]: @googleapis_reference_link{google/cloud/netapp/v1/backup_policy.proto#L186} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -5506,7 +5573,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteQuotaRuleRequest]: @googleapis_reference_link{google/cloud/netapp/v1/quota_rule.proto#L114} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -5557,7 +5624,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteQuotaRuleRequest]: @googleapis_reference_link{google/cloud/netapp/v1/quota_rule.proto#L114} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -5624,8 +5691,8 @@ class NetAppClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.netapp.v1.RestoreBackupFilesRequest]: @googleapis_reference_link{google/cloud/netapp/v1/volume.proto#L937} - /// [google.cloud.netapp.v1.RestoreBackupFilesResponse]: @googleapis_reference_link{google/cloud/netapp/v1/volume.proto#L962} + /// [google.cloud.netapp.v1.RestoreBackupFilesRequest]: @googleapis_reference_link{google/cloud/netapp/v1/volume.proto#L970} + /// [google.cloud.netapp.v1.RestoreBackupFilesResponse]: @googleapis_reference_link{google/cloud/netapp/v1/volume.proto#L995} /// // clang-format on future> @@ -6063,7 +6130,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteHostGroupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/host_group.proto#L116} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -6114,7 +6181,7 @@ class NetAppClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.netapp.v1.DeleteHostGroupRequest]: @googleapis_reference_link{google/cloud/netapp/v1/host_group.proto#L116} - /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L838} + /// [google.cloud.netapp.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/netapp/v1/cloud_netapp_service.proto#L891} /// // clang-format on future> @@ -6151,6 +6218,137 @@ class NetAppClient { DeleteHostGroup(google::longrunning::Operation const& operation, Options opts = {}); + // clang-format off + /// + /// `ExecuteOntapPost` dispatches the ONTAP `POST` request to the + /// `StoragePool` cluster. + /// + /// @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.netapp.v1.ExecuteOntapPostRequest]. + /// 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.netapp.v1.ExecuteOntapPostResponse]) + /// 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.netapp.v1.ExecuteOntapPostRequest]: @googleapis_reference_link{google/cloud/netapp/v1/ontap.proto#L31} + /// [google.cloud.netapp.v1.ExecuteOntapPostResponse]: @googleapis_reference_link{google/cloud/netapp/v1/ontap.proto#L54} + /// + // clang-format on + StatusOr + ExecuteOntapPost( + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// `ExecuteOntapGet` dispatches the ONTAP `GET` request to the + /// `StoragePool` cluster. + /// + /// @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.netapp.v1.ExecuteOntapGetRequest]. + /// 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.netapp.v1.ExecuteOntapGetResponse]) + /// 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.netapp.v1.ExecuteOntapGetRequest]: @googleapis_reference_link{google/cloud/netapp/v1/ontap.proto#L60} + /// [google.cloud.netapp.v1.ExecuteOntapGetResponse]: @googleapis_reference_link{google/cloud/netapp/v1/ontap.proto#L70} + /// + // clang-format on + StatusOr ExecuteOntapGet( + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// `ExecuteOntapDelete` dispatches the ONTAP `DELETE` request to the + /// `StoragePool` cluster. + /// + /// @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.netapp.v1.ExecuteOntapDeleteRequest]. + /// 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.netapp.v1.ExecuteOntapDeleteResponse]) + /// 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.netapp.v1.ExecuteOntapDeleteRequest]: @googleapis_reference_link{google/cloud/netapp/v1/ontap.proto#L76} + /// [google.cloud.netapp.v1.ExecuteOntapDeleteResponse]: @googleapis_reference_link{google/cloud/netapp/v1/ontap.proto#L86} + /// + // clang-format on + StatusOr + ExecuteOntapDelete( + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// `ExecuteOntapPatch` dispatches the ONTAP `PATCH` request to the + /// `StoragePool` cluster. + /// + /// @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.netapp.v1.ExecuteOntapPatchRequest]. + /// 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.netapp.v1.ExecuteOntapPatchResponse]) + /// 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.netapp.v1.ExecuteOntapPatchRequest]: @googleapis_reference_link{google/cloud/netapp/v1/ontap.proto#L92} + /// [google.cloud.netapp.v1.ExecuteOntapPatchResponse]: @googleapis_reference_link{google/cloud/netapp/v1/ontap.proto#L115} + /// + // clang-format on + StatusOr + ExecuteOntapPatch( + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request, + Options opts = {}); + // clang-format off /// /// Lists information about the supported locations for this service. @@ -6441,7 +6639,7 @@ class NetAppClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -6480,7 +6678,7 @@ class NetAppClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/netapp/v1/net_app_connection.cc b/google/cloud/netapp/v1/net_app_connection.cc index 29a4735f4056c..65a939b0e1a65 100644 --- a/google/cloud/netapp/v1/net_app_connection.cc +++ b/google/cloud/netapp/v1/net_app_connection.cc @@ -259,6 +259,30 @@ NetAppConnection::RevertVolume(google::longrunning::Operation const&) { Status(StatusCode::kUnimplemented, "not implemented")); } +future> +NetAppConnection::EstablishVolumePeering( + google::cloud::netapp::v1::EstablishVolumePeeringRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetAppConnection::EstablishVolumePeering( + NoAwaitTag, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetAppConnection::EstablishVolumePeering( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + StreamRange NetAppConnection::ListSnapshots( google::cloud::netapp::v1:: @@ -1108,6 +1132,30 @@ NetAppConnection::DeleteHostGroup(google::longrunning::Operation const&) { Status(StatusCode::kUnimplemented, "not implemented")); } +StatusOr +NetAppConnection::ExecuteOntapPost( + google::cloud::netapp::v1::ExecuteOntapPostRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +NetAppConnection::ExecuteOntapGet( + google::cloud::netapp::v1::ExecuteOntapGetRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +NetAppConnection::ExecuteOntapDelete( + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +NetAppConnection::ExecuteOntapPatch( + google::cloud::netapp::v1::ExecuteOntapPatchRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + StreamRange NetAppConnection::ListLocations( google::cloud::location:: ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) diff --git a/google/cloud/netapp/v1/net_app_connection.h b/google/cloud/netapp/v1/net_app_connection.h index 2ec65dc67014a..ad1343f7b6844 100644 --- a/google/cloud/netapp/v1/net_app_connection.h +++ b/google/cloud/netapp/v1/net_app_connection.h @@ -291,6 +291,17 @@ class NetAppConnection { virtual future> RevertVolume( google::longrunning::Operation const& operation); + virtual future> + EstablishVolumePeering( + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request); + + virtual StatusOr EstablishVolumePeering( + NoAwaitTag, + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request); + + virtual future> + EstablishVolumePeering(google::longrunning::Operation const& operation); + virtual StreamRange ListSnapshots( google::cloud::netapp::v1::ListSnapshotsRequest request); @@ -724,6 +735,22 @@ class NetAppConnection { virtual future> DeleteHostGroup(google::longrunning::Operation const& operation); + virtual StatusOr + ExecuteOntapPost( + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request); + + virtual StatusOr + ExecuteOntapGet( + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request); + + virtual StatusOr + ExecuteOntapDelete( + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request); + + virtual StatusOr + ExecuteOntapPatch( + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request); + virtual StreamRange ListLocations( google::cloud::location::ListLocationsRequest request); diff --git a/google/cloud/netapp/v1/net_app_connection_idempotency_policy.cc b/google/cloud/netapp/v1/net_app_connection_idempotency_policy.cc index 5b253a9762ddb..0caf1ced3a63c 100644 --- a/google/cloud/netapp/v1/net_app_connection_idempotency_policy.cc +++ b/google/cloud/netapp/v1/net_app_connection_idempotency_policy.cc @@ -99,6 +99,11 @@ Idempotency NetAppConnectionIdempotencyPolicy::RevertVolume( return Idempotency::kNonIdempotent; } +Idempotency NetAppConnectionIdempotencyPolicy::EstablishVolumePeering( + google::cloud::netapp::v1::EstablishVolumePeeringRequest const&) { + return Idempotency::kNonIdempotent; +} + Idempotency NetAppConnectionIdempotencyPolicy::ListSnapshots( google::cloud::netapp::v1::ListSnapshotsRequest) { // NOLINT return Idempotency::kIdempotent; @@ -364,6 +369,26 @@ Idempotency NetAppConnectionIdempotencyPolicy::DeleteHostGroup( return Idempotency::kNonIdempotent; } +Idempotency NetAppConnectionIdempotencyPolicy::ExecuteOntapPost( + google::cloud::netapp::v1::ExecuteOntapPostRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency NetAppConnectionIdempotencyPolicy::ExecuteOntapGet( + google::cloud::netapp::v1::ExecuteOntapGetRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency NetAppConnectionIdempotencyPolicy::ExecuteOntapDelete( + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency NetAppConnectionIdempotencyPolicy::ExecuteOntapPatch( + google::cloud::netapp::v1::ExecuteOntapPatchRequest const&) { + return Idempotency::kNonIdempotent; +} + Idempotency NetAppConnectionIdempotencyPolicy::ListLocations( google::cloud::location::ListLocationsRequest) { // NOLINT return Idempotency::kIdempotent; diff --git a/google/cloud/netapp/v1/net_app_connection_idempotency_policy.h b/google/cloud/netapp/v1/net_app_connection_idempotency_policy.h index e77e1129d518f..8dd32b905e791 100644 --- a/google/cloud/netapp/v1/net_app_connection_idempotency_policy.h +++ b/google/cloud/netapp/v1/net_app_connection_idempotency_policy.h @@ -78,6 +78,9 @@ class NetAppConnectionIdempotencyPolicy { virtual google::cloud::Idempotency RevertVolume( google::cloud::netapp::v1::RevertVolumeRequest const& request); + virtual google::cloud::Idempotency EstablishVolumePeering( + google::cloud::netapp::v1::EstablishVolumePeeringRequest const& request); + virtual google::cloud::Idempotency ListSnapshots( google::cloud::netapp::v1::ListSnapshotsRequest request); @@ -238,6 +241,18 @@ class NetAppConnectionIdempotencyPolicy { virtual google::cloud::Idempotency DeleteHostGroup( google::cloud::netapp::v1::DeleteHostGroupRequest const& request); + virtual google::cloud::Idempotency ExecuteOntapPost( + google::cloud::netapp::v1::ExecuteOntapPostRequest const& request); + + virtual google::cloud::Idempotency ExecuteOntapGet( + google::cloud::netapp::v1::ExecuteOntapGetRequest const& request); + + virtual google::cloud::Idempotency ExecuteOntapDelete( + google::cloud::netapp::v1::ExecuteOntapDeleteRequest const& request); + + virtual google::cloud::Idempotency ExecuteOntapPatch( + google::cloud::netapp::v1::ExecuteOntapPatchRequest const& request); + virtual google::cloud::Idempotency ListLocations( google::cloud::location::ListLocationsRequest request); diff --git a/google/cloud/networkconnectivity/quickstart/.bazelversion b/google/cloud/networkconnectivity/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/networkconnectivity/quickstart/.bazelversion +++ b/google/cloud/networkconnectivity/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/networkconnectivity/quickstart/WORKSPACE.bazel b/google/cloud/networkconnectivity/quickstart/WORKSPACE.bazel index 8b13af4ab57ee..b34ea0a05e3ad 100644 --- a/google/cloud/networkconnectivity/quickstart/WORKSPACE.bazel +++ b/google/cloud/networkconnectivity/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/networkconnectivity/v1/data_transfer_client.h b/google/cloud/networkconnectivity/v1/data_transfer_client.h index d15e78472be27..fa251bcf01833 100644 --- a/google/cloud/networkconnectivity/v1/data_transfer_client.h +++ b/google/cloud/networkconnectivity/v1/data_transfer_client.h @@ -1644,7 +1644,7 @@ class DataTransferServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1683,7 +1683,7 @@ class DataTransferServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/networkconnectivity/v1/hub_client.h b/google/cloud/networkconnectivity/v1/hub_client.h index e41028baf726c..e351c65f21b5b 100644 --- a/google/cloud/networkconnectivity/v1/hub_client.h +++ b/google/cloud/networkconnectivity/v1/hub_client.h @@ -2611,7 +2611,7 @@ class HubServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2650,7 +2650,7 @@ class HubServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/networkconnectivity/v1/policy_based_routing_client.h b/google/cloud/networkconnectivity/v1/policy_based_routing_client.h index 9720461c8235c..eadf2da02cc35 100644 --- a/google/cloud/networkconnectivity/v1/policy_based_routing_client.h +++ b/google/cloud/networkconnectivity/v1/policy_based_routing_client.h @@ -865,7 +865,7 @@ class PolicyBasedRoutingServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -904,7 +904,7 @@ class PolicyBasedRoutingServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/networkmanagement/quickstart/.bazelversion b/google/cloud/networkmanagement/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/networkmanagement/quickstart/.bazelversion +++ b/google/cloud/networkmanagement/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/networkmanagement/quickstart/WORKSPACE.bazel b/google/cloud/networkmanagement/quickstart/WORKSPACE.bazel index 8153fadd2fbd4..19a18feea4346 100644 --- a/google/cloud/networkmanagement/quickstart/WORKSPACE.bazel +++ b/google/cloud/networkmanagement/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/networkmanagement/v1/reachability_client.h b/google/cloud/networkmanagement/v1/reachability_client.h index 5a6bd2f446b7d..d8d1b165ffd11 100644 --- a/google/cloud/networkmanagement/v1/reachability_client.h +++ b/google/cloud/networkmanagement/v1/reachability_client.h @@ -1127,7 +1127,7 @@ class ReachabilityServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1166,7 +1166,7 @@ class ReachabilityServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/networksecurity/quickstart/.bazelversion b/google/cloud/networksecurity/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/networksecurity/quickstart/.bazelversion +++ b/google/cloud/networksecurity/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/networksecurity/quickstart/WORKSPACE.bazel b/google/cloud/networksecurity/quickstart/WORKSPACE.bazel index fc60e4c79e811..dc92726ee2b33 100644 --- a/google/cloud/networksecurity/quickstart/WORKSPACE.bazel +++ b/google/cloud/networksecurity/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/networksecurity/v1/.repo-metadata.json b/google/cloud/networksecurity/v1/.repo-metadata.json index ba2fe5f682b1c..2c2c426681465 100644 --- a/google/cloud/networksecurity/v1/.repo-metadata.json +++ b/google/cloud/networksecurity/v1/.repo-metadata.json @@ -3,10 +3,11 @@ "api_shortname": "networksecurity", "client_documentation": "https://cloud.google.com/cpp/docs/reference/networksecurity/latest", "distribution_name": "google-cloud-cpp", + "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:1132189%20status=open", "language": "cpp", "library_type": "GAPIC_AUTO", "name_pretty": "Network Security API", - "product_documentation": "https://cloud.google.com/secure-web-proxy/docs", + "product_documentation": "https://cloud.google.com/products/networking", "release_level": "stable", "repo": "googleapis/google-cloud-cpp", "requires_billing": true diff --git a/google/cloud/networksecurity/v1/internal/network_security_auth_decorator.cc b/google/cloud/networksecurity/v1/internal/network_security_auth_decorator.cc index 7302ea4983134..33b6823226e63 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_auth_decorator.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_auth_decorator.cc @@ -147,6 +147,120 @@ NetworkSecurityAuth::DeleteAuthorizationPolicy( return child_->DeleteAuthorizationPolicy(context, options, request); } +StatusOr +NetworkSecurityAuth::ListBackendAuthenticationConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListBackendAuthenticationConfigs(context, options, request); +} + +StatusOr +NetworkSecurityAuth::GetBackendAuthenticationConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetBackendAuthenticationConfig(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncCreateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest 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->AsyncCreateBackendAuthenticationConfig( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +NetworkSecurityAuth::CreateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateBackendAuthenticationConfig(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncUpdateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest 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->AsyncUpdateBackendAuthenticationConfig( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +NetworkSecurityAuth::UpdateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateBackendAuthenticationConfig(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncDeleteBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest 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->AsyncDeleteBackendAuthenticationConfig( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +NetworkSecurityAuth::DeleteBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteBackendAuthenticationConfig(context, options, request); +} + StatusOr NetworkSecurityAuth::ListServerTlsPolicies( grpc::ClientContext& context, Options const& options, @@ -373,6 +487,558 @@ NetworkSecurityAuth::DeleteClientTlsPolicy( return child_->DeleteClientTlsPolicy(context, options, request); } +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse> +NetworkSecurityAuth::ListGatewaySecurityPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListGatewaySecurityPolicies(context, options, request); +} + +StatusOr +NetworkSecurityAuth::GetGatewaySecurityPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetGatewaySecurityPolicy(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncCreateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest 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->AsyncCreateGatewaySecurityPolicy( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +NetworkSecurityAuth::CreateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateGatewaySecurityPolicy(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncUpdateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest 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->AsyncUpdateGatewaySecurityPolicy( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +NetworkSecurityAuth::UpdateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateGatewaySecurityPolicy(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncDeleteGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest 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->AsyncDeleteGatewaySecurityPolicy( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +NetworkSecurityAuth::DeleteGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteGatewaySecurityPolicy(context, options, request); +} + +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesResponse> +NetworkSecurityAuth::ListGatewaySecurityPolicyRules( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListGatewaySecurityPolicyRules(context, options, request); +} + +StatusOr +NetworkSecurityAuth::GetGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetGatewaySecurityPolicyRule(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncCreateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest 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->AsyncCreateGatewaySecurityPolicyRule( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +NetworkSecurityAuth::CreateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateGatewaySecurityPolicyRule(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncUpdateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest 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->AsyncUpdateGatewaySecurityPolicyRule( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +NetworkSecurityAuth::UpdateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateGatewaySecurityPolicyRule(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncDeleteGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest 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->AsyncDeleteGatewaySecurityPolicyRule( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +NetworkSecurityAuth::DeleteGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteGatewaySecurityPolicyRule(context, options, request); +} + +StatusOr +NetworkSecurityAuth::ListUrlLists( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListUrlListsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListUrlLists(context, options, request); +} + +StatusOr +NetworkSecurityAuth::GetUrlList( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetUrlListRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetUrlList(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncCreateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateUrlListRequest 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->AsyncCreateUrlList(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr NetworkSecurityAuth::CreateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateUrlList(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncUpdateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateUrlListRequest 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->AsyncUpdateUrlList(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr NetworkSecurityAuth::UpdateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateUrlList(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncDeleteUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteUrlListRequest 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->AsyncDeleteUrlList(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr NetworkSecurityAuth::DeleteUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteUrlList(context, options, request); +} + +StatusOr +NetworkSecurityAuth::ListTlsInspectionPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListTlsInspectionPolicies(context, options, request); +} + +StatusOr +NetworkSecurityAuth::GetTlsInspectionPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetTlsInspectionPolicy(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncCreateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest 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->AsyncCreateTlsInspectionPolicy( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +NetworkSecurityAuth::CreateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateTlsInspectionPolicy(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncUpdateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest 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->AsyncUpdateTlsInspectionPolicy( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +NetworkSecurityAuth::UpdateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateTlsInspectionPolicy(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncDeleteTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest 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->AsyncDeleteTlsInspectionPolicy( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +NetworkSecurityAuth::DeleteTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteTlsInspectionPolicy(context, options, request); +} + +StatusOr +NetworkSecurityAuth::ListAuthzPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListAuthzPolicies(context, options, request); +} + +StatusOr +NetworkSecurityAuth::GetAuthzPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetAuthzPolicy(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncCreateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest 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->AsyncCreateAuthzPolicy(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr NetworkSecurityAuth::CreateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateAuthzPolicy(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncUpdateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest 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->AsyncUpdateAuthzPolicy(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr NetworkSecurityAuth::UpdateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateAuthzPolicy(context, options, request); +} + +future> +NetworkSecurityAuth::AsyncDeleteAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest 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->AsyncDeleteAuthzPolicy(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr NetworkSecurityAuth::DeleteAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteAuthzPolicy(context, options, request); +} + StatusOr NetworkSecurityAuth::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/networksecurity/v1/internal/network_security_auth_decorator.h b/google/cloud/networksecurity/v1/internal/network_security_auth_decorator.h index 36f797eaf8f55..c240c1e0089b3 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_auth_decorator.h +++ b/google/cloud/networksecurity/v1/internal/network_security_auth_decorator.h @@ -94,6 +94,58 @@ class NetworkSecurityAuth : public NetworkSecurityStub { google::cloud::networksecurity::v1:: DeleteAuthorizationPolicyRequest const& request) override; + StatusOr + ListBackendAuthenticationConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& request) override; + + StatusOr + GetBackendAuthenticationConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncCreateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + StatusOr CreateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncUpdateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + StatusOr UpdateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncDeleteBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + + StatusOr DeleteBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + StatusOr ListServerTlsPolicies( grpc::ClientContext& context, Options const& options, @@ -190,6 +242,255 @@ class NetworkSecurityAuth : public NetworkSecurityStub { google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& request) override; + StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse> + ListGatewaySecurityPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) override; + + StatusOr + GetGatewaySecurityPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) override; + + future> + AsyncCreateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + future> + AsyncUpdateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + future> + AsyncDeleteGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + StatusOr + ListGatewaySecurityPolicyRules( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) override; + + StatusOr + GetGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncCreateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncUpdateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncDeleteGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr + ListUrlLists(grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListUrlListsRequest const& + request) override; + + StatusOr GetUrlList( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetUrlListRequest const& request) + override; + + future> AsyncCreateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + StatusOr CreateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + future> AsyncUpdateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + StatusOr UpdateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + future> AsyncDeleteUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) + override; + + StatusOr DeleteUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) + override; + + StatusOr< + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesResponse> + ListTlsInspectionPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListTlsInspectionPoliciesRequest const& request) override; + + StatusOr + GetTlsInspectionPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) override; + + future> + AsyncCreateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + StatusOr CreateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + future> + AsyncUpdateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + StatusOr UpdateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + future> + AsyncDeleteTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + StatusOr DeleteTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + StatusOr + ListAuthzPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest const& + request) override; + + StatusOr GetAuthzPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) + override; + + future> AsyncCreateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + StatusOr CreateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + future> AsyncUpdateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + StatusOr UpdateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + future> AsyncDeleteAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + + StatusOr DeleteAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/networksecurity/v1/internal/network_security_connection_impl.cc b/google/cloud/networksecurity/v1/internal/network_security_connection_impl.cc index e2b62aca1117b..21540842101d6 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_connection_impl.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_connection_impl.cc @@ -407,76 +407,2122 @@ NetworkSecurityConnectionImpl::DeleteAuthorizationPolicy( polling_policy(*current), __func__); } +StreamRange +NetworkSecurityConnectionImpl::ListBackendAuthenticationConfigs( + google::cloud::networksecurity::v1::ListBackendAuthenticationConfigsRequest + request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListBackendAuthenticationConfigs(request); + char const* function_name = __func__; + return google::cloud::internal::MakePaginationRange>( + 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::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& request) { + return stub->ListBackendAuthenticationConfigs(context, options, + request); + }, + options, r, function_name); + }, + [](google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsResponse r) { + std::vector< + google::cloud::networksecurity::v1::BackendAuthenticationConfig> + result(r.backend_authentication_configs().size()); + auto& messages = *r.mutable_backend_authentication_configs(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +NetworkSecurityConnectionImpl::GetBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetBackendAuthenticationConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) { + return stub_->GetBackendAuthenticationConfig(context, options, request); + }, + *current, request, __func__); +} + +future< + StatusOr> +NetworkSecurityConnectionImpl::CreateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateBackendAuthenticationConfig( + request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::v1::BackendAuthenticationConfig>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + return stub->AsyncCreateBackendAuthenticationConfig( + 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::networksecurity::v1::BackendAuthenticationConfig>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::CreateBackendAuthenticationConfig( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateBackendAuthenticationConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + return stub_->CreateBackendAuthenticationConfig(context, options, + request); + }, + *current, request, __func__); +} + +future< + StatusOr> +NetworkSecurityConnectionImpl::CreateBackendAuthenticationConfig( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to " + "CreateBackendAuthenticationConfig", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::v1::BackendAuthenticationConfig>( + 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::networksecurity::v1::BackendAuthenticationConfig>, + polling_policy(*current), __func__); +} + +future< + StatusOr> +NetworkSecurityConnectionImpl::UpdateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateBackendAuthenticationConfig( + request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::v1::BackendAuthenticationConfig>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + return stub->AsyncUpdateBackendAuthenticationConfig( + 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::networksecurity::v1::BackendAuthenticationConfig>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::UpdateBackendAuthenticationConfig( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateBackendAuthenticationConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + return stub_->UpdateBackendAuthenticationConfig(context, options, + request); + }, + *current, request, __func__); +} + +future< + StatusOr> +NetworkSecurityConnectionImpl::UpdateBackendAuthenticationConfig( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to " + "UpdateBackendAuthenticationConfig", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::v1::BackendAuthenticationConfig>( + 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::networksecurity::v1::BackendAuthenticationConfig>, + polling_policy(*current), __func__); +} + +future> +NetworkSecurityConnectionImpl::DeleteBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteBackendAuthenticationConfig( + request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::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::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + return stub->AsyncDeleteBackendAuthenticationConfig( + 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::networksecurity::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::DeleteBackendAuthenticationConfig( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteBackendAuthenticationConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + return stub_->DeleteBackendAuthenticationConfig(context, options, + request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::DeleteBackendAuthenticationConfig( + 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 " + "DeleteBackendAuthenticationConfig", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::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::networksecurity::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + StreamRange NetworkSecurityConnectionImpl::ListServerTlsPolicies( google::cloud::networksecurity::v1::ListServerTlsPoliciesRequest request) { request.clear_page_token(); auto current = google::cloud::internal::SaveCurrentOptions(); auto idempotency = - idempotency_policy(*current)->ListServerTlsPolicies(request); + idempotency_policy(*current)->ListServerTlsPolicies(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::networksecurity::v1:: + ListServerTlsPoliciesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListServerTlsPoliciesRequest const& request) { + return stub->ListServerTlsPolicies(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::networksecurity::v1::ListServerTlsPoliciesResponse r) { + std::vector result( + r.server_tls_policies().size()); + auto& messages = *r.mutable_server_tls_policies(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +NetworkSecurityConnectionImpl::GetServerTlsPolicy( + google::cloud::networksecurity::v1::GetServerTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetServerTlsPolicy(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetServerTlsPolicyRequest const& + request) { + return stub_->GetServerTlsPolicy(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::CreateServerTlsPolicy( + google::cloud::networksecurity::v1::CreateServerTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateServerTlsPolicy(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::v1::ServerTlsPolicy>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateServerTlsPolicyRequest const& request) { + return stub->AsyncCreateServerTlsPolicy(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::networksecurity::v1::ServerTlsPolicy>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::CreateServerTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateServerTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateServerTlsPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + CreateServerTlsPolicyRequest const& request) { + return stub_->CreateServerTlsPolicy(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::CreateServerTlsPolicy( + 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 CreateServerTlsPolicy", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::v1::ServerTlsPolicy>( + 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::networksecurity::v1::ServerTlsPolicy>, + polling_policy(*current), __func__); +} + +future> +NetworkSecurityConnectionImpl::UpdateServerTlsPolicy( + google::cloud::networksecurity::v1::UpdateServerTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateServerTlsPolicy(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::v1::ServerTlsPolicy>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateServerTlsPolicyRequest const& request) { + return stub->AsyncUpdateServerTlsPolicy(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::networksecurity::v1::ServerTlsPolicy>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::UpdateServerTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateServerTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateServerTlsPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + UpdateServerTlsPolicyRequest const& request) { + return stub_->UpdateServerTlsPolicy(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::UpdateServerTlsPolicy( + 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 UpdateServerTlsPolicy", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::v1::ServerTlsPolicy>( + 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::networksecurity::v1::ServerTlsPolicy>, + polling_policy(*current), __func__); +} + +future> +NetworkSecurityConnectionImpl::DeleteServerTlsPolicy( + google::cloud::networksecurity::v1::DeleteServerTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteServerTlsPolicy(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::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::networksecurity::v1:: + DeleteServerTlsPolicyRequest const& request) { + return stub->AsyncDeleteServerTlsPolicy(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::networksecurity::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::DeleteServerTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteServerTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteServerTlsPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + DeleteServerTlsPolicyRequest const& request) { + return stub_->DeleteServerTlsPolicy(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::DeleteServerTlsPolicy( + 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 DeleteServerTlsPolicy", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::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::networksecurity::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +NetworkSecurityConnectionImpl::ListClientTlsPolicies( + google::cloud::networksecurity::v1::ListClientTlsPoliciesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListClientTlsPolicies(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::networksecurity::v1:: + ListClientTlsPoliciesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListClientTlsPoliciesRequest const& request) { + return stub->ListClientTlsPolicies(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::networksecurity::v1::ListClientTlsPoliciesResponse r) { + std::vector result( + r.client_tls_policies().size()); + auto& messages = *r.mutable_client_tls_policies(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +NetworkSecurityConnectionImpl::GetClientTlsPolicy( + google::cloud::networksecurity::v1::GetClientTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetClientTlsPolicy(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetClientTlsPolicyRequest const& + request) { + return stub_->GetClientTlsPolicy(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::CreateClientTlsPolicy( + google::cloud::networksecurity::v1::CreateClientTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateClientTlsPolicy(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::v1::ClientTlsPolicy>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateClientTlsPolicyRequest const& request) { + return stub->AsyncCreateClientTlsPolicy(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::networksecurity::v1::ClientTlsPolicy>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::CreateClientTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateClientTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateClientTlsPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + CreateClientTlsPolicyRequest const& request) { + return stub_->CreateClientTlsPolicy(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::CreateClientTlsPolicy( + 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 CreateClientTlsPolicy", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::v1::ClientTlsPolicy>( + 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::networksecurity::v1::ClientTlsPolicy>, + polling_policy(*current), __func__); +} + +future> +NetworkSecurityConnectionImpl::UpdateClientTlsPolicy( + google::cloud::networksecurity::v1::UpdateClientTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateClientTlsPolicy(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::v1::ClientTlsPolicy>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateClientTlsPolicyRequest const& request) { + return stub->AsyncUpdateClientTlsPolicy(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::networksecurity::v1::ClientTlsPolicy>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::UpdateClientTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateClientTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateClientTlsPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + UpdateClientTlsPolicyRequest const& request) { + return stub_->UpdateClientTlsPolicy(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::UpdateClientTlsPolicy( + 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 UpdateClientTlsPolicy", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::v1::ClientTlsPolicy>( + 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::networksecurity::v1::ClientTlsPolicy>, + polling_policy(*current), __func__); +} + +future> +NetworkSecurityConnectionImpl::DeleteClientTlsPolicy( + google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteClientTlsPolicy(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::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::networksecurity::v1:: + DeleteClientTlsPolicyRequest const& request) { + return stub->AsyncDeleteClientTlsPolicy(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::networksecurity::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::DeleteClientTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteClientTlsPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + DeleteClientTlsPolicyRequest const& request) { + return stub_->DeleteClientTlsPolicy(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::DeleteClientTlsPolicy( + 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 DeleteClientTlsPolicy", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::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::networksecurity::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +NetworkSecurityConnectionImpl::ListGatewaySecurityPolicies( + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesRequest + request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListGatewaySecurityPolicies(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::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) { + return stub->ListGatewaySecurityPolicies(context, options, + request); + }, + options, r, function_name); + }, + [](google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse + r) { + std::vector + result(r.gateway_security_policies().size()); + auto& messages = *r.mutable_gateway_security_policies(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +NetworkSecurityConnectionImpl::GetGatewaySecurityPolicy( + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetGatewaySecurityPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRequest const& request) { + return stub_->GetGatewaySecurityPolicy(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::CreateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateGatewaySecurityPolicy(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::v1::GatewaySecurityPolicy>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + return stub->AsyncCreateGatewaySecurityPolicy( + 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::networksecurity::v1::GatewaySecurityPolicy>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::CreateGatewaySecurityPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateGatewaySecurityPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + return stub_->CreateGatewaySecurityPolicy(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::CreateGatewaySecurityPolicy( + 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 CreateGatewaySecurityPolicy", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::v1::GatewaySecurityPolicy>( + 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::networksecurity::v1::GatewaySecurityPolicy>, + polling_policy(*current), __func__); +} + +future> +NetworkSecurityConnectionImpl::UpdateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateGatewaySecurityPolicy(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::v1::GatewaySecurityPolicy>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + return stub->AsyncUpdateGatewaySecurityPolicy( + 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::networksecurity::v1::GatewaySecurityPolicy>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::UpdateGatewaySecurityPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateGatewaySecurityPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + return stub_->UpdateGatewaySecurityPolicy(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::UpdateGatewaySecurityPolicy( + 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 UpdateGatewaySecurityPolicy", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::v1::GatewaySecurityPolicy>( + 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::networksecurity::v1::GatewaySecurityPolicy>, + polling_policy(*current), __func__); +} + +future> +NetworkSecurityConnectionImpl::DeleteGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteGatewaySecurityPolicy(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::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::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + return stub->AsyncDeleteGatewaySecurityPolicy( + 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::networksecurity::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::DeleteGatewaySecurityPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteGatewaySecurityPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + return stub_->DeleteGatewaySecurityPolicy(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::DeleteGatewaySecurityPolicy( + 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 DeleteGatewaySecurityPolicy", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::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::networksecurity::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +NetworkSecurityConnectionImpl::ListGatewaySecurityPolicyRules( + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesRequest + request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListGatewaySecurityPolicyRules(request); + char const* function_name = __func__; + return google::cloud::internal::MakePaginationRange>( + 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::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) { + return stub->ListGatewaySecurityPolicyRules(context, options, + request); + }, + options, r, function_name); + }, + [](google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesResponse r) { + std::vector< + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule> + result(r.gateway_security_policy_rules().size()); + auto& messages = *r.mutable_gateway_security_policy_rules(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +NetworkSecurityConnectionImpl::GetGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetGatewaySecurityPolicyRule(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) { + return stub_->GetGatewaySecurityPolicyRule(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::CreateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateGatewaySecurityPolicyRule( + request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + return stub->AsyncCreateGatewaySecurityPolicyRule( + 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::networksecurity::v1::GatewaySecurityPolicyRule>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::CreateGatewaySecurityPolicyRule( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateGatewaySecurityPolicyRule(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + return stub_->CreateGatewaySecurityPolicyRule(context, options, + request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::CreateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateGatewaySecurityPolicyRule", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule>( + 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::networksecurity::v1::GatewaySecurityPolicyRule>, + polling_policy(*current), __func__); +} + +future> +NetworkSecurityConnectionImpl::UpdateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateGatewaySecurityPolicyRule( + request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + return stub->AsyncUpdateGatewaySecurityPolicyRule( + 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::networksecurity::v1::GatewaySecurityPolicyRule>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::UpdateGatewaySecurityPolicyRule( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateGatewaySecurityPolicyRule(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + return stub_->UpdateGatewaySecurityPolicyRule(context, options, + request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::UpdateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateGatewaySecurityPolicyRule", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule>( + 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::networksecurity::v1::GatewaySecurityPolicyRule>, + polling_policy(*current), __func__); +} + +future> +NetworkSecurityConnectionImpl::DeleteGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteGatewaySecurityPolicyRule( + request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::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::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + return stub->AsyncDeleteGatewaySecurityPolicyRule( + 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::networksecurity::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::DeleteGatewaySecurityPolicyRule( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteGatewaySecurityPolicyRule(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + return stub_->DeleteGatewaySecurityPolicyRule(context, options, + request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::DeleteGatewaySecurityPolicyRule( + 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 DeleteGatewaySecurityPolicyRule", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::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::networksecurity::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +NetworkSecurityConnectionImpl::ListUrlLists( + google::cloud::networksecurity::v1::ListUrlListsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListUrlLists(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::networksecurity::v1::ListUrlListsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListUrlListsRequest const& + request) { + return stub->ListUrlLists(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::networksecurity::v1::ListUrlListsResponse r) { + std::vector result( + r.url_lists().size()); + auto& messages = *r.mutable_url_lists(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +NetworkSecurityConnectionImpl::GetUrlList( + google::cloud::networksecurity::v1::GetUrlListRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetUrlList(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetUrlListRequest const& + request) { + return stub_->GetUrlList(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::CreateUrlList( + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateUrlList(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::v1::UrlList>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& + request) { + return stub->AsyncCreateUrlList(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::networksecurity::v1::UrlList>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::CreateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateUrlList(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& + request) { + return stub_->CreateUrlList(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::CreateUrlList( + 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 CreateUrlList", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::v1::UrlList>( + 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::networksecurity::v1::UrlList>, + polling_policy(*current), __func__); +} + +future> +NetworkSecurityConnectionImpl::UpdateUrlList( + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateUrlList(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::v1::UrlList>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& + request) { + return stub->AsyncUpdateUrlList(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::networksecurity::v1::UrlList>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::UpdateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateUrlList(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& + request) { + return stub_->UpdateUrlList(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::UpdateUrlList( + 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 UpdateUrlList", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::v1::UrlList>( + 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::networksecurity::v1::UrlList>, + polling_policy(*current), __func__); +} + +future> +NetworkSecurityConnectionImpl::DeleteUrlList( + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteUrlList(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::networksecurity::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::networksecurity::v1::DeleteUrlListRequest const& + request) { + return stub->AsyncDeleteUrlList(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::networksecurity::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +NetworkSecurityConnectionImpl::DeleteUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteUrlList(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& + request) { + return stub_->DeleteUrlList(context, options, request); + }, + *current, request, __func__); +} + +future> +NetworkSecurityConnectionImpl::DeleteUrlList( + 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 DeleteUrlList", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::networksecurity::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::networksecurity::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +NetworkSecurityConnectionImpl::ListTlsInspectionPolicies( + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest + request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListTlsInspectionPolicies(request); char const* function_name = __func__; return google::cloud::internal::MakePaginationRange< - StreamRange>( + 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::networksecurity::v1:: - ListServerTlsPoliciesRequest const& r) { + Options const& options, + google::cloud::networksecurity::v1:: + ListTlsInspectionPoliciesRequest const& r) { return google::cloud::internal::RetryLoop( retry->clone(), backoff->clone(), idempotency, [stub](grpc::ClientContext& context, Options const& options, google::cloud::networksecurity::v1:: - ListServerTlsPoliciesRequest const& request) { - return stub->ListServerTlsPolicies(context, options, request); + ListTlsInspectionPoliciesRequest const& request) { + return stub->ListTlsInspectionPolicies(context, options, request); }, options, r, function_name); }, - [](google::cloud::networksecurity::v1::ListServerTlsPoliciesResponse r) { - std::vector result( - r.server_tls_policies().size()); - auto& messages = *r.mutable_server_tls_policies(); + [](google::cloud::networksecurity::v1::ListTlsInspectionPoliciesResponse + r) { + std::vector + result(r.tls_inspection_policies().size()); + auto& messages = *r.mutable_tls_inspection_policies(); std::move(messages.begin(), messages.end(), result.begin()); return result; }); } -StatusOr -NetworkSecurityConnectionImpl::GetServerTlsPolicy( - google::cloud::networksecurity::v1::GetServerTlsPolicyRequest const& +StatusOr +NetworkSecurityConnectionImpl::GetTlsInspectionPolicy( + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); return google::cloud::internal::RetryLoop( retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->GetServerTlsPolicy(request), - [this]( - grpc::ClientContext& context, Options const& options, - google::cloud::networksecurity::v1::GetServerTlsPolicyRequest const& - request) { - return stub_->GetServerTlsPolicy(context, options, request); + idempotency_policy(*current)->GetTlsInspectionPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetTlsInspectionPolicyRequest const& request) { + return stub_->GetTlsInspectionPolicy(context, options, request); }, *current, request, __func__); } -future> -NetworkSecurityConnectionImpl::CreateServerTlsPolicy( - google::cloud::networksecurity::v1::CreateServerTlsPolicyRequest const& +future> +NetworkSecurityConnectionImpl::CreateTlsInspectionPolicy( + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); auto request_copy = request; auto const idempotent = - idempotency_policy(*current)->CreateServerTlsPolicy(request_copy); + idempotency_policy(*current)->CreateTlsInspectionPolicy(request_copy); return google::cloud::internal::AsyncLongRunningOperation< - google::cloud::networksecurity::v1::ServerTlsPolicy>( + google::cloud::networksecurity::v1::TlsInspectionPolicy>( background_->cq(), current, std::move(request_copy), [stub = stub_](google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::cloud::networksecurity::v1:: - CreateServerTlsPolicyRequest const& request) { - return stub->AsyncCreateServerTlsPolicy(cq, std::move(context), - std::move(options), request); + CreateTlsInspectionPolicyRequest const& request) { + return stub->AsyncCreateTlsInspectionPolicy( + cq, std::move(context), std::move(options), request); }, [stub = stub_](google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -494,45 +2540,45 @@ NetworkSecurityConnectionImpl::CreateServerTlsPolicy( std::move(options), request); }, &google::cloud::internal::ExtractLongRunningResultResponse< - google::cloud::networksecurity::v1::ServerTlsPolicy>, + google::cloud::networksecurity::v1::TlsInspectionPolicy>, retry_policy(*current), backoff_policy(*current), idempotent, polling_policy(*current), __func__); } StatusOr -NetworkSecurityConnectionImpl::CreateServerTlsPolicy( +NetworkSecurityConnectionImpl::CreateTlsInspectionPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::CreateServerTlsPolicyRequest const& + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); return google::cloud::internal::RetryLoop( retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->CreateServerTlsPolicy(request), + idempotency_policy(*current)->CreateTlsInspectionPolicy(request), [this](grpc::ClientContext& context, Options const& options, google::cloud::networksecurity::v1:: - CreateServerTlsPolicyRequest const& request) { - return stub_->CreateServerTlsPolicy(context, options, request); + CreateTlsInspectionPolicyRequest const& request) { + return stub_->CreateTlsInspectionPolicy(context, options, request); }, *current, request, __func__); } -future> -NetworkSecurityConnectionImpl::CreateServerTlsPolicy( +future> +NetworkSecurityConnectionImpl::CreateTlsInspectionPolicy( google::longrunning::Operation const& operation) { auto current = google::cloud::internal::SaveCurrentOptions(); if (!operation.metadata() .Is()) { return make_ready_future< - StatusOr>( + StatusOr>( internal::InvalidArgumentError( - "operation does not correspond to CreateServerTlsPolicy", + "operation does not correspond to CreateTlsInspectionPolicy", GCP_ERROR_INFO().WithMetadata("operation", operation.metadata().DebugString()))); } return google::cloud::internal::AsyncAwaitLongRunningOperation< - google::cloud::networksecurity::v1::ServerTlsPolicy>( + google::cloud::networksecurity::v1::TlsInspectionPolicy>( background_->cq(), current, operation, [stub = stub_](google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -550,28 +2596,28 @@ NetworkSecurityConnectionImpl::CreateServerTlsPolicy( std::move(options), request); }, &google::cloud::internal::ExtractLongRunningResultResponse< - google::cloud::networksecurity::v1::ServerTlsPolicy>, + google::cloud::networksecurity::v1::TlsInspectionPolicy>, polling_policy(*current), __func__); } -future> -NetworkSecurityConnectionImpl::UpdateServerTlsPolicy( - google::cloud::networksecurity::v1::UpdateServerTlsPolicyRequest const& +future> +NetworkSecurityConnectionImpl::UpdateTlsInspectionPolicy( + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); auto request_copy = request; auto const idempotent = - idempotency_policy(*current)->UpdateServerTlsPolicy(request_copy); + idempotency_policy(*current)->UpdateTlsInspectionPolicy(request_copy); return google::cloud::internal::AsyncLongRunningOperation< - google::cloud::networksecurity::v1::ServerTlsPolicy>( + google::cloud::networksecurity::v1::TlsInspectionPolicy>( background_->cq(), current, std::move(request_copy), [stub = stub_](google::cloud::CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::cloud::networksecurity::v1:: - UpdateServerTlsPolicyRequest const& request) { - return stub->AsyncUpdateServerTlsPolicy(cq, std::move(context), - std::move(options), request); + UpdateTlsInspectionPolicyRequest const& request) { + return stub->AsyncUpdateTlsInspectionPolicy( + cq, std::move(context), std::move(options), request); }, [stub = stub_](google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -589,45 +2635,45 @@ NetworkSecurityConnectionImpl::UpdateServerTlsPolicy( std::move(options), request); }, &google::cloud::internal::ExtractLongRunningResultResponse< - google::cloud::networksecurity::v1::ServerTlsPolicy>, + google::cloud::networksecurity::v1::TlsInspectionPolicy>, retry_policy(*current), backoff_policy(*current), idempotent, polling_policy(*current), __func__); } StatusOr -NetworkSecurityConnectionImpl::UpdateServerTlsPolicy( +NetworkSecurityConnectionImpl::UpdateTlsInspectionPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::UpdateServerTlsPolicyRequest const& + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); return google::cloud::internal::RetryLoop( retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->UpdateServerTlsPolicy(request), + idempotency_policy(*current)->UpdateTlsInspectionPolicy(request), [this](grpc::ClientContext& context, Options const& options, google::cloud::networksecurity::v1:: - UpdateServerTlsPolicyRequest const& request) { - return stub_->UpdateServerTlsPolicy(context, options, request); + UpdateTlsInspectionPolicyRequest const& request) { + return stub_->UpdateTlsInspectionPolicy(context, options, request); }, *current, request, __func__); } -future> -NetworkSecurityConnectionImpl::UpdateServerTlsPolicy( +future> +NetworkSecurityConnectionImpl::UpdateTlsInspectionPolicy( google::longrunning::Operation const& operation) { auto current = google::cloud::internal::SaveCurrentOptions(); if (!operation.metadata() .Is()) { return make_ready_future< - StatusOr>( + StatusOr>( internal::InvalidArgumentError( - "operation does not correspond to UpdateServerTlsPolicy", + "operation does not correspond to UpdateTlsInspectionPolicy", GCP_ERROR_INFO().WithMetadata("operation", operation.metadata().DebugString()))); } return google::cloud::internal::AsyncAwaitLongRunningOperation< - google::cloud::networksecurity::v1::ServerTlsPolicy>( + google::cloud::networksecurity::v1::TlsInspectionPolicy>( background_->cq(), current, operation, [stub = stub_](google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -645,18 +2691,18 @@ NetworkSecurityConnectionImpl::UpdateServerTlsPolicy( std::move(options), request); }, &google::cloud::internal::ExtractLongRunningResultResponse< - google::cloud::networksecurity::v1::ServerTlsPolicy>, + google::cloud::networksecurity::v1::TlsInspectionPolicy>, polling_policy(*current), __func__); } future> -NetworkSecurityConnectionImpl::DeleteServerTlsPolicy( - google::cloud::networksecurity::v1::DeleteServerTlsPolicyRequest const& +NetworkSecurityConnectionImpl::DeleteTlsInspectionPolicy( + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); auto request_copy = request; auto const idempotent = - idempotency_policy(*current)->DeleteServerTlsPolicy(request_copy); + idempotency_policy(*current)->DeleteTlsInspectionPolicy(request_copy); return google::cloud::internal::AsyncLongRunningOperation< google::cloud::networksecurity::v1::OperationMetadata>( background_->cq(), current, std::move(request_copy), @@ -664,9 +2710,9 @@ NetworkSecurityConnectionImpl::DeleteServerTlsPolicy( std::shared_ptr context, google::cloud::internal::ImmutableOptions options, google::cloud::networksecurity::v1:: - DeleteServerTlsPolicyRequest const& request) { - return stub->AsyncDeleteServerTlsPolicy(cq, std::move(context), - std::move(options), request); + DeleteTlsInspectionPolicyRequest const& request) { + return stub->AsyncDeleteTlsInspectionPolicy( + cq, std::move(context), std::move(options), request); }, [stub = stub_](google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -690,24 +2736,24 @@ NetworkSecurityConnectionImpl::DeleteServerTlsPolicy( } StatusOr -NetworkSecurityConnectionImpl::DeleteServerTlsPolicy( +NetworkSecurityConnectionImpl::DeleteTlsInspectionPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::DeleteServerTlsPolicyRequest const& + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); return google::cloud::internal::RetryLoop( retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->DeleteServerTlsPolicy(request), + idempotency_policy(*current)->DeleteTlsInspectionPolicy(request), [this](grpc::ClientContext& context, Options const& options, google::cloud::networksecurity::v1:: - DeleteServerTlsPolicyRequest const& request) { - return stub_->DeleteServerTlsPolicy(context, options, request); + DeleteTlsInspectionPolicyRequest const& request) { + return stub_->DeleteTlsInspectionPolicy(context, options, request); }, *current, request, __func__); } future> -NetworkSecurityConnectionImpl::DeleteServerTlsPolicy( +NetworkSecurityConnectionImpl::DeleteTlsInspectionPolicy( google::longrunning::Operation const& operation) { auto current = google::cloud::internal::SaveCurrentOptions(); if (!operation.metadata() @@ -716,7 +2762,7 @@ NetworkSecurityConnectionImpl::DeleteServerTlsPolicy( return make_ready_future< StatusOr>( internal::InvalidArgumentError( - "operation does not correspond to DeleteServerTlsPolicy", + "operation does not correspond to DeleteTlsInspectionPolicy", GCP_ERROR_INFO().WithMetadata("operation", operation.metadata().DebugString()))); } @@ -744,76 +2790,75 @@ NetworkSecurityConnectionImpl::DeleteServerTlsPolicy( polling_policy(*current), __func__); } -StreamRange -NetworkSecurityConnectionImpl::ListClientTlsPolicies( - google::cloud::networksecurity::v1::ListClientTlsPoliciesRequest request) { +StreamRange +NetworkSecurityConnectionImpl::ListAuthzPolicies( + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest request) { request.clear_page_token(); auto current = google::cloud::internal::SaveCurrentOptions(); - auto idempotency = - idempotency_policy(*current)->ListClientTlsPolicies(request); + auto idempotency = idempotency_policy(*current)->ListAuthzPolicies(request); char const* function_name = __func__; return google::cloud::internal::MakePaginationRange< - StreamRange>( + 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::networksecurity::v1:: - ListClientTlsPoliciesRequest const& r) { + Options const& options, + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest const& + r) { return google::cloud::internal::RetryLoop( retry->clone(), backoff->clone(), idempotency, [stub](grpc::ClientContext& context, Options const& options, google::cloud::networksecurity::v1:: - ListClientTlsPoliciesRequest const& request) { - return stub->ListClientTlsPolicies(context, options, request); + ListAuthzPoliciesRequest const& request) { + return stub->ListAuthzPolicies(context, options, request); }, options, r, function_name); }, - [](google::cloud::networksecurity::v1::ListClientTlsPoliciesResponse r) { - std::vector result( - r.client_tls_policies().size()); - auto& messages = *r.mutable_client_tls_policies(); + [](google::cloud::networksecurity::v1::ListAuthzPoliciesResponse r) { + std::vector result( + r.authz_policies().size()); + auto& messages = *r.mutable_authz_policies(); std::move(messages.begin(), messages.end(), result.begin()); return result; }); } -StatusOr -NetworkSecurityConnectionImpl::GetClientTlsPolicy( - google::cloud::networksecurity::v1::GetClientTlsPolicyRequest const& - request) { +StatusOr +NetworkSecurityConnectionImpl::GetAuthzPolicy( + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); return google::cloud::internal::RetryLoop( retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->GetClientTlsPolicy(request), - [this]( - grpc::ClientContext& context, Options const& options, - google::cloud::networksecurity::v1::GetClientTlsPolicyRequest const& - request) { - return stub_->GetClientTlsPolicy(context, options, request); + idempotency_policy(*current)->GetAuthzPolicy(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& + request) { + return stub_->GetAuthzPolicy(context, options, request); }, *current, request, __func__); } -future> -NetworkSecurityConnectionImpl::CreateClientTlsPolicy( - google::cloud::networksecurity::v1::CreateClientTlsPolicyRequest const& +future> +NetworkSecurityConnectionImpl::CreateAuthzPolicy( + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); auto request_copy = request; auto const idempotent = - idempotency_policy(*current)->CreateClientTlsPolicy(request_copy); + idempotency_policy(*current)->CreateAuthzPolicy(request_copy); return google::cloud::internal::AsyncLongRunningOperation< - google::cloud::networksecurity::v1::ClientTlsPolicy>( + google::cloud::networksecurity::v1::AuthzPolicy>( background_->cq(), current, std::move(request_copy), - [stub = stub_](google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::networksecurity::v1:: - CreateClientTlsPolicyRequest const& request) { - return stub->AsyncCreateClientTlsPolicy(cq, std::move(context), - std::move(options), request); + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + return stub->AsyncCreateAuthzPolicy(cq, std::move(context), + std::move(options), request); }, [stub = stub_](google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -831,45 +2876,45 @@ NetworkSecurityConnectionImpl::CreateClientTlsPolicy( std::move(options), request); }, &google::cloud::internal::ExtractLongRunningResultResponse< - google::cloud::networksecurity::v1::ClientTlsPolicy>, + google::cloud::networksecurity::v1::AuthzPolicy>, retry_policy(*current), backoff_policy(*current), idempotent, polling_policy(*current), __func__); } StatusOr -NetworkSecurityConnectionImpl::CreateClientTlsPolicy( +NetworkSecurityConnectionImpl::CreateAuthzPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::CreateClientTlsPolicyRequest const& + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); return google::cloud::internal::RetryLoop( retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->CreateClientTlsPolicy(request), + idempotency_policy(*current)->CreateAuthzPolicy(request), [this](grpc::ClientContext& context, Options const& options, - google::cloud::networksecurity::v1:: - CreateClientTlsPolicyRequest const& request) { - return stub_->CreateClientTlsPolicy(context, options, request); + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + return stub_->CreateAuthzPolicy(context, options, request); }, *current, request, __func__); } -future> -NetworkSecurityConnectionImpl::CreateClientTlsPolicy( +future> +NetworkSecurityConnectionImpl::CreateAuthzPolicy( google::longrunning::Operation const& operation) { auto current = google::cloud::internal::SaveCurrentOptions(); if (!operation.metadata() .Is()) { return make_ready_future< - StatusOr>( + StatusOr>( internal::InvalidArgumentError( - "operation does not correspond to CreateClientTlsPolicy", + "operation does not correspond to CreateAuthzPolicy", GCP_ERROR_INFO().WithMetadata("operation", operation.metadata().DebugString()))); } return google::cloud::internal::AsyncAwaitLongRunningOperation< - google::cloud::networksecurity::v1::ClientTlsPolicy>( + google::cloud::networksecurity::v1::AuthzPolicy>( background_->cq(), current, operation, [stub = stub_](google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -887,28 +2932,29 @@ NetworkSecurityConnectionImpl::CreateClientTlsPolicy( std::move(options), request); }, &google::cloud::internal::ExtractLongRunningResultResponse< - google::cloud::networksecurity::v1::ClientTlsPolicy>, + google::cloud::networksecurity::v1::AuthzPolicy>, polling_policy(*current), __func__); } -future> -NetworkSecurityConnectionImpl::UpdateClientTlsPolicy( - google::cloud::networksecurity::v1::UpdateClientTlsPolicyRequest const& +future> +NetworkSecurityConnectionImpl::UpdateAuthzPolicy( + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); auto request_copy = request; auto const idempotent = - idempotency_policy(*current)->UpdateClientTlsPolicy(request_copy); + idempotency_policy(*current)->UpdateAuthzPolicy(request_copy); return google::cloud::internal::AsyncLongRunningOperation< - google::cloud::networksecurity::v1::ClientTlsPolicy>( + google::cloud::networksecurity::v1::AuthzPolicy>( background_->cq(), current, std::move(request_copy), - [stub = stub_](google::cloud::CompletionQueue& cq, - std::shared_ptr context, - google::cloud::internal::ImmutableOptions options, - google::cloud::networksecurity::v1:: - UpdateClientTlsPolicyRequest const& request) { - return stub->AsyncUpdateClientTlsPolicy(cq, std::move(context), - std::move(options), request); + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + return stub->AsyncUpdateAuthzPolicy(cq, std::move(context), + std::move(options), request); }, [stub = stub_](google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -926,45 +2972,45 @@ NetworkSecurityConnectionImpl::UpdateClientTlsPolicy( std::move(options), request); }, &google::cloud::internal::ExtractLongRunningResultResponse< - google::cloud::networksecurity::v1::ClientTlsPolicy>, + google::cloud::networksecurity::v1::AuthzPolicy>, retry_policy(*current), backoff_policy(*current), idempotent, polling_policy(*current), __func__); } StatusOr -NetworkSecurityConnectionImpl::UpdateClientTlsPolicy( +NetworkSecurityConnectionImpl::UpdateAuthzPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::UpdateClientTlsPolicyRequest const& + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); return google::cloud::internal::RetryLoop( retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->UpdateClientTlsPolicy(request), + idempotency_policy(*current)->UpdateAuthzPolicy(request), [this](grpc::ClientContext& context, Options const& options, - google::cloud::networksecurity::v1:: - UpdateClientTlsPolicyRequest const& request) { - return stub_->UpdateClientTlsPolicy(context, options, request); + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + return stub_->UpdateAuthzPolicy(context, options, request); }, *current, request, __func__); } -future> -NetworkSecurityConnectionImpl::UpdateClientTlsPolicy( +future> +NetworkSecurityConnectionImpl::UpdateAuthzPolicy( google::longrunning::Operation const& operation) { auto current = google::cloud::internal::SaveCurrentOptions(); if (!operation.metadata() .Is()) { return make_ready_future< - StatusOr>( + StatusOr>( internal::InvalidArgumentError( - "operation does not correspond to UpdateClientTlsPolicy", + "operation does not correspond to UpdateAuthzPolicy", GCP_ERROR_INFO().WithMetadata("operation", operation.metadata().DebugString()))); } return google::cloud::internal::AsyncAwaitLongRunningOperation< - google::cloud::networksecurity::v1::ClientTlsPolicy>( + google::cloud::networksecurity::v1::AuthzPolicy>( background_->cq(), current, operation, [stub = stub_](google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -982,28 +3028,29 @@ NetworkSecurityConnectionImpl::UpdateClientTlsPolicy( std::move(options), request); }, &google::cloud::internal::ExtractLongRunningResultResponse< - google::cloud::networksecurity::v1::ClientTlsPolicy>, + google::cloud::networksecurity::v1::AuthzPolicy>, polling_policy(*current), __func__); } future> -NetworkSecurityConnectionImpl::DeleteClientTlsPolicy( - google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& +NetworkSecurityConnectionImpl::DeleteAuthzPolicy( + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); auto request_copy = request; auto const idempotent = - idempotency_policy(*current)->DeleteClientTlsPolicy(request_copy); + idempotency_policy(*current)->DeleteAuthzPolicy(request_copy); return google::cloud::internal::AsyncLongRunningOperation< google::cloud::networksecurity::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::networksecurity::v1:: - DeleteClientTlsPolicyRequest const& request) { - return stub->AsyncDeleteClientTlsPolicy(cq, std::move(context), - std::move(options), request); + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + return stub->AsyncDeleteAuthzPolicy(cq, std::move(context), + std::move(options), request); }, [stub = stub_](google::cloud::CompletionQueue& cq, std::shared_ptr context, @@ -1027,24 +3074,24 @@ NetworkSecurityConnectionImpl::DeleteClientTlsPolicy( } StatusOr -NetworkSecurityConnectionImpl::DeleteClientTlsPolicy( +NetworkSecurityConnectionImpl::DeleteAuthzPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& request) { auto current = google::cloud::internal::SaveCurrentOptions(); return google::cloud::internal::RetryLoop( retry_policy(*current), backoff_policy(*current), - idempotency_policy(*current)->DeleteClientTlsPolicy(request), + idempotency_policy(*current)->DeleteAuthzPolicy(request), [this](grpc::ClientContext& context, Options const& options, - google::cloud::networksecurity::v1:: - DeleteClientTlsPolicyRequest const& request) { - return stub_->DeleteClientTlsPolicy(context, options, request); + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + return stub_->DeleteAuthzPolicy(context, options, request); }, *current, request, __func__); } future> -NetworkSecurityConnectionImpl::DeleteClientTlsPolicy( +NetworkSecurityConnectionImpl::DeleteAuthzPolicy( google::longrunning::Operation const& operation) { auto current = google::cloud::internal::SaveCurrentOptions(); if (!operation.metadata() @@ -1053,7 +3100,7 @@ NetworkSecurityConnectionImpl::DeleteClientTlsPolicy( return make_ready_future< StatusOr>( internal::InvalidArgumentError( - "operation does not correspond to DeleteClientTlsPolicy", + "operation does not correspond to DeleteAuthzPolicy", GCP_ERROR_INFO().WithMetadata("operation", operation.metadata().DebugString()))); } diff --git a/google/cloud/networksecurity/v1/internal/network_security_connection_impl.h b/google/cloud/networksecurity/v1/internal/network_security_connection_impl.h index cb0213066d675..995488c74b26a 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_connection_impl.h +++ b/google/cloud/networksecurity/v1/internal/network_security_connection_impl.h @@ -101,6 +101,62 @@ class NetworkSecurityConnectionImpl DeleteAuthorizationPolicy( google::longrunning::Operation const& operation) override; + StreamRange + ListBackendAuthenticationConfigs( + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest request) override; + + StatusOr + GetBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) override; + + future< + StatusOr> + CreateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + StatusOr CreateBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + future< + StatusOr> + CreateBackendAuthenticationConfig( + google::longrunning::Operation const& operation) override; + + future< + StatusOr> + UpdateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + StatusOr UpdateBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + future< + StatusOr> + UpdateBackendAuthenticationConfig( + google::longrunning::Operation const& operation) override; + + future> + DeleteBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + + StatusOr DeleteBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + + future> + DeleteBackendAuthenticationConfig( + google::longrunning::Operation const& operation) override; + StreamRange ListServerTlsPolicies( google::cloud::networksecurity::v1::ListServerTlsPoliciesRequest request) @@ -205,6 +261,253 @@ class NetworkSecurityConnectionImpl DeleteClientTlsPolicy( google::longrunning::Operation const& operation) override; + StreamRange + ListGatewaySecurityPolicies( + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesRequest + request) override; + + StatusOr + GetGatewaySecurityPolicy( + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) override; + + future> + CreateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + future> + CreateGatewaySecurityPolicy( + google::longrunning::Operation const& operation) override; + + future> + UpdateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + future> + UpdateGatewaySecurityPolicy( + google::longrunning::Operation const& operation) override; + + future> + DeleteGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + future> + DeleteGatewaySecurityPolicy( + google::longrunning::Operation const& operation) override; + + StreamRange + ListGatewaySecurityPolicyRules( + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesRequest + request) override; + + StatusOr + GetGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) override; + + future< + StatusOr> + CreateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + future< + StatusOr> + CreateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation) override; + + future< + StatusOr> + UpdateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + future< + StatusOr> + UpdateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation) override; + + future> + DeleteGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + future> + DeleteGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation) override; + + StreamRange ListUrlLists( + google::cloud::networksecurity::v1::ListUrlListsRequest request) override; + + StatusOr GetUrlList( + google::cloud::networksecurity::v1::GetUrlListRequest const& request) + override; + + future> CreateUrlList( + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + StatusOr CreateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + future> CreateUrlList( + google::longrunning::Operation const& operation) override; + + future> UpdateUrlList( + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + StatusOr UpdateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + future> UpdateUrlList( + google::longrunning::Operation const& operation) override; + + future> + DeleteUrlList(google::cloud::networksecurity::v1::DeleteUrlListRequest const& + request) override; + + StatusOr DeleteUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) + override; + + future> + DeleteUrlList(google::longrunning::Operation const& operation) override; + + StreamRange + ListTlsInspectionPolicies( + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest + request) override; + + StatusOr + GetTlsInspectionPolicy( + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) override; + + future> + CreateTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + StatusOr CreateTlsInspectionPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + future> + CreateTlsInspectionPolicy( + google::longrunning::Operation const& operation) override; + + future> + UpdateTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + StatusOr UpdateTlsInspectionPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + future> + UpdateTlsInspectionPolicy( + google::longrunning::Operation const& operation) override; + + future> + DeleteTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + StatusOr DeleteTlsInspectionPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + future> + DeleteTlsInspectionPolicy( + google::longrunning::Operation const& operation) override; + + StreamRange + ListAuthzPolicies(google::cloud::networksecurity::v1::ListAuthzPoliciesRequest + request) override; + + StatusOr GetAuthzPolicy( + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) + override; + + future> + CreateAuthzPolicy( + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + StatusOr CreateAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + future> + CreateAuthzPolicy(google::longrunning::Operation const& operation) override; + + future> + UpdateAuthzPolicy( + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + StatusOr UpdateAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + future> + UpdateAuthzPolicy(google::longrunning::Operation const& operation) override; + + future> + DeleteAuthzPolicy( + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + + StatusOr DeleteAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + + future> + DeleteAuthzPolicy(google::longrunning::Operation const& operation) override; + StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; diff --git a/google/cloud/networksecurity/v1/internal/network_security_logging_decorator.cc b/google/cloud/networksecurity/v1/internal/network_security_logging_decorator.cc index 7a6cab9202e71..d6deb0e050fad 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_logging_decorator.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_logging_decorator.cc @@ -168,6 +168,142 @@ NetworkSecurityLogging::DeleteAuthorizationPolicy( context, options, request, __func__, tracing_options_); } +StatusOr +NetworkSecurityLogging::ListBackendAuthenticationConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& request) { + return child_->ListBackendAuthenticationConfigs(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +NetworkSecurityLogging::GetBackendAuthenticationConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) { + return child_->GetBackendAuthenticationConfig(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncCreateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + return child_->AsyncCreateBackendAuthenticationConfig( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::CreateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + return child_->CreateBackendAuthenticationConfig(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncUpdateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + return child_->AsyncUpdateBackendAuthenticationConfig( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::UpdateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + return child_->UpdateBackendAuthenticationConfig(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncDeleteBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + return child_->AsyncDeleteBackendAuthenticationConfig( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::DeleteBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + return child_->DeleteBackendAuthenticationConfig(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr NetworkSecurityLogging::ListServerTlsPolicies( grpc::ClientContext& context, Options const& options, @@ -430,6 +566,650 @@ NetworkSecurityLogging::DeleteClientTlsPolicy( context, options, request, __func__, tracing_options_); } +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse> +NetworkSecurityLogging::ListGatewaySecurityPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) { + return child_->ListGatewaySecurityPolicies(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +NetworkSecurityLogging::GetGatewaySecurityPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRequest const& request) { + return child_->GetGatewaySecurityPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncCreateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + return child_->AsyncCreateGatewaySecurityPolicy( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::CreateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + return child_->CreateGatewaySecurityPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncUpdateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + return child_->AsyncUpdateGatewaySecurityPolicy( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::UpdateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + return child_->UpdateGatewaySecurityPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncDeleteGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + return child_->AsyncDeleteGatewaySecurityPolicy( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::DeleteGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + return child_->DeleteGatewaySecurityPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesResponse> +NetworkSecurityLogging::ListGatewaySecurityPolicyRules( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) { + return child_->ListGatewaySecurityPolicyRules(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +NetworkSecurityLogging::GetGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) { + return child_->GetGatewaySecurityPolicyRule(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncCreateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + return child_->AsyncCreateGatewaySecurityPolicyRule( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::CreateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + return child_->CreateGatewaySecurityPolicyRule(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncUpdateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + return child_->AsyncUpdateGatewaySecurityPolicyRule( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::UpdateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + return child_->UpdateGatewaySecurityPolicyRule(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncDeleteGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + return child_->AsyncDeleteGatewaySecurityPolicyRule( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::DeleteGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + return child_->DeleteGatewaySecurityPolicyRule(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +NetworkSecurityLogging::ListUrlLists( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListUrlListsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListUrlListsRequest const& + request) { + return child_->ListUrlLists(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +NetworkSecurityLogging::GetUrlList( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetUrlListRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetUrlListRequest const& + request) { + return child_->GetUrlList(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncCreateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& + request) { + return child_->AsyncCreateUrlList(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr NetworkSecurityLogging::CreateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& + request) { + return child_->CreateUrlList(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncUpdateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& + request) { + return child_->AsyncUpdateUrlList(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr NetworkSecurityLogging::UpdateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& + request) { + return child_->UpdateUrlList(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncDeleteUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& + request) { + return child_->AsyncDeleteUrlList(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr NetworkSecurityLogging::DeleteUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& + request) { + return child_->DeleteUrlList(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +NetworkSecurityLogging::ListTlsInspectionPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListTlsInspectionPoliciesRequest const& request) { + return child_->ListTlsInspectionPolicies(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +NetworkSecurityLogging::GetTlsInspectionPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetTlsInspectionPolicyRequest const& request) { + return child_->GetTlsInspectionPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncCreateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) { + return child_->AsyncCreateTlsInspectionPolicy( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::CreateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) { + return child_->CreateTlsInspectionPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncUpdateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) { + return child_->AsyncUpdateTlsInspectionPolicy( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::UpdateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) { + return child_->UpdateTlsInspectionPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncDeleteTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) { + return child_->AsyncDeleteTlsInspectionPolicy( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::DeleteTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) { + return child_->DeleteTlsInspectionPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +NetworkSecurityLogging::ListAuthzPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest const& + request) { + return child_->ListAuthzPolicies(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +NetworkSecurityLogging::GetAuthzPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& + request) { + return child_->GetAuthzPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncCreateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + return child_->AsyncCreateAuthzPolicy(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::CreateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + return child_->CreateAuthzPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncUpdateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + return child_->AsyncUpdateAuthzPolicy(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::UpdateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + return child_->UpdateAuthzPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +NetworkSecurityLogging::AsyncDeleteAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + return child_->AsyncDeleteAuthzPolicy(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +NetworkSecurityLogging::DeleteAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + return child_->DeleteAuthzPolicy(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + StatusOr NetworkSecurityLogging::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/networksecurity/v1/internal/network_security_logging_decorator.h b/google/cloud/networksecurity/v1/internal/network_security_logging_decorator.h index 7507028ec5e4d..497bc0928dcfe 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_logging_decorator.h +++ b/google/cloud/networksecurity/v1/internal/network_security_logging_decorator.h @@ -94,6 +94,58 @@ class NetworkSecurityLogging : public NetworkSecurityStub { google::cloud::networksecurity::v1:: DeleteAuthorizationPolicyRequest const& request) override; + StatusOr + ListBackendAuthenticationConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& request) override; + + StatusOr + GetBackendAuthenticationConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncCreateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + StatusOr CreateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncUpdateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + StatusOr UpdateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncDeleteBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + + StatusOr DeleteBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + StatusOr ListServerTlsPolicies( grpc::ClientContext& context, Options const& options, @@ -190,6 +242,255 @@ class NetworkSecurityLogging : public NetworkSecurityStub { google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& request) override; + StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse> + ListGatewaySecurityPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) override; + + StatusOr + GetGatewaySecurityPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) override; + + future> + AsyncCreateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + future> + AsyncUpdateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + future> + AsyncDeleteGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + StatusOr + ListGatewaySecurityPolicyRules( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) override; + + StatusOr + GetGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncCreateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncUpdateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncDeleteGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr + ListUrlLists(grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListUrlListsRequest const& + request) override; + + StatusOr GetUrlList( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetUrlListRequest const& request) + override; + + future> AsyncCreateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + StatusOr CreateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + future> AsyncUpdateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + StatusOr UpdateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + future> AsyncDeleteUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) + override; + + StatusOr DeleteUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) + override; + + StatusOr< + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesResponse> + ListTlsInspectionPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListTlsInspectionPoliciesRequest const& request) override; + + StatusOr + GetTlsInspectionPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) override; + + future> + AsyncCreateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + StatusOr CreateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + future> + AsyncUpdateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + StatusOr UpdateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + future> + AsyncDeleteTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + StatusOr DeleteTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + StatusOr + ListAuthzPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest const& + request) override; + + StatusOr GetAuthzPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) + override; + + future> AsyncCreateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + StatusOr CreateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + future> AsyncUpdateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + StatusOr UpdateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + future> AsyncDeleteAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + + StatusOr DeleteAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.cc b/google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.cc index 402fcd16ebf5d..3b786c767bed3 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.cc @@ -141,6 +141,102 @@ NetworkSecurityMetadata::DeleteAuthorizationPolicy( return child_->DeleteAuthorizationPolicy(context, options, request); } +StatusOr +NetworkSecurityMetadata::ListBackendAuthenticationConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListBackendAuthenticationConfigs(context, options, request); +} + +StatusOr +NetworkSecurityMetadata::GetBackendAuthenticationConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetBackendAuthenticationConfig(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncCreateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateBackendAuthenticationConfig( + cq, std::move(context), std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::CreateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateBackendAuthenticationConfig(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncUpdateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + SetMetadata( + *context, *options, + absl::StrCat( + "backend_authentication_config.name=", + internal::UrlEncode(request.backend_authentication_config().name()))); + return child_->AsyncUpdateBackendAuthenticationConfig( + cq, std::move(context), std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::UpdateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + SetMetadata( + context, options, + absl::StrCat( + "backend_authentication_config.name=", + internal::UrlEncode(request.backend_authentication_config().name()))); + return child_->UpdateBackendAuthenticationConfig(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncDeleteBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteBackendAuthenticationConfig( + cq, std::move(context), std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::DeleteBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteBackendAuthenticationConfig(context, options, request); +} + StatusOr NetworkSecurityMetadata::ListServerTlsPolicies( grpc::ClientContext& context, Options const& options, @@ -327,6 +423,457 @@ NetworkSecurityMetadata::DeleteClientTlsPolicy( return child_->DeleteClientTlsPolicy(context, options, request); } +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse> +NetworkSecurityMetadata::ListGatewaySecurityPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListGatewaySecurityPolicies(context, options, request); +} + +StatusOr +NetworkSecurityMetadata::GetGatewaySecurityPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetGatewaySecurityPolicy(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncCreateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateGatewaySecurityPolicy(cq, std::move(context), + std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::CreateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateGatewaySecurityPolicy(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncUpdateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("gateway_security_policy.name=", + internal::UrlEncode( + request.gateway_security_policy().name()))); + return child_->AsyncUpdateGatewaySecurityPolicy(cq, std::move(context), + std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::UpdateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + SetMetadata(context, options, + absl::StrCat("gateway_security_policy.name=", + internal::UrlEncode( + request.gateway_security_policy().name()))); + return child_->UpdateGatewaySecurityPolicy(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncDeleteGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteGatewaySecurityPolicy(cq, std::move(context), + std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::DeleteGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteGatewaySecurityPolicy(context, options, request); +} + +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesResponse> +NetworkSecurityMetadata::ListGatewaySecurityPolicyRules( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListGatewaySecurityPolicyRules(context, options, request); +} + +StatusOr +NetworkSecurityMetadata::GetGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetGatewaySecurityPolicyRule(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncCreateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateGatewaySecurityPolicyRule( + cq, std::move(context), std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::CreateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateGatewaySecurityPolicyRule(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncUpdateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("gateway_security_policy_rule.name=", + internal::UrlEncode( + request.gateway_security_policy_rule().name()))); + return child_->AsyncUpdateGatewaySecurityPolicyRule( + cq, std::move(context), std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::UpdateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + SetMetadata(context, options, + absl::StrCat("gateway_security_policy_rule.name=", + internal::UrlEncode( + request.gateway_security_policy_rule().name()))); + return child_->UpdateGatewaySecurityPolicyRule(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncDeleteGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteGatewaySecurityPolicyRule( + cq, std::move(context), std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::DeleteGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteGatewaySecurityPolicyRule(context, options, request); +} + +StatusOr +NetworkSecurityMetadata::ListUrlLists( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListUrlListsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListUrlLists(context, options, request); +} + +StatusOr +NetworkSecurityMetadata::GetUrlList( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetUrlListRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetUrlList(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncCreateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateUrlList(cq, std::move(context), std::move(options), + request); +} + +StatusOr NetworkSecurityMetadata::CreateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateUrlList(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncUpdateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("url_list.name=", + internal::UrlEncode(request.url_list().name()))); + return child_->AsyncUpdateUrlList(cq, std::move(context), std::move(options), + request); +} + +StatusOr NetworkSecurityMetadata::UpdateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) { + SetMetadata(context, options, + absl::StrCat("url_list.name=", + internal::UrlEncode(request.url_list().name()))); + return child_->UpdateUrlList(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncDeleteUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteUrlList(cq, std::move(context), std::move(options), + request); +} + +StatusOr NetworkSecurityMetadata::DeleteUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteUrlList(context, options, request); +} + +StatusOr +NetworkSecurityMetadata::ListTlsInspectionPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListTlsInspectionPolicies(context, options, request); +} + +StatusOr +NetworkSecurityMetadata::GetTlsInspectionPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetTlsInspectionPolicy(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncCreateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateTlsInspectionPolicy(cq, std::move(context), + std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::CreateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateTlsInspectionPolicy(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncUpdateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat( + "tls_inspection_policy.name=", + internal::UrlEncode(request.tls_inspection_policy().name()))); + return child_->AsyncUpdateTlsInspectionPolicy(cq, std::move(context), + std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::UpdateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& + request) { + SetMetadata(context, options, + absl::StrCat( + "tls_inspection_policy.name=", + internal::UrlEncode(request.tls_inspection_policy().name()))); + return child_->UpdateTlsInspectionPolicy(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncDeleteTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteTlsInspectionPolicy(cq, std::move(context), + std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::DeleteTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteTlsInspectionPolicy(context, options, request); +} + +StatusOr +NetworkSecurityMetadata::ListAuthzPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListAuthzPolicies(context, options, request); +} + +StatusOr +NetworkSecurityMetadata::GetAuthzPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetAuthzPolicy(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncCreateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateAuthzPolicy(cq, std::move(context), + std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::CreateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateAuthzPolicy(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncUpdateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("authz_policy.name=", + internal::UrlEncode(request.authz_policy().name()))); + return child_->AsyncUpdateAuthzPolicy(cq, std::move(context), + std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::UpdateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("authz_policy.name=", + internal::UrlEncode(request.authz_policy().name()))); + return child_->UpdateAuthzPolicy(context, options, request); +} + +future> +NetworkSecurityMetadata::AsyncDeleteAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteAuthzPolicy(cq, std::move(context), + std::move(options), request); +} + +StatusOr +NetworkSecurityMetadata::DeleteAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteAuthzPolicy(context, options, request); +} + StatusOr NetworkSecurityMetadata::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.h b/google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.h index 02270931feec9..4d3200e5780f4 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.h +++ b/google/cloud/networksecurity/v1/internal/network_security_metadata_decorator.h @@ -95,6 +95,58 @@ class NetworkSecurityMetadata : public NetworkSecurityStub { google::cloud::networksecurity::v1:: DeleteAuthorizationPolicyRequest const& request) override; + StatusOr + ListBackendAuthenticationConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& request) override; + + StatusOr + GetBackendAuthenticationConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncCreateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + StatusOr CreateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncUpdateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + StatusOr UpdateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncDeleteBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + + StatusOr DeleteBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + StatusOr ListServerTlsPolicies( grpc::ClientContext& context, Options const& options, @@ -191,6 +243,255 @@ class NetworkSecurityMetadata : public NetworkSecurityStub { google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& request) override; + StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse> + ListGatewaySecurityPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) override; + + StatusOr + GetGatewaySecurityPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) override; + + future> + AsyncCreateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + future> + AsyncUpdateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + future> + AsyncDeleteGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + StatusOr + ListGatewaySecurityPolicyRules( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) override; + + StatusOr + GetGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncCreateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncUpdateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncDeleteGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr + ListUrlLists(grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListUrlListsRequest const& + request) override; + + StatusOr GetUrlList( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetUrlListRequest const& request) + override; + + future> AsyncCreateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + StatusOr CreateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + future> AsyncUpdateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + StatusOr UpdateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + future> AsyncDeleteUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) + override; + + StatusOr DeleteUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) + override; + + StatusOr< + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesResponse> + ListTlsInspectionPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListTlsInspectionPoliciesRequest const& request) override; + + StatusOr + GetTlsInspectionPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) override; + + future> + AsyncCreateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + StatusOr CreateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + future> + AsyncUpdateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + StatusOr UpdateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + future> + AsyncDeleteTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + StatusOr DeleteTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + StatusOr + ListAuthzPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest const& + request) override; + + StatusOr GetAuthzPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) + override; + + future> AsyncCreateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + StatusOr CreateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + future> AsyncUpdateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + StatusOr UpdateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + future> AsyncDeleteAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + + StatusOr DeleteAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/networksecurity/v1/internal/network_security_stub.cc b/google/cloud/networksecurity/v1/internal/network_security_stub.cc index e883bd08cee81..4359ba5e3327d 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_stub.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_stub.cc @@ -165,6 +165,144 @@ DefaultNetworkSecurityStub::DeleteAuthorizationPolicy( return response; } +StatusOr +DefaultNetworkSecurityStub::ListBackendAuthenticationConfigs( + grpc::ClientContext& context, Options const&, + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& request) { + google::cloud::networksecurity::v1::ListBackendAuthenticationConfigsResponse + response; + auto status = grpc_stub_->ListBackendAuthenticationConfigs(&context, request, + &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultNetworkSecurityStub::GetBackendAuthenticationConfig( + grpc::ClientContext& context, Options const&, + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) { + google::cloud::networksecurity::v1::BackendAuthenticationConfig response; + auto status = + grpc_stub_->GetBackendAuthenticationConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncCreateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateBackendAuthenticationConfig(context, + request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::CreateBackendAuthenticationConfig( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateBackendAuthenticationConfig(&context, request, + &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncUpdateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateBackendAuthenticationConfig(context, + request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::UpdateBackendAuthenticationConfig( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateBackendAuthenticationConfig(&context, request, + &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncDeleteBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteBackendAuthenticationConfig(context, + request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::DeleteBackendAuthenticationConfig( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteBackendAuthenticationConfig(&context, request, + &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultNetworkSecurityStub::ListServerTlsPolicies( grpc::ClientContext& context, Options const&, @@ -415,6 +553,648 @@ DefaultNetworkSecurityStub::DeleteClientTlsPolicy( return response; } +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse> +DefaultNetworkSecurityStub::ListGatewaySecurityPolicies( + grpc::ClientContext& context, Options const&, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) { + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse + response; + auto status = + grpc_stub_->ListGatewaySecurityPolicies(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultNetworkSecurityStub::GetGatewaySecurityPolicy( + grpc::ClientContext& context, Options const&, + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) { + google::cloud::networksecurity::v1::GatewaySecurityPolicy response; + auto status = + grpc_stub_->GetGatewaySecurityPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncCreateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1::CreateGatewaySecurityPolicyRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateGatewaySecurityPolicy(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::CreateGatewaySecurityPolicy( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->CreateGatewaySecurityPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncUpdateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1::UpdateGatewaySecurityPolicyRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateGatewaySecurityPolicy(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::UpdateGatewaySecurityPolicy( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->UpdateGatewaySecurityPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncDeleteGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1::DeleteGatewaySecurityPolicyRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteGatewaySecurityPolicy(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::DeleteGatewaySecurityPolicy( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->DeleteGatewaySecurityPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesResponse> +DefaultNetworkSecurityStub::ListGatewaySecurityPolicyRules( + grpc::ClientContext& context, Options const&, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) { + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesResponse + response; + auto status = + grpc_stub_->ListGatewaySecurityPolicyRules(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultNetworkSecurityStub::GetGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options const&, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) { + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule response; + auto status = + grpc_stub_->GetGatewaySecurityPolicyRule(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncCreateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + return internal::MakeUnaryRpcImpl( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateGatewaySecurityPolicyRule(context, + request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::CreateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->CreateGatewaySecurityPolicyRule(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncUpdateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + return internal::MakeUnaryRpcImpl( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateGatewaySecurityPolicyRule(context, + request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::UpdateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->UpdateGatewaySecurityPolicyRule(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncDeleteGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + return internal::MakeUnaryRpcImpl( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteGatewaySecurityPolicyRule(context, + request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::DeleteGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->DeleteGatewaySecurityPolicyRule(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultNetworkSecurityStub::ListUrlLists( + grpc::ClientContext& context, Options const&, + google::cloud::networksecurity::v1::ListUrlListsRequest const& request) { + google::cloud::networksecurity::v1::ListUrlListsResponse response; + auto status = grpc_stub_->ListUrlLists(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultNetworkSecurityStub::GetUrlList( + grpc::ClientContext& context, Options const&, + google::cloud::networksecurity::v1::GetUrlListRequest const& request) { + google::cloud::networksecurity::v1::UrlList response; + auto status = grpc_stub_->GetUrlList(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncCreateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1::CreateUrlListRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1::CreateUrlListRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateUrlList(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::CreateUrlList( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateUrlList(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncUpdateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1::UpdateUrlListRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateUrlList(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::UpdateUrlList( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateUrlList(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncDeleteUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1::DeleteUrlListRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteUrlList(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::DeleteUrlList( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteUrlList(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultNetworkSecurityStub::ListTlsInspectionPolicies( + grpc::ClientContext& context, Options const&, + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest const& + request) { + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesResponse + response; + auto status = + grpc_stub_->ListTlsInspectionPolicies(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultNetworkSecurityStub::GetTlsInspectionPolicy( + grpc::ClientContext& context, Options const&, + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) { + google::cloud::networksecurity::v1::TlsInspectionPolicy response; + auto status = + grpc_stub_->GetTlsInspectionPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncCreateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateTlsInspectionPolicy(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::CreateTlsInspectionPolicy( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->CreateTlsInspectionPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncUpdateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateTlsInspectionPolicy(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::UpdateTlsInspectionPolicy( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->UpdateTlsInspectionPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncDeleteTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteTlsInspectionPolicy(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::DeleteTlsInspectionPolicy( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->DeleteTlsInspectionPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultNetworkSecurityStub::ListAuthzPolicies( + grpc::ClientContext& context, Options const&, + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest const& + request) { + google::cloud::networksecurity::v1::ListAuthzPoliciesResponse response; + auto status = grpc_stub_->ListAuthzPolicies(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultNetworkSecurityStub::GetAuthzPolicy( + grpc::ClientContext& context, Options const&, + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) { + google::cloud::networksecurity::v1::AuthzPolicy response; + auto status = grpc_stub_->GetAuthzPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncCreateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateAuthzPolicy(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::CreateAuthzPolicy( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateAuthzPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncUpdateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateAuthzPolicy(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::UpdateAuthzPolicy( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateAuthzPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultNetworkSecurityStub::AsyncDeleteAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteAuthzPolicy(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultNetworkSecurityStub::DeleteAuthzPolicy( + grpc::ClientContext& context, Options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteAuthzPolicy(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + StatusOr DefaultNetworkSecurityStub::ListLocations( grpc::ClientContext& context, Options const&, diff --git a/google/cloud/networksecurity/v1/internal/network_security_stub.h b/google/cloud/networksecurity/v1/internal/network_security_stub.h index 3da26d900187e..8dc5d327d1ac7 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_stub.h +++ b/google/cloud/networksecurity/v1/internal/network_security_stub.h @@ -96,6 +96,62 @@ class NetworkSecurityStub { google::cloud::networksecurity::v1:: DeleteAuthorizationPolicyRequest const& request) = 0; + virtual StatusOr + ListBackendAuthenticationConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& request) = 0; + + virtual StatusOr< + google::cloud::networksecurity::v1::BackendAuthenticationConfig> + GetBackendAuthenticationConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) = 0; + + virtual future> + AsyncCreateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) = 0; + + virtual StatusOr + CreateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) = 0; + + virtual future> + AsyncUpdateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) = 0; + + virtual StatusOr + UpdateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) = 0; + + virtual future> + AsyncDeleteBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) = 0; + + virtual StatusOr + DeleteBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) = 0; + virtual StatusOr< google::cloud::networksecurity::v1::ListServerTlsPoliciesResponse> ListServerTlsPolicies( @@ -200,6 +256,263 @@ class NetworkSecurityStub { google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& request) = 0; + virtual StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse> + ListGatewaySecurityPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) = 0; + + virtual StatusOr + GetGatewaySecurityPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) = 0; + + virtual future> + AsyncCreateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) = 0; + + virtual StatusOr CreateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) = 0; + + virtual future> + AsyncUpdateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) = 0; + + virtual StatusOr UpdateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) = 0; + + virtual future> + AsyncDeleteGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) = 0; + + virtual StatusOr DeleteGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) = 0; + + virtual StatusOr + ListGatewaySecurityPolicyRules( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) = 0; + + virtual StatusOr< + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule> + GetGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) = 0; + + virtual future> + AsyncCreateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) = 0; + + virtual StatusOr + CreateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) = 0; + + virtual future> + AsyncUpdateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) = 0; + + virtual StatusOr + UpdateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) = 0; + + virtual future> + AsyncDeleteGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) = 0; + + virtual StatusOr + DeleteGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) = 0; + + virtual StatusOr + ListUrlLists(grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListUrlListsRequest const& + request) = 0; + + virtual StatusOr GetUrlList( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetUrlListRequest const& request) = 0; + + virtual future> AsyncCreateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& + request) = 0; + + virtual StatusOr CreateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& + request) = 0; + + virtual future> AsyncUpdateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& + request) = 0; + + virtual StatusOr UpdateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& + request) = 0; + + virtual future> AsyncDeleteUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& + request) = 0; + + virtual StatusOr DeleteUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& + request) = 0; + + virtual StatusOr< + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesResponse> + ListTlsInspectionPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListTlsInspectionPoliciesRequest const& request) = 0; + + virtual StatusOr + GetTlsInspectionPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) = 0; + + virtual future> + AsyncCreateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) = 0; + + virtual StatusOr CreateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) = 0; + + virtual future> + AsyncUpdateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) = 0; + + virtual StatusOr UpdateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) = 0; + + virtual future> + AsyncDeleteTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) = 0; + + virtual StatusOr DeleteTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) = 0; + + virtual StatusOr< + google::cloud::networksecurity::v1::ListAuthzPoliciesResponse> + ListAuthzPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest const& + request) = 0; + + virtual StatusOr + GetAuthzPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& + request) = 0; + + virtual future> + AsyncCreateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) = 0; + + virtual StatusOr CreateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) = 0; + + virtual future> + AsyncUpdateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) = 0; + + virtual StatusOr UpdateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) = 0; + + virtual future> + AsyncDeleteAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) = 0; + + virtual StatusOr DeleteAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) = 0; + virtual StatusOr ListLocations( grpc::ClientContext& context, Options const& options, @@ -319,6 +632,58 @@ class DefaultNetworkSecurityStub : public NetworkSecurityStub { google::cloud::networksecurity::v1:: DeleteAuthorizationPolicyRequest const& request) override; + StatusOr + ListBackendAuthenticationConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& request) override; + + StatusOr + GetBackendAuthenticationConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncCreateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + StatusOr CreateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncUpdateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + StatusOr UpdateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncDeleteBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + + StatusOr DeleteBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + StatusOr ListServerTlsPolicies( grpc::ClientContext& context, Options const& options, @@ -415,6 +780,255 @@ class DefaultNetworkSecurityStub : public NetworkSecurityStub { google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& request) override; + StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse> + ListGatewaySecurityPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) override; + + StatusOr + GetGatewaySecurityPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) override; + + future> + AsyncCreateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + future> + AsyncUpdateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + future> + AsyncDeleteGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + StatusOr + ListGatewaySecurityPolicyRules( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) override; + + StatusOr + GetGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncCreateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncUpdateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncDeleteGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr + ListUrlLists(grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListUrlListsRequest const& + request) override; + + StatusOr GetUrlList( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetUrlListRequest const& request) + override; + + future> AsyncCreateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + StatusOr CreateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + future> AsyncUpdateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + StatusOr UpdateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + future> AsyncDeleteUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) + override; + + StatusOr DeleteUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) + override; + + StatusOr< + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesResponse> + ListTlsInspectionPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListTlsInspectionPoliciesRequest const& request) override; + + StatusOr + GetTlsInspectionPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) override; + + future> + AsyncCreateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + StatusOr CreateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + future> + AsyncUpdateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + StatusOr UpdateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + future> + AsyncDeleteTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + StatusOr DeleteTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + StatusOr + ListAuthzPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest const& + request) override; + + StatusOr GetAuthzPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) + override; + + future> AsyncCreateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + StatusOr CreateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + future> AsyncUpdateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + StatusOr UpdateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + future> AsyncDeleteAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + + StatusOr DeleteAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/networksecurity/v1/internal/network_security_tracing_connection.cc b/google/cloud/networksecurity/v1/internal/network_security_tracing_connection.cc index cd155064fda46..04606c8401673 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_tracing_connection.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_tracing_connection.cc @@ -163,6 +163,141 @@ NetworkSecurityTracingConnection::DeleteAuthorizationPolicy( child_->DeleteAuthorizationPolicy(operation)); } +StreamRange +NetworkSecurityTracingConnection::ListBackendAuthenticationConfigs( + google::cloud::networksecurity::v1::ListBackendAuthenticationConfigsRequest + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "ListBackendAuthenticationConfigs"); + internal::OTelScope scope(span); + auto sr = child_->ListBackendAuthenticationConfigs(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::networksecurity::v1::BackendAuthenticationConfig>( + std::move(span), std::move(sr)); +} + +StatusOr +NetworkSecurityTracingConnection::GetBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "GetBackendAuthenticationConfig"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, + child_->GetBackendAuthenticationConfig(request)); +} + +future< + StatusOr> +NetworkSecurityTracingConnection::CreateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "CreateBackendAuthenticationConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateBackendAuthenticationConfig(request)); +} + +StatusOr +NetworkSecurityTracingConnection::CreateBackendAuthenticationConfig( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "CreateBackendAuthenticationConfig"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->CreateBackendAuthenticationConfig(NoAwaitTag{}, request)); +} + +future< + StatusOr> +NetworkSecurityTracingConnection::CreateBackendAuthenticationConfig( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "CreateBackendAuthenticationConfig"); + internal::OTelScope scope(span); + return internal::EndSpan( + std::move(span), child_->CreateBackendAuthenticationConfig(operation)); +} + +future< + StatusOr> +NetworkSecurityTracingConnection::UpdateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "UpdateBackendAuthenticationConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateBackendAuthenticationConfig(request)); +} + +StatusOr +NetworkSecurityTracingConnection::UpdateBackendAuthenticationConfig( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "UpdateBackendAuthenticationConfig"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->UpdateBackendAuthenticationConfig(NoAwaitTag{}, request)); +} + +future< + StatusOr> +NetworkSecurityTracingConnection::UpdateBackendAuthenticationConfig( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "UpdateBackendAuthenticationConfig"); + internal::OTelScope scope(span); + return internal::EndSpan( + std::move(span), child_->UpdateBackendAuthenticationConfig(operation)); +} + +future> +NetworkSecurityTracingConnection::DeleteBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "DeleteBackendAuthenticationConfig"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteBackendAuthenticationConfig(request)); +} + +StatusOr +NetworkSecurityTracingConnection::DeleteBackendAuthenticationConfig( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "DeleteBackendAuthenticationConfig"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->DeleteBackendAuthenticationConfig(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::DeleteBackendAuthenticationConfig( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "DeleteBackendAuthenticationConfig"); + internal::OTelScope scope(span); + return internal::EndSpan( + std::move(span), child_->DeleteBackendAuthenticationConfig(operation)); +} + StreamRange NetworkSecurityTracingConnection::ListServerTlsPolicies( google::cloud::networksecurity::v1::ListServerTlsPoliciesRequest request) { @@ -405,6 +540,621 @@ NetworkSecurityTracingConnection::DeleteClientTlsPolicy( child_->DeleteClientTlsPolicy(operation)); } +StreamRange +NetworkSecurityTracingConnection::ListGatewaySecurityPolicies( + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesRequest + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "ListGatewaySecurityPolicies"); + internal::OTelScope scope(span); + auto sr = child_->ListGatewaySecurityPolicies(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::networksecurity::v1::GatewaySecurityPolicy>( + std::move(span), std::move(sr)); +} + +StatusOr +NetworkSecurityTracingConnection::GetGatewaySecurityPolicy( + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "GetGatewaySecurityPolicy"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetGatewaySecurityPolicy(request)); +} + +future> +NetworkSecurityTracingConnection::CreateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "CreateGatewaySecurityPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateGatewaySecurityPolicy(request)); +} + +StatusOr +NetworkSecurityTracingConnection::CreateGatewaySecurityPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "CreateGatewaySecurityPolicy"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->CreateGatewaySecurityPolicy(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::CreateGatewaySecurityPolicy( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "CreateGatewaySecurityPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateGatewaySecurityPolicy(operation)); +} + +future> +NetworkSecurityTracingConnection::UpdateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "UpdateGatewaySecurityPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateGatewaySecurityPolicy(request)); +} + +StatusOr +NetworkSecurityTracingConnection::UpdateGatewaySecurityPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "UpdateGatewaySecurityPolicy"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->UpdateGatewaySecurityPolicy(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::UpdateGatewaySecurityPolicy( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "UpdateGatewaySecurityPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateGatewaySecurityPolicy(operation)); +} + +future> +NetworkSecurityTracingConnection::DeleteGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "DeleteGatewaySecurityPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteGatewaySecurityPolicy(request)); +} + +StatusOr +NetworkSecurityTracingConnection::DeleteGatewaySecurityPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "DeleteGatewaySecurityPolicy"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->DeleteGatewaySecurityPolicy(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::DeleteGatewaySecurityPolicy( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "DeleteGatewaySecurityPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteGatewaySecurityPolicy(operation)); +} + +StreamRange +NetworkSecurityTracingConnection::ListGatewaySecurityPolicyRules( + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesRequest + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "ListGatewaySecurityPolicyRules"); + internal::OTelScope scope(span); + auto sr = child_->ListGatewaySecurityPolicyRules(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule>( + std::move(span), std::move(sr)); +} + +StatusOr +NetworkSecurityTracingConnection::GetGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "GetGatewaySecurityPolicyRule"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, + child_->GetGatewaySecurityPolicyRule(request)); +} + +future> +NetworkSecurityTracingConnection::CreateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "CreateGatewaySecurityPolicyRule"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateGatewaySecurityPolicyRule(request)); +} + +StatusOr +NetworkSecurityTracingConnection::CreateGatewaySecurityPolicyRule( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "CreateGatewaySecurityPolicyRule"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->CreateGatewaySecurityPolicyRule(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::CreateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "CreateGatewaySecurityPolicyRule"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateGatewaySecurityPolicyRule(operation)); +} + +future> +NetworkSecurityTracingConnection::UpdateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "UpdateGatewaySecurityPolicyRule"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateGatewaySecurityPolicyRule(request)); +} + +StatusOr +NetworkSecurityTracingConnection::UpdateGatewaySecurityPolicyRule( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "UpdateGatewaySecurityPolicyRule"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->UpdateGatewaySecurityPolicyRule(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::UpdateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "UpdateGatewaySecurityPolicyRule"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateGatewaySecurityPolicyRule(operation)); +} + +future> +NetworkSecurityTracingConnection::DeleteGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "DeleteGatewaySecurityPolicyRule"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteGatewaySecurityPolicyRule(request)); +} + +StatusOr +NetworkSecurityTracingConnection::DeleteGatewaySecurityPolicyRule( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "DeleteGatewaySecurityPolicyRule"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->DeleteGatewaySecurityPolicyRule(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::DeleteGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "DeleteGatewaySecurityPolicyRule"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteGatewaySecurityPolicyRule(operation)); +} + +StreamRange +NetworkSecurityTracingConnection::ListUrlLists( + google::cloud::networksecurity::v1::ListUrlListsRequest request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::ListUrlLists"); + internal::OTelScope scope(span); + auto sr = child_->ListUrlLists(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::networksecurity::v1::UrlList>(std::move(span), + std::move(sr)); +} + +StatusOr +NetworkSecurityTracingConnection::GetUrlList( + google::cloud::networksecurity::v1::GetUrlListRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::GetUrlList"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetUrlList(request)); +} + +future> +NetworkSecurityTracingConnection::CreateUrlList( + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::CreateUrlList"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateUrlList(request)); +} + +StatusOr +NetworkSecurityTracingConnection::CreateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::CreateUrlList"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateUrlList(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::CreateUrlList( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::CreateUrlList"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateUrlList(operation)); +} + +future> +NetworkSecurityTracingConnection::UpdateUrlList( + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::UpdateUrlList"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateUrlList(request)); +} + +StatusOr +NetworkSecurityTracingConnection::UpdateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::UpdateUrlList"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateUrlList(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::UpdateUrlList( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::UpdateUrlList"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateUrlList(operation)); +} + +future> +NetworkSecurityTracingConnection::DeleteUrlList( + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::DeleteUrlList"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteUrlList(request)); +} + +StatusOr +NetworkSecurityTracingConnection::DeleteUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::DeleteUrlList"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteUrlList(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::DeleteUrlList( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::DeleteUrlList"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteUrlList(operation)); +} + +StreamRange +NetworkSecurityTracingConnection::ListTlsInspectionPolicies( + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "ListTlsInspectionPolicies"); + internal::OTelScope scope(span); + auto sr = child_->ListTlsInspectionPolicies(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::networksecurity::v1::TlsInspectionPolicy>(std::move(span), + std::move(sr)); +} + +StatusOr +NetworkSecurityTracingConnection::GetTlsInspectionPolicy( + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::GetTlsInspectionPolicy"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetTlsInspectionPolicy(request)); +} + +future> +NetworkSecurityTracingConnection::CreateTlsInspectionPolicy( + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "CreateTlsInspectionPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateTlsInspectionPolicy(request)); +} + +StatusOr +NetworkSecurityTracingConnection::CreateTlsInspectionPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "CreateTlsInspectionPolicy"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->CreateTlsInspectionPolicy(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::CreateTlsInspectionPolicy( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "CreateTlsInspectionPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateTlsInspectionPolicy(operation)); +} + +future> +NetworkSecurityTracingConnection::UpdateTlsInspectionPolicy( + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "UpdateTlsInspectionPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateTlsInspectionPolicy(request)); +} + +StatusOr +NetworkSecurityTracingConnection::UpdateTlsInspectionPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "UpdateTlsInspectionPolicy"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->UpdateTlsInspectionPolicy(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::UpdateTlsInspectionPolicy( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "UpdateTlsInspectionPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateTlsInspectionPolicy(operation)); +} + +future> +NetworkSecurityTracingConnection::DeleteTlsInspectionPolicy( + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "DeleteTlsInspectionPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteTlsInspectionPolicy(request)); +} + +StatusOr +NetworkSecurityTracingConnection::DeleteTlsInspectionPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "DeleteTlsInspectionPolicy"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->DeleteTlsInspectionPolicy(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::DeleteTlsInspectionPolicy( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::" + "DeleteTlsInspectionPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteTlsInspectionPolicy(operation)); +} + +StreamRange +NetworkSecurityTracingConnection::ListAuthzPolicies( + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::ListAuthzPolicies"); + internal::OTelScope scope(span); + auto sr = child_->ListAuthzPolicies(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::networksecurity::v1::AuthzPolicy>(std::move(span), + std::move(sr)); +} + +StatusOr +NetworkSecurityTracingConnection::GetAuthzPolicy( + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::GetAuthzPolicy"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetAuthzPolicy(request)); +} + +future> +NetworkSecurityTracingConnection::CreateAuthzPolicy( + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::CreateAuthzPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateAuthzPolicy(request)); +} + +StatusOr +NetworkSecurityTracingConnection::CreateAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::CreateAuthzPolicy"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateAuthzPolicy(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::CreateAuthzPolicy( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::CreateAuthzPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateAuthzPolicy(operation)); +} + +future> +NetworkSecurityTracingConnection::UpdateAuthzPolicy( + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::UpdateAuthzPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateAuthzPolicy(request)); +} + +StatusOr +NetworkSecurityTracingConnection::UpdateAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::UpdateAuthzPolicy"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateAuthzPolicy(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::UpdateAuthzPolicy( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::UpdateAuthzPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateAuthzPolicy(operation)); +} + +future> +NetworkSecurityTracingConnection::DeleteAuthzPolicy( + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::DeleteAuthzPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteAuthzPolicy(request)); +} + +StatusOr +NetworkSecurityTracingConnection::DeleteAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::DeleteAuthzPolicy"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteAuthzPolicy(NoAwaitTag{}, request)); +} + +future> +NetworkSecurityTracingConnection::DeleteAuthzPolicy( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "networksecurity_v1::NetworkSecurityConnection::DeleteAuthzPolicy"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteAuthzPolicy(operation)); +} + StreamRange NetworkSecurityTracingConnection::ListLocations( google::cloud::location::ListLocationsRequest request) { diff --git a/google/cloud/networksecurity/v1/internal/network_security_tracing_connection.h b/google/cloud/networksecurity/v1/internal/network_security_tracing_connection.h index c858b05037503..9b0e3231304d4 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_tracing_connection.h +++ b/google/cloud/networksecurity/v1/internal/network_security_tracing_connection.h @@ -87,6 +87,62 @@ class NetworkSecurityTracingConnection DeleteAuthorizationPolicy( google::longrunning::Operation const& operation) override; + StreamRange + ListBackendAuthenticationConfigs( + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest request) override; + + StatusOr + GetBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) override; + + future< + StatusOr> + CreateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + StatusOr CreateBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + future< + StatusOr> + CreateBackendAuthenticationConfig( + google::longrunning::Operation const& operation) override; + + future< + StatusOr> + UpdateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + StatusOr UpdateBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + future< + StatusOr> + UpdateBackendAuthenticationConfig( + google::longrunning::Operation const& operation) override; + + future> + DeleteBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + + StatusOr DeleteBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + + future> + DeleteBackendAuthenticationConfig( + google::longrunning::Operation const& operation) override; + StreamRange ListServerTlsPolicies( google::cloud::networksecurity::v1::ListServerTlsPoliciesRequest request) @@ -191,6 +247,253 @@ class NetworkSecurityTracingConnection DeleteClientTlsPolicy( google::longrunning::Operation const& operation) override; + StreamRange + ListGatewaySecurityPolicies( + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesRequest + request) override; + + StatusOr + GetGatewaySecurityPolicy( + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) override; + + future> + CreateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + future> + CreateGatewaySecurityPolicy( + google::longrunning::Operation const& operation) override; + + future> + UpdateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + future> + UpdateGatewaySecurityPolicy( + google::longrunning::Operation const& operation) override; + + future> + DeleteGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + future> + DeleteGatewaySecurityPolicy( + google::longrunning::Operation const& operation) override; + + StreamRange + ListGatewaySecurityPolicyRules( + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesRequest + request) override; + + StatusOr + GetGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) override; + + future< + StatusOr> + CreateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + future< + StatusOr> + CreateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation) override; + + future< + StatusOr> + UpdateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + future< + StatusOr> + UpdateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation) override; + + future> + DeleteGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + future> + DeleteGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation) override; + + StreamRange ListUrlLists( + google::cloud::networksecurity::v1::ListUrlListsRequest request) override; + + StatusOr GetUrlList( + google::cloud::networksecurity::v1::GetUrlListRequest const& request) + override; + + future> CreateUrlList( + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + StatusOr CreateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + future> CreateUrlList( + google::longrunning::Operation const& operation) override; + + future> UpdateUrlList( + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + StatusOr UpdateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + future> UpdateUrlList( + google::longrunning::Operation const& operation) override; + + future> + DeleteUrlList(google::cloud::networksecurity::v1::DeleteUrlListRequest const& + request) override; + + StatusOr DeleteUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) + override; + + future> + DeleteUrlList(google::longrunning::Operation const& operation) override; + + StreamRange + ListTlsInspectionPolicies( + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest + request) override; + + StatusOr + GetTlsInspectionPolicy( + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) override; + + future> + CreateTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + StatusOr CreateTlsInspectionPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + future> + CreateTlsInspectionPolicy( + google::longrunning::Operation const& operation) override; + + future> + UpdateTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + StatusOr UpdateTlsInspectionPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + future> + UpdateTlsInspectionPolicy( + google::longrunning::Operation const& operation) override; + + future> + DeleteTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + StatusOr DeleteTlsInspectionPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + future> + DeleteTlsInspectionPolicy( + google::longrunning::Operation const& operation) override; + + StreamRange + ListAuthzPolicies(google::cloud::networksecurity::v1::ListAuthzPoliciesRequest + request) override; + + StatusOr GetAuthzPolicy( + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) + override; + + future> + CreateAuthzPolicy( + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + StatusOr CreateAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + future> + CreateAuthzPolicy(google::longrunning::Operation const& operation) override; + + future> + UpdateAuthzPolicy( + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + StatusOr UpdateAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + future> + UpdateAuthzPolicy(google::longrunning::Operation const& operation) override; + + future> + DeleteAuthzPolicy( + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + + StatusOr DeleteAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + + future> + DeleteAuthzPolicy(google::longrunning::Operation const& operation) override; + StreamRange ListLocations( google::cloud::location::ListLocationsRequest request) override; diff --git a/google/cloud/networksecurity/v1/internal/network_security_tracing_stub.cc b/google/cloud/networksecurity/v1/internal/network_security_tracing_stub.cc index ea1870956e6da..aa8986c08bb25 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_tracing_stub.cc +++ b/google/cloud/networksecurity/v1/internal/network_security_tracing_stub.cc @@ -159,6 +159,133 @@ NetworkSecurityTracingStub::DeleteAuthorizationPolicy( child_->DeleteAuthorizationPolicy(context, options, request)); } +StatusOr +NetworkSecurityTracingStub::ListBackendAuthenticationConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "ListBackendAuthenticationConfigs"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ListBackendAuthenticationConfigs(context, options, request)); +} + +StatusOr +NetworkSecurityTracingStub::GetBackendAuthenticationConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "GetBackendAuthenticationConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->GetBackendAuthenticationConfig(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncCreateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "CreateBackendAuthenticationConfig"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateBackendAuthenticationConfig( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::CreateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "CreateBackendAuthenticationConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->CreateBackendAuthenticationConfig(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncUpdateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "UpdateBackendAuthenticationConfig"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateBackendAuthenticationConfig( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::UpdateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "UpdateBackendAuthenticationConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->UpdateBackendAuthenticationConfig(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncDeleteBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "DeleteBackendAuthenticationConfig"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteBackendAuthenticationConfig( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::DeleteBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "DeleteBackendAuthenticationConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->DeleteBackendAuthenticationConfig(context, options, request)); +} + StatusOr NetworkSecurityTracingStub::ListServerTlsPolicies( grpc::ClientContext& context, Options const& options, @@ -399,6 +526,600 @@ NetworkSecurityTracingStub::DeleteClientTlsPolicy( context, *span, child_->DeleteClientTlsPolicy(context, options, request)); } +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse> +NetworkSecurityTracingStub::ListGatewaySecurityPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "ListGatewaySecurityPolicies"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ListGatewaySecurityPolicies(context, options, request)); +} + +StatusOr +NetworkSecurityTracingStub::GetGatewaySecurityPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "GetGatewaySecurityPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->GetGatewaySecurityPolicy(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncCreateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "CreateGatewaySecurityPolicy"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateGatewaySecurityPolicy( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::CreateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "CreateGatewaySecurityPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->CreateGatewaySecurityPolicy(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncUpdateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "UpdateGatewaySecurityPolicy"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateGatewaySecurityPolicy( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::UpdateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "UpdateGatewaySecurityPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->UpdateGatewaySecurityPolicy(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncDeleteGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "DeleteGatewaySecurityPolicy"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteGatewaySecurityPolicy( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::DeleteGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "DeleteGatewaySecurityPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->DeleteGatewaySecurityPolicy(context, options, request)); +} + +StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesResponse> +NetworkSecurityTracingStub::ListGatewaySecurityPolicyRules( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "ListGatewaySecurityPolicyRules"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ListGatewaySecurityPolicyRules(context, options, request)); +} + +StatusOr +NetworkSecurityTracingStub::GetGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "GetGatewaySecurityPolicyRule"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->GetGatewaySecurityPolicyRule(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncCreateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "CreateGatewaySecurityPolicyRule"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateGatewaySecurityPolicyRule( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::CreateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "CreateGatewaySecurityPolicyRule"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->CreateGatewaySecurityPolicyRule(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncUpdateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "UpdateGatewaySecurityPolicyRule"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateGatewaySecurityPolicyRule( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::UpdateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "UpdateGatewaySecurityPolicyRule"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->UpdateGatewaySecurityPolicyRule(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncDeleteGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "DeleteGatewaySecurityPolicyRule"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteGatewaySecurityPolicyRule( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::DeleteGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "DeleteGatewaySecurityPolicyRule"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->DeleteGatewaySecurityPolicyRule(context, options, request)); +} + +StatusOr +NetworkSecurityTracingStub::ListUrlLists( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListUrlListsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "ListUrlLists"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListUrlLists(context, options, request)); +} + +StatusOr +NetworkSecurityTracingStub::GetUrlList( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetUrlListRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "GetUrlList"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetUrlList(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncCreateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "CreateUrlList"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateUrlList(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::CreateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "CreateUrlList"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateUrlList(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncUpdateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "UpdateUrlList"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateUrlList(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::UpdateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "UpdateUrlList"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateUrlList(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncDeleteUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "DeleteUrlList"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteUrlList(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::DeleteUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "DeleteUrlList"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteUrlList(context, options, request)); +} + +StatusOr +NetworkSecurityTracingStub::ListTlsInspectionPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "ListTlsInspectionPolicies"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ListTlsInspectionPolicies(context, options, request)); +} + +StatusOr +NetworkSecurityTracingStub::GetTlsInspectionPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "GetTlsInspectionPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->GetTlsInspectionPolicy(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncCreateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "CreateTlsInspectionPolicy"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateTlsInspectionPolicy(cq, context, + std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::CreateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "CreateTlsInspectionPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->CreateTlsInspectionPolicy(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncUpdateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "UpdateTlsInspectionPolicy"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateTlsInspectionPolicy(cq, context, + std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::UpdateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "UpdateTlsInspectionPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->UpdateTlsInspectionPolicy(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncDeleteTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "DeleteTlsInspectionPolicy"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteTlsInspectionPolicy(cq, context, + std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::DeleteTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.networksecurity.v1.NetworkSecurity", + "DeleteTlsInspectionPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->DeleteTlsInspectionPolicy(context, options, request)); +} + +StatusOr +NetworkSecurityTracingStub::ListAuthzPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "ListAuthzPolicies"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListAuthzPolicies(context, options, request)); +} + +StatusOr +NetworkSecurityTracingStub::GetAuthzPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "GetAuthzPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetAuthzPolicy(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncCreateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "CreateAuthzPolicy"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateAuthzPolicy(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::CreateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "CreateAuthzPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->CreateAuthzPolicy(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncUpdateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "UpdateAuthzPolicy"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateAuthzPolicy(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::UpdateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "UpdateAuthzPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UpdateAuthzPolicy(context, options, request)); +} + +future> +NetworkSecurityTracingStub::AsyncDeleteAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "DeleteAuthzPolicy"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteAuthzPolicy(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +NetworkSecurityTracingStub::DeleteAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.networksecurity.v1.NetworkSecurity", "DeleteAuthzPolicy"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteAuthzPolicy(context, options, request)); +} + StatusOr NetworkSecurityTracingStub::ListLocations( grpc::ClientContext& context, Options const& options, diff --git a/google/cloud/networksecurity/v1/internal/network_security_tracing_stub.h b/google/cloud/networksecurity/v1/internal/network_security_tracing_stub.h index 10ffb38ca4a4a..9c3190e856257 100644 --- a/google/cloud/networksecurity/v1/internal/network_security_tracing_stub.h +++ b/google/cloud/networksecurity/v1/internal/network_security_tracing_stub.h @@ -92,6 +92,58 @@ class NetworkSecurityTracingStub : public NetworkSecurityStub { google::cloud::networksecurity::v1:: DeleteAuthorizationPolicyRequest const& request) override; + StatusOr + ListBackendAuthenticationConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest const& request) override; + + StatusOr + GetBackendAuthenticationConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncCreateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + StatusOr CreateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncUpdateBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + StatusOr UpdateBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request) override; + + future> + AsyncDeleteBackendAuthenticationConfig( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + + StatusOr DeleteBackendAuthenticationConfig( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request) override; + StatusOr ListServerTlsPolicies( grpc::ClientContext& context, Options const& options, @@ -188,6 +240,255 @@ class NetworkSecurityTracingStub : public NetworkSecurityStub { google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& request) override; + StatusOr< + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesResponse> + ListGatewaySecurityPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest const& request) override; + + StatusOr + GetGatewaySecurityPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request) override; + + future> + AsyncCreateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request) override; + + future> + AsyncUpdateGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request) override; + + future> + AsyncDeleteGatewaySecurityPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request) override; + + StatusOr + ListGatewaySecurityPolicyRules( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest const& request) override; + + StatusOr + GetGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncCreateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr CreateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncUpdateGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr UpdateGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request) override; + + future> + AsyncDeleteGatewaySecurityPolicyRule( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr DeleteGatewaySecurityPolicyRule( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request) override; + + StatusOr + ListUrlLists(grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListUrlListsRequest const& + request) override; + + StatusOr GetUrlList( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetUrlListRequest const& request) + override; + + future> AsyncCreateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + StatusOr CreateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request) + override; + + future> AsyncUpdateUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + StatusOr UpdateUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request) + override; + + future> AsyncDeleteUrlList( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) + override; + + StatusOr DeleteUrlList( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request) + override; + + StatusOr< + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesResponse> + ListTlsInspectionPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1:: + ListTlsInspectionPoliciesRequest const& request) override; + + StatusOr + GetTlsInspectionPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request) override; + + future> + AsyncCreateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + StatusOr CreateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request) override; + + future> + AsyncUpdateTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + StatusOr UpdateTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request) override; + + future> + AsyncDeleteTlsInspectionPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + StatusOr DeleteTlsInspectionPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request) override; + + StatusOr + ListAuthzPolicies( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest const& + request) override; + + StatusOr GetAuthzPolicy( + grpc::ClientContext& context, Options const& options, + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request) + override; + + future> AsyncCreateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + StatusOr CreateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request) override; + + future> AsyncUpdateAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + StatusOr UpdateAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request) override; + + future> AsyncDeleteAuthzPolicy( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + + StatusOr DeleteAuthzPolicy( + grpc::ClientContext& context, Options options, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request) override; + StatusOr ListLocations( grpc::ClientContext& context, Options const& options, google::cloud::location::ListLocationsRequest const& request) override; diff --git a/google/cloud/networksecurity/v1/mocks/mock_network_security_connection.h b/google/cloud/networksecurity/v1/mocks/mock_network_security_connection.h index dfadf08660722..2823355cd5b7e 100644 --- a/google/cloud/networksecurity/v1/mocks/mock_network_security_connection.h +++ b/google/cloud/networksecurity/v1/mocks/mock_network_security_connection.h @@ -187,6 +187,154 @@ class MockNetworkSecurityConnection DeleteAuthorizationPolicy, (google::longrunning::Operation const& operation), (override)); + MOCK_METHOD( + (StreamRange< + google::cloud::networksecurity::v1::BackendAuthenticationConfig>), + ListBackendAuthenticationConfigs, + (google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, + GetBackendAuthenticationConfig, + (google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateBackendAuthenticationConfig(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateBackendAuthenticationConfig, + (google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateBackendAuthenticationConfig(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + CreateBackendAuthenticationConfig, + (NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateBackendAuthenticationConfig(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateBackendAuthenticationConfig, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateBackendAuthenticationConfig(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateBackendAuthenticationConfig, + (google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateBackendAuthenticationConfig(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + UpdateBackendAuthenticationConfig, + (NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateBackendAuthenticationConfig(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateBackendAuthenticationConfig, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteBackendAuthenticationConfig(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteBackendAuthenticationConfig, + (google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteBackendAuthenticationConfig(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + DeleteBackendAuthenticationConfig, + (NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteBackendAuthenticationConfig(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteBackendAuthenticationConfig, + (google::longrunning::Operation const& operation), (override)); + MOCK_METHOD( (StreamRange), ListServerTlsPolicies, @@ -467,6 +615,705 @@ class MockNetworkSecurityConnection DeleteClientTlsPolicy, (google::longrunning::Operation const& operation), (override)); + MOCK_METHOD( + (StreamRange), + ListGatewaySecurityPolicies, + (google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesRequest + request), + (override)); + + MOCK_METHOD( + StatusOr, + GetGatewaySecurityPolicy, + (google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateGatewaySecurityPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + CreateGatewaySecurityPolicy, + (google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateGatewaySecurityPolicy(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + CreateGatewaySecurityPolicy, + (NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateGatewaySecurityPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + CreateGatewaySecurityPolicy, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateGatewaySecurityPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + UpdateGatewaySecurityPolicy, + (google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateGatewaySecurityPolicy(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + UpdateGatewaySecurityPolicy, + (NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateGatewaySecurityPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + UpdateGatewaySecurityPolicy, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteGatewaySecurityPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteGatewaySecurityPolicy, + (google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteGatewaySecurityPolicy(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + DeleteGatewaySecurityPolicy, + (NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteGatewaySecurityPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteGatewaySecurityPolicy, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD( + (StreamRange< + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule>), + ListGatewaySecurityPolicyRules, + (google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesRequest + request), + (override)); + + MOCK_METHOD( + StatusOr, + GetGatewaySecurityPolicyRule, + (google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateGatewaySecurityPolicyRule(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateGatewaySecurityPolicyRule, + (google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateGatewaySecurityPolicyRule(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + CreateGatewaySecurityPolicyRule, + (NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateGatewaySecurityPolicyRule(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateGatewaySecurityPolicyRule, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateGatewaySecurityPolicyRule(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateGatewaySecurityPolicyRule, + (google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateGatewaySecurityPolicyRule(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + UpdateGatewaySecurityPolicyRule, + (NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateGatewaySecurityPolicyRule(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateGatewaySecurityPolicyRule, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteGatewaySecurityPolicyRule(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteGatewaySecurityPolicyRule, + (google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteGatewaySecurityPolicyRule(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + DeleteGatewaySecurityPolicyRule, + (NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteGatewaySecurityPolicyRule(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteGatewaySecurityPolicyRule, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD((StreamRange), + ListUrlLists, + (google::cloud::networksecurity::v1::ListUrlListsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, GetUrlList, + (google::cloud::networksecurity::v1::GetUrlListRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateUrlList(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateUrlList, + (google::cloud::networksecurity::v1::CreateUrlListRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateUrlList(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateUrlList, + (NoAwaitTag, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateUrlList(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateUrlList, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateUrlList(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateUrlList, + (google::cloud::networksecurity::v1::UpdateUrlListRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateUrlList(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateUrlList, + (NoAwaitTag, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateUrlList(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateUrlList, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteUrlList(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteUrlList, + (google::cloud::networksecurity::v1::DeleteUrlListRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteUrlList(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteUrlList, + (NoAwaitTag, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteUrlList(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteUrlList, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + (StreamRange), + ListTlsInspectionPolicies, + (google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest + request), + (override)); + + MOCK_METHOD( + StatusOr, + GetTlsInspectionPolicy, + (google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateTlsInspectionPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateTlsInspectionPolicy, + (google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateTlsInspectionPolicy(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + CreateTlsInspectionPolicy, + (NoAwaitTag, google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateTlsInspectionPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateTlsInspectionPolicy, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateTlsInspectionPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateTlsInspectionPolicy, + (google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateTlsInspectionPolicy(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + UpdateTlsInspectionPolicy, + (NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateTlsInspectionPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateTlsInspectionPolicy, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteTlsInspectionPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteTlsInspectionPolicy, + (google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteTlsInspectionPolicy(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, + DeleteTlsInspectionPolicy, + (NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteTlsInspectionPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteTlsInspectionPolicy, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD( + (StreamRange), + ListAuthzPolicies, + (google::cloud::networksecurity::v1::ListAuthzPoliciesRequest request), + (override)); + + MOCK_METHOD(StatusOr, + GetAuthzPolicy, + (google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateAuthzPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateAuthzPolicy, + (google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateAuthzPolicy(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateAuthzPolicy, + (NoAwaitTag, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateAuthzPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateAuthzPolicy, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateAuthzPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateAuthzPolicy, + (google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateAuthzPolicy(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateAuthzPolicy, + (NoAwaitTag, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateAuthzPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateAuthzPolicy, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteAuthzPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteAuthzPolicy, + (google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteAuthzPolicy(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteAuthzPolicy, + (NoAwaitTag, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteAuthzPolicy(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteAuthzPolicy, (google::longrunning::Operation const& operation), + (override)); + MOCK_METHOD((StreamRange), ListLocations, (google::cloud::location::ListLocationsRequest request), (override)); diff --git a/google/cloud/networksecurity/v1/network_security_client.cc b/google/cloud/networksecurity/v1/network_security_client.cc index 8c15cba7a5319..a80dc0f866a48 100644 --- a/google/cloud/networksecurity/v1/network_security_client.cc +++ b/google/cloud/networksecurity/v1/network_security_client.cc @@ -218,6 +218,211 @@ NetworkSecurityClient::DeleteAuthorizationPolicy( return connection_->DeleteAuthorizationPolicy(operation); } +StreamRange +NetworkSecurityClient::ListBackendAuthenticationConfigs( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::ListBackendAuthenticationConfigsRequest + request; + request.set_parent(parent); + return connection_->ListBackendAuthenticationConfigs(request); +} + +StreamRange +NetworkSecurityClient::ListBackendAuthenticationConfigs( + google::cloud::networksecurity::v1::ListBackendAuthenticationConfigsRequest + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListBackendAuthenticationConfigs(std::move(request)); +} + +StatusOr +NetworkSecurityClient::GetBackendAuthenticationConfig(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::GetBackendAuthenticationConfigRequest + request; + request.set_name(name); + return connection_->GetBackendAuthenticationConfig(request); +} + +StatusOr +NetworkSecurityClient::GetBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetBackendAuthenticationConfig(request); +} + +future< + StatusOr> +NetworkSecurityClient::CreateBackendAuthenticationConfig( + std::string const& parent, + google::cloud::networksecurity::v1::BackendAuthenticationConfig const& + backend_authentication_config, + std::string const& backend_authentication_config_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::CreateBackendAuthenticationConfigRequest + request; + request.set_parent(parent); + *request.mutable_backend_authentication_config() = + backend_authentication_config; + request.set_backend_authentication_config_id( + backend_authentication_config_id); + return connection_->CreateBackendAuthenticationConfig(request); +} + +StatusOr +NetworkSecurityClient::CreateBackendAuthenticationConfig( + NoAwaitTag, std::string const& parent, + google::cloud::networksecurity::v1::BackendAuthenticationConfig const& + backend_authentication_config, + std::string const& backend_authentication_config_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::CreateBackendAuthenticationConfigRequest + request; + request.set_parent(parent); + *request.mutable_backend_authentication_config() = + backend_authentication_config; + request.set_backend_authentication_config_id( + backend_authentication_config_id); + return connection_->CreateBackendAuthenticationConfig(NoAwaitTag{}, request); +} + +future< + StatusOr> +NetworkSecurityClient::CreateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateBackendAuthenticationConfig(request); +} + +StatusOr +NetworkSecurityClient::CreateBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateBackendAuthenticationConfig(NoAwaitTag{}, request); +} + +future< + StatusOr> +NetworkSecurityClient::CreateBackendAuthenticationConfig( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateBackendAuthenticationConfig(operation); +} + +future< + StatusOr> +NetworkSecurityClient::UpdateBackendAuthenticationConfig( + google::cloud::networksecurity::v1::BackendAuthenticationConfig const& + backend_authentication_config, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::UpdateBackendAuthenticationConfigRequest + request; + *request.mutable_backend_authentication_config() = + backend_authentication_config; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateBackendAuthenticationConfig(request); +} + +StatusOr +NetworkSecurityClient::UpdateBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1::BackendAuthenticationConfig const& + backend_authentication_config, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::UpdateBackendAuthenticationConfigRequest + request; + *request.mutable_backend_authentication_config() = + backend_authentication_config; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateBackendAuthenticationConfig(NoAwaitTag{}, request); +} + +future< + StatusOr> +NetworkSecurityClient::UpdateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateBackendAuthenticationConfig(request); +} + +StatusOr +NetworkSecurityClient::UpdateBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateBackendAuthenticationConfig(NoAwaitTag{}, request); +} + +future< + StatusOr> +NetworkSecurityClient::UpdateBackendAuthenticationConfig( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateBackendAuthenticationConfig(operation); +} + +future> +NetworkSecurityClient::DeleteBackendAuthenticationConfig( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::DeleteBackendAuthenticationConfigRequest + request; + request.set_name(name); + return connection_->DeleteBackendAuthenticationConfig(request); +} + +StatusOr +NetworkSecurityClient::DeleteBackendAuthenticationConfig( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::DeleteBackendAuthenticationConfigRequest + request; + request.set_name(name); + return connection_->DeleteBackendAuthenticationConfig(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::DeleteBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteBackendAuthenticationConfig(request); +} + +StatusOr +NetworkSecurityClient::DeleteBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteBackendAuthenticationConfig(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::DeleteBackendAuthenticationConfig( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteBackendAuthenticationConfig(operation); +} + StreamRange NetworkSecurityClient::ListServerTlsPolicies(std::string const& parent, Options opts) { @@ -588,6 +793,918 @@ NetworkSecurityClient::DeleteClientTlsPolicy( return connection_->DeleteClientTlsPolicy(operation); } +StreamRange +NetworkSecurityClient::ListGatewaySecurityPolicies(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesRequest + request; + request.set_parent(parent); + return connection_->ListGatewaySecurityPolicies(request); +} + +StreamRange +NetworkSecurityClient::ListGatewaySecurityPolicies( + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesRequest + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListGatewaySecurityPolicies(std::move(request)); +} + +StatusOr +NetworkSecurityClient::GetGatewaySecurityPolicy(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest request; + request.set_name(name); + return connection_->GetGatewaySecurityPolicy(request); +} + +StatusOr +NetworkSecurityClient::GetGatewaySecurityPolicy( + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetGatewaySecurityPolicy(request); +} + +future> +NetworkSecurityClient::CreateGatewaySecurityPolicy( + std::string const& parent, + google::cloud::networksecurity::v1::GatewaySecurityPolicy const& + gateway_security_policy, + std::string const& gateway_security_policy_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::CreateGatewaySecurityPolicyRequest + request; + request.set_parent(parent); + *request.mutable_gateway_security_policy() = gateway_security_policy; + request.set_gateway_security_policy_id(gateway_security_policy_id); + return connection_->CreateGatewaySecurityPolicy(request); +} + +StatusOr +NetworkSecurityClient::CreateGatewaySecurityPolicy( + NoAwaitTag, std::string const& parent, + google::cloud::networksecurity::v1::GatewaySecurityPolicy const& + gateway_security_policy, + std::string const& gateway_security_policy_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::CreateGatewaySecurityPolicyRequest + request; + request.set_parent(parent); + *request.mutable_gateway_security_policy() = gateway_security_policy; + request.set_gateway_security_policy_id(gateway_security_policy_id); + return connection_->CreateGatewaySecurityPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::CreateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateGatewaySecurityPolicy(request); +} + +StatusOr +NetworkSecurityClient::CreateGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateGatewaySecurityPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::CreateGatewaySecurityPolicy( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateGatewaySecurityPolicy(operation); +} + +future> +NetworkSecurityClient::UpdateGatewaySecurityPolicy( + google::cloud::networksecurity::v1::GatewaySecurityPolicy const& + gateway_security_policy, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::UpdateGatewaySecurityPolicyRequest + request; + *request.mutable_gateway_security_policy() = gateway_security_policy; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateGatewaySecurityPolicy(request); +} + +StatusOr +NetworkSecurityClient::UpdateGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::GatewaySecurityPolicy const& + gateway_security_policy, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::UpdateGatewaySecurityPolicyRequest + request; + *request.mutable_gateway_security_policy() = gateway_security_policy; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateGatewaySecurityPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::UpdateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateGatewaySecurityPolicy(request); +} + +StatusOr +NetworkSecurityClient::UpdateGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateGatewaySecurityPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::UpdateGatewaySecurityPolicy( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateGatewaySecurityPolicy(operation); +} + +future> +NetworkSecurityClient::DeleteGatewaySecurityPolicy(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::DeleteGatewaySecurityPolicyRequest + request; + request.set_name(name); + return connection_->DeleteGatewaySecurityPolicy(request); +} + +StatusOr +NetworkSecurityClient::DeleteGatewaySecurityPolicy(NoAwaitTag, + std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::DeleteGatewaySecurityPolicyRequest + request; + request.set_name(name); + return connection_->DeleteGatewaySecurityPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::DeleteGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteGatewaySecurityPolicy(request); +} + +StatusOr +NetworkSecurityClient::DeleteGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteGatewaySecurityPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::DeleteGatewaySecurityPolicy( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteGatewaySecurityPolicy(operation); +} + +StreamRange +NetworkSecurityClient::ListGatewaySecurityPolicyRules(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesRequest + request; + request.set_parent(parent); + return connection_->ListGatewaySecurityPolicyRules(request); +} + +StreamRange +NetworkSecurityClient::ListGatewaySecurityPolicyRules( + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesRequest + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListGatewaySecurityPolicyRules(std::move(request)); +} + +StatusOr +NetworkSecurityClient::GetGatewaySecurityPolicyRule(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRuleRequest + request; + request.set_name(name); + return connection_->GetGatewaySecurityPolicyRule(request); +} + +StatusOr +NetworkSecurityClient::GetGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetGatewaySecurityPolicyRule(request); +} + +future> +NetworkSecurityClient::CreateGatewaySecurityPolicyRule( + std::string const& parent, + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule const& + gateway_security_policy_rule, + std::string const& gateway_security_policy_rule_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::CreateGatewaySecurityPolicyRuleRequest + request; + request.set_parent(parent); + *request.mutable_gateway_security_policy_rule() = + gateway_security_policy_rule; + request.set_gateway_security_policy_rule_id(gateway_security_policy_rule_id); + return connection_->CreateGatewaySecurityPolicyRule(request); +} + +StatusOr +NetworkSecurityClient::CreateGatewaySecurityPolicyRule( + NoAwaitTag, std::string const& parent, + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule const& + gateway_security_policy_rule, + std::string const& gateway_security_policy_rule_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::CreateGatewaySecurityPolicyRuleRequest + request; + request.set_parent(parent); + *request.mutable_gateway_security_policy_rule() = + gateway_security_policy_rule; + request.set_gateway_security_policy_rule_id(gateway_security_policy_rule_id); + return connection_->CreateGatewaySecurityPolicyRule(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::CreateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateGatewaySecurityPolicyRule(request); +} + +StatusOr +NetworkSecurityClient::CreateGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateGatewaySecurityPolicyRule(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::CreateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateGatewaySecurityPolicyRule(operation); +} + +future> +NetworkSecurityClient::UpdateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule const& + gateway_security_policy_rule, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::UpdateGatewaySecurityPolicyRuleRequest + request; + *request.mutable_gateway_security_policy_rule() = + gateway_security_policy_rule; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateGatewaySecurityPolicyRule(request); +} + +StatusOr +NetworkSecurityClient::UpdateGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule const& + gateway_security_policy_rule, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::UpdateGatewaySecurityPolicyRuleRequest + request; + *request.mutable_gateway_security_policy_rule() = + gateway_security_policy_rule; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateGatewaySecurityPolicyRule(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::UpdateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateGatewaySecurityPolicyRule(request); +} + +StatusOr +NetworkSecurityClient::UpdateGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateGatewaySecurityPolicyRule(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::UpdateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateGatewaySecurityPolicyRule(operation); +} + +future> +NetworkSecurityClient::DeleteGatewaySecurityPolicyRule(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::DeleteGatewaySecurityPolicyRuleRequest + request; + request.set_name(name); + return connection_->DeleteGatewaySecurityPolicyRule(request); +} + +StatusOr +NetworkSecurityClient::DeleteGatewaySecurityPolicyRule(NoAwaitTag, + std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::DeleteGatewaySecurityPolicyRuleRequest + request; + request.set_name(name); + return connection_->DeleteGatewaySecurityPolicyRule(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::DeleteGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteGatewaySecurityPolicyRule(request); +} + +StatusOr +NetworkSecurityClient::DeleteGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteGatewaySecurityPolicyRule(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::DeleteGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteGatewaySecurityPolicyRule(operation); +} + +StreamRange +NetworkSecurityClient::ListUrlLists(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::ListUrlListsRequest request; + request.set_parent(parent); + return connection_->ListUrlLists(request); +} + +StreamRange +NetworkSecurityClient::ListUrlLists( + google::cloud::networksecurity::v1::ListUrlListsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListUrlLists(std::move(request)); +} + +StatusOr +NetworkSecurityClient::GetUrlList(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::GetUrlListRequest request; + request.set_name(name); + return connection_->GetUrlList(request); +} + +StatusOr +NetworkSecurityClient::GetUrlList( + google::cloud::networksecurity::v1::GetUrlListRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetUrlList(request); +} + +future> +NetworkSecurityClient::CreateUrlList( + std::string const& parent, + google::cloud::networksecurity::v1::UrlList const& url_list, + std::string const& url_list_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::CreateUrlListRequest request; + request.set_parent(parent); + *request.mutable_url_list() = url_list; + request.set_url_list_id(url_list_id); + return connection_->CreateUrlList(request); +} + +StatusOr NetworkSecurityClient::CreateUrlList( + NoAwaitTag, std::string const& parent, + google::cloud::networksecurity::v1::UrlList const& url_list, + std::string const& url_list_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::CreateUrlListRequest request; + request.set_parent(parent); + *request.mutable_url_list() = url_list; + request.set_url_list_id(url_list_id); + return connection_->CreateUrlList(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::CreateUrlList( + google::cloud::networksecurity::v1::CreateUrlListRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateUrlList(request); +} + +StatusOr NetworkSecurityClient::CreateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateUrlList(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::CreateUrlList( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateUrlList(operation); +} + +future> +NetworkSecurityClient::UpdateUrlList( + google::cloud::networksecurity::v1::UrlList const& url_list, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::UpdateUrlListRequest request; + *request.mutable_url_list() = url_list; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateUrlList(request); +} + +StatusOr NetworkSecurityClient::UpdateUrlList( + NoAwaitTag, google::cloud::networksecurity::v1::UrlList const& url_list, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::UpdateUrlListRequest request; + *request.mutable_url_list() = url_list; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateUrlList(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::UpdateUrlList( + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateUrlList(request); +} + +StatusOr NetworkSecurityClient::UpdateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateUrlList(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::UpdateUrlList( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateUrlList(operation); +} + +future> +NetworkSecurityClient::DeleteUrlList(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::DeleteUrlListRequest request; + request.set_name(name); + return connection_->DeleteUrlList(request); +} + +StatusOr NetworkSecurityClient::DeleteUrlList( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::DeleteUrlListRequest request; + request.set_name(name); + return connection_->DeleteUrlList(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::DeleteUrlList( + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteUrlList(request); +} + +StatusOr NetworkSecurityClient::DeleteUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteUrlList(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::DeleteUrlList( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteUrlList(operation); +} + +StreamRange +NetworkSecurityClient::ListTlsInspectionPolicies(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest request; + request.set_parent(parent); + return connection_->ListTlsInspectionPolicies(request); +} + +StreamRange +NetworkSecurityClient::ListTlsInspectionPolicies( + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListTlsInspectionPolicies(std::move(request)); +} + +StatusOr +NetworkSecurityClient::GetTlsInspectionPolicy(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest request; + request.set_name(name); + return connection_->GetTlsInspectionPolicy(request); +} + +StatusOr +NetworkSecurityClient::GetTlsInspectionPolicy( + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetTlsInspectionPolicy(request); +} + +future> +NetworkSecurityClient::CreateTlsInspectionPolicy( + std::string const& parent, + google::cloud::networksecurity::v1::TlsInspectionPolicy const& + tls_inspection_policy, + std::string const& tls_inspection_policy_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest request; + request.set_parent(parent); + *request.mutable_tls_inspection_policy() = tls_inspection_policy; + request.set_tls_inspection_policy_id(tls_inspection_policy_id); + return connection_->CreateTlsInspectionPolicy(request); +} + +StatusOr +NetworkSecurityClient::CreateTlsInspectionPolicy( + NoAwaitTag, std::string const& parent, + google::cloud::networksecurity::v1::TlsInspectionPolicy const& + tls_inspection_policy, + std::string const& tls_inspection_policy_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest request; + request.set_parent(parent); + *request.mutable_tls_inspection_policy() = tls_inspection_policy; + request.set_tls_inspection_policy_id(tls_inspection_policy_id); + return connection_->CreateTlsInspectionPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::CreateTlsInspectionPolicy( + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateTlsInspectionPolicy(request); +} + +StatusOr +NetworkSecurityClient::CreateTlsInspectionPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateTlsInspectionPolicyRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateTlsInspectionPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::CreateTlsInspectionPolicy( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateTlsInspectionPolicy(operation); +} + +future> +NetworkSecurityClient::UpdateTlsInspectionPolicy( + google::cloud::networksecurity::v1::TlsInspectionPolicy const& + tls_inspection_policy, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest request; + *request.mutable_tls_inspection_policy() = tls_inspection_policy; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateTlsInspectionPolicy(request); +} + +StatusOr +NetworkSecurityClient::UpdateTlsInspectionPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::TlsInspectionPolicy const& + tls_inspection_policy, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest request; + *request.mutable_tls_inspection_policy() = tls_inspection_policy; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateTlsInspectionPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::UpdateTlsInspectionPolicy( + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateTlsInspectionPolicy(request); +} + +StatusOr +NetworkSecurityClient::UpdateTlsInspectionPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateTlsInspectionPolicyRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateTlsInspectionPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::UpdateTlsInspectionPolicy( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateTlsInspectionPolicy(operation); +} + +future> +NetworkSecurityClient::DeleteTlsInspectionPolicy(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest request; + request.set_name(name); + return connection_->DeleteTlsInspectionPolicy(request); +} + +StatusOr +NetworkSecurityClient::DeleteTlsInspectionPolicy(NoAwaitTag, + std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest request; + request.set_name(name); + return connection_->DeleteTlsInspectionPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::DeleteTlsInspectionPolicy( + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteTlsInspectionPolicy(request); +} + +StatusOr +NetworkSecurityClient::DeleteTlsInspectionPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteTlsInspectionPolicyRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteTlsInspectionPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::DeleteTlsInspectionPolicy( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteTlsInspectionPolicy(operation); +} + +StreamRange +NetworkSecurityClient::ListAuthzPolicies(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest request; + request.set_parent(parent); + return connection_->ListAuthzPolicies(request); +} + +StreamRange +NetworkSecurityClient::ListAuthzPolicies( + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListAuthzPolicies(std::move(request)); +} + +StatusOr +NetworkSecurityClient::GetAuthzPolicy(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::GetAuthzPolicyRequest request; + request.set_name(name); + return connection_->GetAuthzPolicy(request); +} + +StatusOr +NetworkSecurityClient::GetAuthzPolicy( + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetAuthzPolicy(request); +} + +future> +NetworkSecurityClient::CreateAuthzPolicy( + std::string const& parent, + google::cloud::networksecurity::v1::AuthzPolicy const& authz_policy, + std::string const& authz_policy_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest request; + request.set_parent(parent); + *request.mutable_authz_policy() = authz_policy; + request.set_authz_policy_id(authz_policy_id); + return connection_->CreateAuthzPolicy(request); +} + +StatusOr +NetworkSecurityClient::CreateAuthzPolicy( + NoAwaitTag, std::string const& parent, + google::cloud::networksecurity::v1::AuthzPolicy const& authz_policy, + std::string const& authz_policy_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest request; + request.set_parent(parent); + *request.mutable_authz_policy() = authz_policy; + request.set_authz_policy_id(authz_policy_id); + return connection_->CreateAuthzPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::CreateAuthzPolicy( + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateAuthzPolicy(request); +} + +StatusOr +NetworkSecurityClient::CreateAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateAuthzPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::CreateAuthzPolicy( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateAuthzPolicy(operation); +} + +future> +NetworkSecurityClient::UpdateAuthzPolicy( + google::cloud::networksecurity::v1::AuthzPolicy const& authz_policy, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest request; + *request.mutable_authz_policy() = authz_policy; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateAuthzPolicy(request); +} + +StatusOr +NetworkSecurityClient::UpdateAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::AuthzPolicy const& authz_policy, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest request; + *request.mutable_authz_policy() = authz_policy; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateAuthzPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::UpdateAuthzPolicy( + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateAuthzPolicy(request); +} + +StatusOr +NetworkSecurityClient::UpdateAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateAuthzPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::UpdateAuthzPolicy( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateAuthzPolicy(operation); +} + +future> +NetworkSecurityClient::DeleteAuthzPolicy(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest request; + request.set_name(name); + return connection_->DeleteAuthzPolicy(request); +} + +StatusOr +NetworkSecurityClient::DeleteAuthzPolicy(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest request; + request.set_name(name); + return connection_->DeleteAuthzPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::DeleteAuthzPolicy( + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteAuthzPolicy(request); +} + +StatusOr +NetworkSecurityClient::DeleteAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteAuthzPolicy(NoAwaitTag{}, request); +} + +future> +NetworkSecurityClient::DeleteAuthzPolicy( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteAuthzPolicy(operation); +} + StreamRange NetworkSecurityClient::ListLocations( google::cloud::location::ListLocationsRequest request, Options opts) { diff --git a/google/cloud/networksecurity/v1/network_security_client.h b/google/cloud/networksecurity/v1/network_security_client.h index d1f75500bc344..9d664202b0404 100644 --- a/google/cloud/networksecurity/v1/network_security_client.h +++ b/google/cloud/networksecurity/v1/network_security_client.h @@ -120,7 +120,7 @@ class NetworkSecurityClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.networksecurity.v1.AuthorizationPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L36} - /// [google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L161} + /// [google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L168} /// // clang-format on StreamRange @@ -159,7 +159,7 @@ class NetworkSecurityClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.networksecurity.v1.AuthorizationPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L36} - /// [google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L161} + /// [google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L168} /// // clang-format on StreamRange @@ -188,7 +188,7 @@ class NetworkSecurityClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.networksecurity.v1.AuthorizationPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L36} - /// [google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L194} + /// [google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L201} /// // clang-format on StatusOr @@ -218,7 +218,7 @@ class NetworkSecurityClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.networksecurity.v1.AuthorizationPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L36} - /// [google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L194} + /// [google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L201} /// // clang-format on StatusOr @@ -259,7 +259,7 @@ class NetworkSecurityClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.networksecurity.v1.AuthorizationPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L36} - /// [google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L206} + /// [google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L213} /// // clang-format on future> @@ -317,7 +317,7 @@ class NetworkSecurityClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.networksecurity.v1.AuthorizationPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L36} - /// [google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L206} + /// [google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L213} /// // clang-format on future> @@ -386,7 +386,7 @@ class NetworkSecurityClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.networksecurity.v1.AuthorizationPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L36} - /// [google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L227} + /// [google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L235} /// // clang-format on future> @@ -443,7 +443,7 @@ class NetworkSecurityClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.networksecurity.v1.AuthorizationPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L36} - /// [google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L227} + /// [google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L235} /// // clang-format on future> @@ -485,8 +485,3070 @@ class NetworkSecurityClient { /// /// Deletes a single AuthorizationPolicy. /// - /// @param name Required. A name of the AuthorizationPolicy to delete. Must be in the format - /// `projects/{project}/locations/{location}/authorizationPolicies/*`. + /// @param name Required. A name of the AuthorizationPolicy to delete. Must be in the + /// format `projects/{project}/locations/{location}/authorizationPolicies/*`. + /// @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.networksecurity.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.networksecurity.v1.DeleteAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L250} + /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} + /// + // clang-format on + future> + DeleteAuthorizationPolicy(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteAuthorizationPolicy + /// + /// 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 DeleteAuthorizationPolicy( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single AuthorizationPolicy. + /// + /// @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.networksecurity.v1.DeleteAuthorizationPolicyRequest]. + /// 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.networksecurity.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.networksecurity.v1.DeleteAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L250} + /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} + /// + // clang-format on + future> + DeleteAuthorizationPolicy(google::cloud::networksecurity::v1:: + DeleteAuthorizationPolicyRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteAuthorizationPolicy + /// + /// 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 DeleteAuthorizationPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteAuthorizationPolicyRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteAuthorizationPolicy + /// + /// 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> + DeleteAuthorizationPolicy(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists BackendAuthenticationConfigs in a given project and location. + /// + /// @param parent Required. The project and location from which the + /// BackendAuthenticationConfigs should be listed, specified in the format + /// `projects/*/locations/{location}`. + /// @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.networksecurity.v1.BackendAuthenticationConfig], 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.networksecurity.v1.BackendAuthenticationConfig]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L56} + /// [google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L139} + /// + // clang-format on + StreamRange + ListBackendAuthenticationConfigs(std::string const& parent, + Options opts = {}); + + // clang-format off + /// + /// Lists BackendAuthenticationConfigs 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.networksecurity.v1.ListBackendAuthenticationConfigsRequest]. + /// 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.networksecurity.v1.BackendAuthenticationConfig], 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.networksecurity.v1.BackendAuthenticationConfig]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L56} + /// [google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L139} + /// + // clang-format on + StreamRange + ListBackendAuthenticationConfigs( + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single BackendAuthenticationConfig to + /// BackendAuthenticationConfig. + /// + /// @param name Required. A name of the BackendAuthenticationConfig to get. Must be in the + /// format `projects/*/locations/{location}/backendAuthenticationConfigs/*`. + /// @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.networksecurity.v1.BackendAuthenticationConfig]) + /// 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.networksecurity.v1.BackendAuthenticationConfig]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L56} + /// [google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L175} + /// + // clang-format on + StatusOr + GetBackendAuthenticationConfig(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single BackendAuthenticationConfig to + /// BackendAuthenticationConfig. + /// + /// @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.networksecurity.v1.GetBackendAuthenticationConfigRequest]. + /// 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.networksecurity.v1.BackendAuthenticationConfig]) + /// 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.networksecurity.v1.BackendAuthenticationConfig]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L56} + /// [google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L175} + /// + // clang-format on + StatusOr + GetBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new BackendAuthenticationConfig in a given project and location. + /// + /// @param parent Required. The parent resource of the BackendAuthenticationConfig. Must be + /// in the format `projects/*/locations/{location}`. + /// @param backend_authentication_config Required. BackendAuthenticationConfig resource to be created. + /// @param backend_authentication_config_id Required. Short name of the BackendAuthenticationConfig resource to be + /// created. This value should be 1-63 characters long, containing only + /// letters, numbers, hyphens, and underscores, and should not start with a + /// number. E.g. "backend-auth-config". + /// @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.networksecurity.v1.BackendAuthenticationConfig] 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.networksecurity.v1.BackendAuthenticationConfig]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L56} + /// [google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L187} + /// + // clang-format on + future< + StatusOr> + CreateBackendAuthenticationConfig( + std::string const& parent, + google::cloud::networksecurity::v1::BackendAuthenticationConfig const& + backend_authentication_config, + std::string const& backend_authentication_config_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateBackendAuthenticationConfig + /// + /// 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 CreateBackendAuthenticationConfig( + NoAwaitTag, std::string const& parent, + google::cloud::networksecurity::v1::BackendAuthenticationConfig const& + backend_authentication_config, + std::string const& backend_authentication_config_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new BackendAuthenticationConfig 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.networksecurity.v1.CreateBackendAuthenticationConfigRequest]. + /// 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.networksecurity.v1.BackendAuthenticationConfig] 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.networksecurity.v1.BackendAuthenticationConfig]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L56} + /// [google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L187} + /// + // clang-format on + future< + StatusOr> + CreateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateBackendAuthenticationConfig + /// + /// 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 CreateBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateBackendAuthenticationConfig + /// + /// 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< + StatusOr> + CreateBackendAuthenticationConfig( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single BackendAuthenticationConfig to + /// BackendAuthenticationConfig. + /// + /// @param backend_authentication_config Required. Updated BackendAuthenticationConfig resource. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// BackendAuthenticationConfig 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.networksecurity.v1.BackendAuthenticationConfig] 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.networksecurity.v1.BackendAuthenticationConfig]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L56} + /// [google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L210} + /// + // clang-format on + future< + StatusOr> + UpdateBackendAuthenticationConfig( + google::cloud::networksecurity::v1::BackendAuthenticationConfig const& + backend_authentication_config, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateBackendAuthenticationConfig + /// + /// 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 UpdateBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1::BackendAuthenticationConfig const& + backend_authentication_config, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single BackendAuthenticationConfig to + /// BackendAuthenticationConfig. + /// + /// @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.networksecurity.v1.UpdateBackendAuthenticationConfigRequest]. + /// 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.networksecurity.v1.BackendAuthenticationConfig] 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.networksecurity.v1.BackendAuthenticationConfig]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L56} + /// [google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L210} + /// + // clang-format on + future< + StatusOr> + UpdateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateBackendAuthenticationConfig + /// + /// 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 UpdateBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateBackendAuthenticationConfig + /// + /// 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< + StatusOr> + UpdateBackendAuthenticationConfig( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single BackendAuthenticationConfig to + /// BackendAuthenticationConfig. + /// + /// @param name Required. A name of the BackendAuthenticationConfig to delete. Must be in + /// the format + /// `projects/*/locations/{location}/backendAuthenticationConfigs/*`. + /// @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.networksecurity.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.networksecurity.v1.DeleteBackendAuthenticationConfigRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L226} + /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} + /// + // clang-format on + future> + DeleteBackendAuthenticationConfig(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteBackendAuthenticationConfig + /// + /// 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 DeleteBackendAuthenticationConfig( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single BackendAuthenticationConfig to + /// BackendAuthenticationConfig. + /// + /// @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.networksecurity.v1.DeleteBackendAuthenticationConfigRequest]. + /// 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.networksecurity.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.networksecurity.v1.DeleteBackendAuthenticationConfigRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/backend_authentication_config.proto#L226} + /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} + /// + // clang-format on + future> + DeleteBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteBackendAuthenticationConfig + /// + /// 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 DeleteBackendAuthenticationConfig( + NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteBackendAuthenticationConfig + /// + /// 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> + DeleteBackendAuthenticationConfig( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Lists ServerTlsPolicies in a given project and location. + /// + /// @param parent Required. The project and location from which the ServerTlsPolicies should + /// be listed, specified in the format `projects/*/locations/{location}`. + /// @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.networksecurity.v1.ServerTlsPolicy], 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.networksecurity.v1.ListServerTlsPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L153} + /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L42} + /// + // clang-format on + StreamRange + ListServerTlsPolicies(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists ServerTlsPolicies 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.networksecurity.v1.ListServerTlsPoliciesRequest]. + /// 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.networksecurity.v1.ServerTlsPolicy], 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.networksecurity.v1.ListServerTlsPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L153} + /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L42} + /// + // clang-format on + StreamRange + ListServerTlsPolicies( + google::cloud::networksecurity::v1::ListServerTlsPoliciesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single ServerTlsPolicy. + /// + /// @param name Required. A name of the ServerTlsPolicy to get. Must be in the format + /// `projects/*/locations/{location}/serverTlsPolicies/*`. + /// @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.networksecurity.v1.ServerTlsPolicy]) + /// 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.networksecurity.v1.GetServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L197} + /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L42} + /// + // clang-format on + StatusOr + GetServerTlsPolicy(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single ServerTlsPolicy. + /// + /// @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.networksecurity.v1.GetServerTlsPolicyRequest]. + /// 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.networksecurity.v1.ServerTlsPolicy]) + /// 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.networksecurity.v1.GetServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L197} + /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L42} + /// + // clang-format on + StatusOr + GetServerTlsPolicy( + google::cloud::networksecurity::v1::GetServerTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new ServerTlsPolicy in a given project and location. + /// + /// @param parent Required. The parent resource of the ServerTlsPolicy. Must be in + /// the format `projects/*/locations/{location}`. + /// @param server_tls_policy Required. ServerTlsPolicy resource to be created. + /// @param server_tls_policy_id Required. Short name of the ServerTlsPolicy resource to be created. This + /// value should be 1-63 characters long, containing only letters, numbers, + /// hyphens, and underscores, and should not start with a number. E.g. + /// "server_mtls_policy". + /// @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.networksecurity.v1.ServerTlsPolicy] 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.networksecurity.v1.CreateServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L209} + /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L42} + /// + // clang-format on + future> + CreateServerTlsPolicy( + std::string const& parent, + google::cloud::networksecurity::v1::ServerTlsPolicy const& + server_tls_policy, + std::string const& server_tls_policy_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateServerTlsPolicy + /// + /// 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 CreateServerTlsPolicy( + NoAwaitTag, std::string const& parent, + google::cloud::networksecurity::v1::ServerTlsPolicy const& + server_tls_policy, + std::string const& server_tls_policy_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new ServerTlsPolicy 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.networksecurity.v1.CreateServerTlsPolicyRequest]. + /// 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.networksecurity.v1.ServerTlsPolicy] 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.networksecurity.v1.CreateServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L209} + /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L42} + /// + // clang-format on + future> + CreateServerTlsPolicy( + google::cloud::networksecurity::v1::CreateServerTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateServerTlsPolicy + /// + /// 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 CreateServerTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateServerTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateServerTlsPolicy + /// + /// 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> + CreateServerTlsPolicy(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single ServerTlsPolicy. + /// + /// @param server_tls_policy Required. Updated ServerTlsPolicy resource. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// ServerTlsPolicy 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.networksecurity.v1.ServerTlsPolicy] 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.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L42} + /// [google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L231} + /// + // clang-format on + future> + UpdateServerTlsPolicy( + google::cloud::networksecurity::v1::ServerTlsPolicy const& + server_tls_policy, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateServerTlsPolicy + /// + /// 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 UpdateServerTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::ServerTlsPolicy const& + server_tls_policy, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single ServerTlsPolicy. + /// + /// @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.networksecurity.v1.UpdateServerTlsPolicyRequest]. + /// 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.networksecurity.v1.ServerTlsPolicy] 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.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L42} + /// [google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L231} + /// + // clang-format on + future> + UpdateServerTlsPolicy( + google::cloud::networksecurity::v1::UpdateServerTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateServerTlsPolicy + /// + /// 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 UpdateServerTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateServerTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateServerTlsPolicy + /// + /// 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> + UpdateServerTlsPolicy(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single ServerTlsPolicy. + /// + /// @param name Required. A name of the ServerTlsPolicy to delete. Must be in + /// the format `projects/*/locations/{location}/serverTlsPolicies/*`. + /// @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.networksecurity.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.networksecurity.v1.DeleteServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L247} + /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} + /// + // clang-format on + future> + DeleteServerTlsPolicy(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteServerTlsPolicy + /// + /// 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 DeleteServerTlsPolicy( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single ServerTlsPolicy. + /// + /// @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.networksecurity.v1.DeleteServerTlsPolicyRequest]. + /// 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.networksecurity.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.networksecurity.v1.DeleteServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L247} + /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} + /// + // clang-format on + future> + DeleteServerTlsPolicy( + google::cloud::networksecurity::v1::DeleteServerTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteServerTlsPolicy + /// + /// 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 DeleteServerTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteServerTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteServerTlsPolicy + /// + /// 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> + DeleteServerTlsPolicy(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists ClientTlsPolicies in a given project and location. + /// + /// @param parent Required. The project and location from which the ClientTlsPolicies should + /// be listed, specified in the format `projects/*/locations/{location}`. + /// @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.networksecurity.v1.ClientTlsPolicy], 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.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L78} + /// + // clang-format on + StreamRange + ListClientTlsPolicies(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists ClientTlsPolicies 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.networksecurity.v1.ListClientTlsPoliciesRequest]. + /// 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.networksecurity.v1.ClientTlsPolicy], 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.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L78} + /// + // clang-format on + StreamRange + ListClientTlsPolicies( + google::cloud::networksecurity::v1::ListClientTlsPoliciesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single ClientTlsPolicy. + /// + /// @param name Required. A name of the ClientTlsPolicy to get. Must be in the format + /// `projects/*/locations/{location}/clientTlsPolicies/*`. + /// @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.networksecurity.v1.ClientTlsPolicy]) + /// 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.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.GetClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L110} + /// + // clang-format on + StatusOr + GetClientTlsPolicy(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single ClientTlsPolicy. + /// + /// @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.networksecurity.v1.GetClientTlsPolicyRequest]. + /// 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.networksecurity.v1.ClientTlsPolicy]) + /// 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.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.GetClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L110} + /// + // clang-format on + StatusOr + GetClientTlsPolicy( + google::cloud::networksecurity::v1::GetClientTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new ClientTlsPolicy in a given project and location. + /// + /// @param parent Required. The parent resource of the ClientTlsPolicy. Must be in + /// the format `projects/*/locations/{location}`. + /// @param client_tls_policy Required. ClientTlsPolicy resource to be created. + /// @param client_tls_policy_id Required. Short name of the ClientTlsPolicy resource to be created. This + /// value should be 1-63 characters long, containing only letters, numbers, + /// hyphens, and underscores, and should not start with a number. E.g. + /// "client_mtls_policy". + /// @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.networksecurity.v1.ClientTlsPolicy] 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.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L122} + /// + // clang-format on + future> + CreateClientTlsPolicy( + std::string const& parent, + google::cloud::networksecurity::v1::ClientTlsPolicy const& + client_tls_policy, + std::string const& client_tls_policy_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateClientTlsPolicy + /// + /// 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 CreateClientTlsPolicy( + NoAwaitTag, std::string const& parent, + google::cloud::networksecurity::v1::ClientTlsPolicy const& + client_tls_policy, + std::string const& client_tls_policy_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new ClientTlsPolicy 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.networksecurity.v1.CreateClientTlsPolicyRequest]. + /// 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.networksecurity.v1.ClientTlsPolicy] 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.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L122} + /// + // clang-format on + future> + CreateClientTlsPolicy( + google::cloud::networksecurity::v1::CreateClientTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateClientTlsPolicy + /// + /// 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 CreateClientTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateClientTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateClientTlsPolicy + /// + /// 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> + CreateClientTlsPolicy(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single ClientTlsPolicy. + /// + /// @param client_tls_policy Required. Updated ClientTlsPolicy resource. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// ClientTlsPolicy 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.networksecurity.v1.ClientTlsPolicy] 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.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L144} + /// + // clang-format on + future> + UpdateClientTlsPolicy( + google::cloud::networksecurity::v1::ClientTlsPolicy const& + client_tls_policy, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateClientTlsPolicy + /// + /// 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 UpdateClientTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::ClientTlsPolicy const& + client_tls_policy, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single ClientTlsPolicy. + /// + /// @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.networksecurity.v1.UpdateClientTlsPolicyRequest]. + /// 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.networksecurity.v1.ClientTlsPolicy] 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.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L144} + /// + // clang-format on + future> + UpdateClientTlsPolicy( + google::cloud::networksecurity::v1::UpdateClientTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateClientTlsPolicy + /// + /// 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 UpdateClientTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateClientTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateClientTlsPolicy + /// + /// 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> + UpdateClientTlsPolicy(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single ClientTlsPolicy. + /// + /// @param name Required. A name of the ClientTlsPolicy to delete. Must be in + /// the format `projects/*/locations/{location}/clientTlsPolicies/*`. + /// @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.networksecurity.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.networksecurity.v1.DeleteClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L160} + /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} + /// + // clang-format on + future> + DeleteClientTlsPolicy(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteClientTlsPolicy + /// + /// 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 DeleteClientTlsPolicy( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single ClientTlsPolicy. + /// + /// @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.networksecurity.v1.DeleteClientTlsPolicyRequest]. + /// 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.networksecurity.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.networksecurity.v1.DeleteClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L160} + /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} + /// + // clang-format on + future> + DeleteClientTlsPolicy( + google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteClientTlsPolicy + /// + /// 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 DeleteClientTlsPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteClientTlsPolicy + /// + /// 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> + DeleteClientTlsPolicy(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists GatewaySecurityPolicies in a given project and location. + /// + /// @param parent Required. The project and location from which the GatewaySecurityPolicies + /// should be listed, specified in the format + /// `projects/{project}/locations/{location}`. + /// @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.networksecurity.v1.GatewaySecurityPolicy], 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.networksecurity.v1.GatewaySecurityPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L34} + /// [google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L91} + /// + // clang-format on + StreamRange + ListGatewaySecurityPolicies(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists GatewaySecurityPolicies 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.networksecurity.v1.ListGatewaySecurityPoliciesRequest]. + /// 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.networksecurity.v1.GatewaySecurityPolicy], 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.networksecurity.v1.GatewaySecurityPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L34} + /// [google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L91} + /// + // clang-format on + StreamRange + ListGatewaySecurityPolicies( + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesRequest + request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single GatewaySecurityPolicy. + /// + /// @param name Required. A name of the GatewaySecurityPolicy to get. Must be in the format + /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`. + /// @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.networksecurity.v1.GatewaySecurityPolicy]) + /// 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.networksecurity.v1.GatewaySecurityPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L34} + /// [google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L127} + /// + // clang-format on + StatusOr + GetGatewaySecurityPolicy(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single GatewaySecurityPolicy. + /// + /// @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.networksecurity.v1.GetGatewaySecurityPolicyRequest]. + /// 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.networksecurity.v1.GatewaySecurityPolicy]) + /// 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.networksecurity.v1.GatewaySecurityPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L34} + /// [google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L127} + /// + // clang-format on + StatusOr + GetGatewaySecurityPolicy( + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new GatewaySecurityPolicy in a given project and location. + /// + /// @param parent Required. The parent resource of the GatewaySecurityPolicy. Must be in the + /// format `projects/{project}/locations/{location}`. + /// @param gateway_security_policy Required. GatewaySecurityPolicy resource to be created. + /// @param gateway_security_policy_id Required. Short name of the GatewaySecurityPolicy resource to be created. + /// This value should be 1-63 characters long, containing only + /// letters, numbers, hyphens, and underscores, and should not start + /// with a number. E.g. "gateway_security_policy1". + /// @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.networksecurity.v1.GatewaySecurityPolicy] 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.networksecurity.v1.CreateGatewaySecurityPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L68} + /// [google.cloud.networksecurity.v1.GatewaySecurityPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L34} + /// + // clang-format on + future> + CreateGatewaySecurityPolicy( + std::string const& parent, + google::cloud::networksecurity::v1::GatewaySecurityPolicy const& + gateway_security_policy, + std::string const& gateway_security_policy_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateGatewaySecurityPolicy + /// + /// 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 CreateGatewaySecurityPolicy( + NoAwaitTag, std::string const& parent, + google::cloud::networksecurity::v1::GatewaySecurityPolicy const& + gateway_security_policy, + std::string const& gateway_security_policy_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new GatewaySecurityPolicy 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.networksecurity.v1.CreateGatewaySecurityPolicyRequest]. + /// 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.networksecurity.v1.GatewaySecurityPolicy] 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.networksecurity.v1.CreateGatewaySecurityPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L68} + /// [google.cloud.networksecurity.v1.GatewaySecurityPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L34} + /// + // clang-format on + future> + CreateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateGatewaySecurityPolicy + /// + /// 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 CreateGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateGatewaySecurityPolicy + /// + /// 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> + CreateGatewaySecurityPolicy(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single GatewaySecurityPolicy. + /// + /// @param gateway_security_policy Required. Updated GatewaySecurityPolicy resource. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// GatewaySecurityPolicy 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.networksecurity.v1.GatewaySecurityPolicy] 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.networksecurity.v1.GatewaySecurityPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L34} + /// [google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L151} + /// + // clang-format on + future> + UpdateGatewaySecurityPolicy( + google::cloud::networksecurity::v1::GatewaySecurityPolicy const& + gateway_security_policy, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateGatewaySecurityPolicy + /// + /// 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 UpdateGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::GatewaySecurityPolicy const& + gateway_security_policy, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single GatewaySecurityPolicy. + /// + /// @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.networksecurity.v1.UpdateGatewaySecurityPolicyRequest]. + /// 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.networksecurity.v1.GatewaySecurityPolicy] 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.networksecurity.v1.GatewaySecurityPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L34} + /// [google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L151} + /// + // clang-format on + future> + UpdateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateGatewaySecurityPolicy + /// + /// 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 UpdateGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateGatewaySecurityPolicy + /// + /// 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> + UpdateGatewaySecurityPolicy(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single GatewaySecurityPolicy. + /// + /// @param name Required. A name of the GatewaySecurityPolicy to delete. Must be in the + /// format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`. + /// @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.networksecurity.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.networksecurity.v1.DeleteGatewaySecurityPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L139} + /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} + /// + // clang-format on + future> + DeleteGatewaySecurityPolicy(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteGatewaySecurityPolicy + /// + /// 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 DeleteGatewaySecurityPolicy( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single GatewaySecurityPolicy. + /// + /// @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.networksecurity.v1.DeleteGatewaySecurityPolicyRequest]. + /// 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.networksecurity.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.networksecurity.v1.DeleteGatewaySecurityPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy.proto#L139} + /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} + /// + // clang-format on + future> + DeleteGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteGatewaySecurityPolicy + /// + /// 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 DeleteGatewaySecurityPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteGatewaySecurityPolicy + /// + /// 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> + DeleteGatewaySecurityPolicy(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists GatewaySecurityPolicyRules in a given project and location. + /// + /// @param parent Required. The project, location and GatewaySecurityPolicy from which the + /// GatewaySecurityPolicyRules should be listed, specified in the format + /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`. + /// @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.networksecurity.v1.GatewaySecurityPolicyRule], 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.networksecurity.v1.GatewaySecurityPolicyRule]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L35} + /// [google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L150} + /// + // clang-format on + StreamRange + ListGatewaySecurityPolicyRules(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists GatewaySecurityPolicyRules 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.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest]. + /// 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.networksecurity.v1.GatewaySecurityPolicyRule], 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.networksecurity.v1.GatewaySecurityPolicyRule]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L35} + /// [google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L150} + /// + // clang-format on + StreamRange + ListGatewaySecurityPolicyRules( + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesRequest + request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single GatewaySecurityPolicyRule. + /// + /// @param name Required. The name of the GatewaySecurityPolicyRule to retrieve. + /// Format: + /// projects/{project}/location/{location}/gatewaySecurityPolicies/*/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.networksecurity.v1.GatewaySecurityPolicyRule]) + /// 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.networksecurity.v1.GatewaySecurityPolicyRule]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L35} + /// [google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L122} + /// + // clang-format on + StatusOr + GetGatewaySecurityPolicyRule(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single GatewaySecurityPolicyRule. + /// + /// @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.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest]. + /// 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.networksecurity.v1.GatewaySecurityPolicyRule]) + /// 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.networksecurity.v1.GatewaySecurityPolicyRule]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L35} + /// [google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L122} + /// + // clang-format on + StatusOr + GetGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new GatewaySecurityPolicy in a given project and location. + /// + /// @param parent Required. The parent where this rule will be created. + /// Format : + /// projects/{project}/location/{location}/gatewaySecurityPolicies/* + /// @param gateway_security_policy_rule Required. The rule to be created. + /// @param gateway_security_policy_rule_id The ID to use for the rule, which will become the final component of + /// the rule's resource name. + /// This value should be 4-63 characters, and valid characters + /// are /[a-z][0-9]-/. + /// @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.networksecurity.v1.GatewaySecurityPolicyRule] 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.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L99} + /// [google.cloud.networksecurity.v1.GatewaySecurityPolicyRule]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L35} + /// + // clang-format on + future< + StatusOr> + CreateGatewaySecurityPolicyRule( + std::string const& parent, + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule const& + gateway_security_policy_rule, + std::string const& gateway_security_policy_rule_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateGatewaySecurityPolicyRule + /// + /// 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 CreateGatewaySecurityPolicyRule( + NoAwaitTag, std::string const& parent, + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule const& + gateway_security_policy_rule, + std::string const& gateway_security_policy_rule_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new GatewaySecurityPolicy 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.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest]. + /// 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.networksecurity.v1.GatewaySecurityPolicyRule] 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.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L99} + /// [google.cloud.networksecurity.v1.GatewaySecurityPolicyRule]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L35} + /// + // clang-format on + future< + StatusOr> + CreateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateGatewaySecurityPolicyRule + /// + /// 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 CreateGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateGatewaySecurityPolicyRule + /// + /// 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< + StatusOr> + CreateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single GatewaySecurityPolicyRule. + /// + /// @param gateway_security_policy_rule Required. Updated GatewaySecurityPolicyRule resource. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// GatewaySecurityPolicy 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.networksecurity.v1.GatewaySecurityPolicyRule] 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.networksecurity.v1.GatewaySecurityPolicyRule]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L35} + /// [google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L135} + /// + // clang-format on + future< + StatusOr> + UpdateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule const& + gateway_security_policy_rule, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateGatewaySecurityPolicyRule + /// + /// 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 UpdateGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule const& + gateway_security_policy_rule, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single GatewaySecurityPolicyRule. + /// + /// @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.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest]. + /// 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.networksecurity.v1.GatewaySecurityPolicyRule] 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.networksecurity.v1.GatewaySecurityPolicyRule]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L35} + /// [google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L135} + /// + // clang-format on + future< + StatusOr> + UpdateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateGatewaySecurityPolicyRule + /// + /// 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 UpdateGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateGatewaySecurityPolicyRule + /// + /// 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< + StatusOr> + UpdateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single GatewaySecurityPolicyRule. + /// + /// @param name Required. A name of the GatewaySecurityPolicyRule to delete. Must be in the + /// format + /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/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.networksecurity.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.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L186} + /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} + /// + // clang-format on + future> + DeleteGatewaySecurityPolicyRule(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteGatewaySecurityPolicyRule + /// + /// 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 DeleteGatewaySecurityPolicyRule( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single GatewaySecurityPolicyRule. + /// + /// @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.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest]. + /// 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.networksecurity.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.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/gateway_security_policy_rule.proto#L186} + /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} + /// + // clang-format on + future> + DeleteGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteGatewaySecurityPolicyRule + /// + /// 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 DeleteGatewaySecurityPolicyRule( + NoAwaitTag, + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteGatewaySecurityPolicyRule + /// + /// 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> + DeleteGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Lists UrlLists in a given project and location. + /// + /// @param parent Required. The project and location from which the UrlLists should + /// be listed, specified in the format + /// `projects/{project}/locations/{location}`. + /// @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.networksecurity.v1.UrlList], 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.networksecurity.v1.ListUrlListsRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L63} + /// [google.cloud.networksecurity.v1.UrlList]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L34} + /// + // clang-format on + StreamRange ListUrlLists( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists UrlLists 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.networksecurity.v1.ListUrlListsRequest]. + /// 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.networksecurity.v1.UrlList], 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.networksecurity.v1.ListUrlListsRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L63} + /// [google.cloud.networksecurity.v1.UrlList]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L34} + /// + // clang-format on + StreamRange ListUrlLists( + google::cloud::networksecurity::v1::ListUrlListsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single UrlList. + /// + /// @param name Required. A name of the UrlList to get. Must be in the format + /// `projects/*/locations/{location}/urlLists/*`. + /// @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.networksecurity.v1.UrlList]) + /// 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.networksecurity.v1.GetUrlListRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L99} + /// [google.cloud.networksecurity.v1.UrlList]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L34} + /// + // clang-format on + StatusOr GetUrlList( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single UrlList. + /// + /// @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.networksecurity.v1.GetUrlListRequest]. + /// 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.networksecurity.v1.UrlList]) + /// 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.networksecurity.v1.GetUrlListRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L99} + /// [google.cloud.networksecurity.v1.UrlList]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L34} + /// + // clang-format on + StatusOr GetUrlList( + google::cloud::networksecurity::v1::GetUrlListRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new UrlList in a given project and location. + /// + /// @param parent Required. The parent resource of the UrlList. Must be in + /// the format `projects/*/locations/{location}`. + /// @param url_list Required. UrlList resource to be created. + /// @param url_list_id Required. Short name of the UrlList resource to be created. This value + /// should be 1-63 characters long, containing only letters, numbers, hyphens, + /// and underscores, and should not start with a number. E.g. "url_list". + /// @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.networksecurity.v1.UrlList] 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.networksecurity.v1.CreateUrlListRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L111} + /// [google.cloud.networksecurity.v1.UrlList]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L34} + /// + // clang-format on + future> CreateUrlList( + std::string const& parent, + google::cloud::networksecurity::v1::UrlList const& url_list, + std::string const& url_list_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateUrlList + /// + /// 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 CreateUrlList( + NoAwaitTag, std::string const& parent, + google::cloud::networksecurity::v1::UrlList const& url_list, + std::string const& url_list_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new UrlList 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.networksecurity.v1.CreateUrlListRequest]. + /// 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.networksecurity.v1.UrlList] 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.networksecurity.v1.CreateUrlListRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L111} + /// [google.cloud.networksecurity.v1.UrlList]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L34} + /// + // clang-format on + future> CreateUrlList( + google::cloud::networksecurity::v1::CreateUrlListRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateUrlList + /// + /// 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 CreateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateUrlList + /// + /// 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> CreateUrlList( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single UrlList. + /// + /// @param url_list Required. Updated UrlList resource. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// UrlList 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.networksecurity.v1.UrlList] 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.networksecurity.v1.UpdateUrlListRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L131} + /// [google.cloud.networksecurity.v1.UrlList]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L34} + /// + // clang-format on + future> UpdateUrlList( + google::cloud::networksecurity::v1::UrlList const& url_list, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateUrlList + /// + /// 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 UpdateUrlList( + NoAwaitTag, google::cloud::networksecurity::v1::UrlList const& url_list, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single UrlList. + /// + /// @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.networksecurity.v1.UpdateUrlListRequest]. + /// 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.networksecurity.v1.UrlList] 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.networksecurity.v1.UpdateUrlListRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L131} + /// [google.cloud.networksecurity.v1.UrlList]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L34} + /// + // clang-format on + future> UpdateUrlList( + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateUrlList + /// + /// 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 UpdateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateUrlList + /// + /// 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> UpdateUrlList( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single UrlList. + /// + /// @param name Required. A name of the UrlList to delete. Must be in + /// the format `projects/*/locations/{location}/urlLists/*`. /// @param opts Optional. Override the class-level options, such as retry and /// backoff policies. /// @return A [`future`] that becomes satisfied when the LRO @@ -507,16 +3569,16 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L240} + /// [google.cloud.networksecurity.v1.DeleteUrlListRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L146} /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} /// // clang-format on future> - DeleteAuthorizationPolicy(std::string const& name, Options opts = {}); + DeleteUrlList(std::string const& name, Options opts = {}); // clang-format off /// - /// @copybrief DeleteAuthorizationPolicy + /// @copybrief DeleteUrlList /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -525,17 +3587,17 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr DeleteAuthorizationPolicy( + StatusOr DeleteUrlList( NoAwaitTag, std::string const& name, Options opts = {}); // clang-format off /// - /// Deletes a single AuthorizationPolicy. + /// Deletes a single UrlList. /// /// @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.networksecurity.v1.DeleteAuthorizationPolicyRequest]. + /// [google.cloud.networksecurity.v1.DeleteUrlListRequest]. /// 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 @@ -558,18 +3620,18 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authorization_policy.proto#L240} + /// [google.cloud.networksecurity.v1.DeleteUrlListRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/url_list.proto#L146} /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} /// // clang-format on future> - DeleteAuthorizationPolicy(google::cloud::networksecurity::v1:: - DeleteAuthorizationPolicyRequest const& request, - Options opts = {}); + DeleteUrlList( + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request, + Options opts = {}); // clang-format off /// - /// @copybrief DeleteAuthorizationPolicy + /// @copybrief DeleteUrlList /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -578,15 +3640,14 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr DeleteAuthorizationPolicy( + StatusOr DeleteUrlList( NoAwaitTag, - google::cloud::networksecurity::v1:: - DeleteAuthorizationPolicyRequest const& request, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request, Options opts = {}); // clang-format off /// - /// @copybrief DeleteAuthorizationPolicy + /// @copybrief DeleteUrlList /// /// This method accepts a `google::longrunning::Operation` that corresponds /// to a previously started Long Running Operation (LRO) and polls the status @@ -594,15 +3655,16 @@ class NetworkSecurityClient { /// // clang-format on future> - DeleteAuthorizationPolicy(google::longrunning::Operation const& operation, - Options opts = {}); + DeleteUrlList(google::longrunning::Operation const& operation, + Options opts = {}); // clang-format off /// - /// Lists ServerTlsPolicies in a given project and location. + /// Lists TlsInspectionPolicies in a given project and location. /// - /// @param parent Required. The project and location from which the ServerTlsPolicies should - /// be listed, specified in the format `projects/*/locations/{location}`. + /// @param parent Required. The project and location from which the TlsInspectionPolicies + /// should be listed, specified in the format + /// `projects/{project}/locations/{location}`. /// @param opts Optional. Override the class-level options, such as retry and /// backoff policies. /// @return a [StreamRange](@ref google::cloud::StreamRange) @@ -615,7 +3677,7 @@ class NetworkSecurityClient { /// 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.networksecurity.v1.ServerTlsPolicy], or rather, + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy], or rather, /// the C++ class generated by Protobuf from that type. Please consult the /// Protobuf documentation for details on the [Protobuf mapping rules]. /// @@ -625,21 +3687,21 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L94} - /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L190} + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L38} /// // clang-format on - StreamRange - ListServerTlsPolicies(std::string const& parent, Options opts = {}); + StreamRange + ListTlsInspectionPolicies(std::string const& parent, Options opts = {}); // clang-format off /// - /// Lists ServerTlsPolicies in a given project and location. + /// Lists TlsInspectionPolicies 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.networksecurity.v1.ListServerTlsPoliciesRequest]. + /// [google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest]. /// 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 @@ -654,7 +3716,7 @@ class NetworkSecurityClient { /// 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.networksecurity.v1.ServerTlsPolicy], or rather, + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy], or rather, /// the C++ class generated by Protobuf from that type. Please consult the /// Protobuf documentation for details on the [Protobuf mapping rules]. /// @@ -664,25 +3726,26 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L94} - /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L190} + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L38} /// // clang-format on - StreamRange - ListServerTlsPolicies( - google::cloud::networksecurity::v1::ListServerTlsPoliciesRequest request, + StreamRange + ListTlsInspectionPolicies( + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest + request, Options opts = {}); // clang-format off /// - /// Gets details of a single ServerTlsPolicy. + /// Gets details of a single TlsInspectionPolicy. /// - /// @param name Required. A name of the ServerTlsPolicy to get. Must be in the format - /// `projects/*/locations/{location}/serverTlsPolicies/*`. + /// @param name Required. A name of the TlsInspectionPolicy to get. Must be in the format + /// `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`. /// @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.networksecurity.v1.ServerTlsPolicy]) + /// ([google.cloud.networksecurity.v1.TlsInspectionPolicy]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -692,27 +3755,27 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.GetServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L126} - /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L226} + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L38} /// // clang-format on - StatusOr - GetServerTlsPolicy(std::string const& name, Options opts = {}); + StatusOr + GetTlsInspectionPolicy(std::string const& name, Options opts = {}); // clang-format off /// - /// Gets details of a single ServerTlsPolicy. + /// Gets details of a single TlsInspectionPolicy. /// /// @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.networksecurity.v1.GetServerTlsPolicyRequest]. + /// [google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest]. /// 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.networksecurity.v1.ServerTlsPolicy]) + /// ([google.cloud.networksecurity.v1.TlsInspectionPolicy]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -722,26 +3785,27 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.GetServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L126} - /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L226} + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L38} /// // clang-format on - StatusOr - GetServerTlsPolicy( - google::cloud::networksecurity::v1::GetServerTlsPolicyRequest const& + StatusOr + GetTlsInspectionPolicy( + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// Creates a new ServerTlsPolicy in a given project and location. + /// Creates a new TlsInspectionPolicy in a given project and location. /// - /// @param parent Required. The parent resource of the ServerTlsPolicy. Must be in - /// the format `projects/*/locations/{location}`. - /// @param server_tls_policy Required. ServerTlsPolicy resource to be created. - /// @param server_tls_policy_id Required. Short name of the ServerTlsPolicy resource to be created. This value should - /// be 1-63 characters long, containing only letters, numbers, hyphens, and - /// underscores, and should not start with a number. E.g. "server_mtls_policy". + /// @param parent Required. The parent resource of the TlsInspectionPolicy. Must be in the + /// format `projects/{project}/locations/{location}`. + /// @param tls_inspection_policy Required. TlsInspectionPolicy resource to be created. + /// @param tls_inspection_policy_id Required. Short name of the TlsInspectionPolicy resource to be created. + /// This value should be 1-63 characters long, containing only + /// letters, numbers, hyphens, and underscores, and should not start + /// with a number. E.g. "tls_inspection_policy1". /// @param opts Optional. Override the class-level options, such as retry and /// backoff policies. /// @return A [`future`] that becomes satisfied when the LRO @@ -751,7 +3815,7 @@ class NetworkSecurityClient { /// 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.networksecurity.v1.ServerTlsPolicy] proto message. + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy] proto message. /// The C++ class representing this message is created by Protobuf, using /// the [Protobuf mapping rules]. /// @@ -762,20 +3826,20 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L138} - /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L168} + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L38} /// // clang-format on - future> - CreateServerTlsPolicy( + future> + CreateTlsInspectionPolicy( std::string const& parent, - google::cloud::networksecurity::v1::ServerTlsPolicy const& - server_tls_policy, - std::string const& server_tls_policy_id, Options opts = {}); + google::cloud::networksecurity::v1::TlsInspectionPolicy const& + tls_inspection_policy, + std::string const& tls_inspection_policy_id, Options opts = {}); // clang-format off /// - /// @copybrief CreateServerTlsPolicy + /// @copybrief CreateTlsInspectionPolicy /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -784,20 +3848,20 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr CreateServerTlsPolicy( + StatusOr CreateTlsInspectionPolicy( NoAwaitTag, std::string const& parent, - google::cloud::networksecurity::v1::ServerTlsPolicy const& - server_tls_policy, - std::string const& server_tls_policy_id, Options opts = {}); + google::cloud::networksecurity::v1::TlsInspectionPolicy const& + tls_inspection_policy, + std::string const& tls_inspection_policy_id, Options opts = {}); // clang-format off /// - /// Creates a new ServerTlsPolicy in a given project and location. + /// Creates a new TlsInspectionPolicy 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.networksecurity.v1.CreateServerTlsPolicyRequest]. + /// [google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest]. /// 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 @@ -809,7 +3873,7 @@ class NetworkSecurityClient { /// 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.networksecurity.v1.ServerTlsPolicy] proto message. + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy] proto message. /// The C++ class representing this message is created by Protobuf, using /// the [Protobuf mapping rules]. /// @@ -820,19 +3884,18 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L138} - /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L36} + /// [google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L168} + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L38} /// // clang-format on - future> - CreateServerTlsPolicy( - google::cloud::networksecurity::v1::CreateServerTlsPolicyRequest const& - request, - Options opts = {}); + future> + CreateTlsInspectionPolicy(google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request, + Options opts = {}); // clang-format off /// - /// @copybrief CreateServerTlsPolicy + /// @copybrief CreateTlsInspectionPolicy /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -841,36 +3904,35 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr CreateServerTlsPolicy( + StatusOr CreateTlsInspectionPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::CreateServerTlsPolicyRequest const& - request, + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// @copybrief CreateServerTlsPolicy + /// @copybrief CreateTlsInspectionPolicy /// /// 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> - CreateServerTlsPolicy(google::longrunning::Operation const& operation, - Options opts = {}); + future> + CreateTlsInspectionPolicy(google::longrunning::Operation const& operation, + Options opts = {}); // clang-format off /// - /// Updates the parameters of a single ServerTlsPolicy. + /// Updates the parameters of a single TlsInspectionPolicy. /// - /// @param server_tls_policy Required. Updated ServerTlsPolicy resource. + /// @param tls_inspection_policy Required. Updated TlsInspectionPolicy resource. /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the - /// ServerTlsPolicy 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. + /// TlsInspectionPolicy 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 @@ -880,7 +3942,7 @@ class NetworkSecurityClient { /// 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.networksecurity.v1.ServerTlsPolicy] proto message. + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy] proto message. /// The C++ class representing this message is created by Protobuf, using /// the [Protobuf mapping rules]. /// @@ -891,19 +3953,19 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L36} - /// [google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L158} + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L38} + /// [google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L256} /// // clang-format on - future> - UpdateServerTlsPolicy( - google::cloud::networksecurity::v1::ServerTlsPolicy const& - server_tls_policy, + future> + UpdateTlsInspectionPolicy( + google::cloud::networksecurity::v1::TlsInspectionPolicy const& + tls_inspection_policy, google::protobuf::FieldMask const& update_mask, Options opts = {}); // clang-format off /// - /// @copybrief UpdateServerTlsPolicy + /// @copybrief UpdateTlsInspectionPolicy /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -912,20 +3974,20 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr UpdateServerTlsPolicy( + StatusOr UpdateTlsInspectionPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::ServerTlsPolicy const& - server_tls_policy, + google::cloud::networksecurity::v1::TlsInspectionPolicy const& + tls_inspection_policy, google::protobuf::FieldMask const& update_mask, Options opts = {}); // clang-format off /// - /// Updates the parameters of a single ServerTlsPolicy. + /// Updates the parameters of a single TlsInspectionPolicy. /// /// @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.networksecurity.v1.UpdateServerTlsPolicyRequest]. + /// [google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest]. /// 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 @@ -937,7 +3999,7 @@ class NetworkSecurityClient { /// 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.networksecurity.v1.ServerTlsPolicy] proto message. + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy] proto message. /// The C++ class representing this message is created by Protobuf, using /// the [Protobuf mapping rules]. /// @@ -948,19 +4010,18 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.ServerTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L36} - /// [google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L158} + /// [google.cloud.networksecurity.v1.TlsInspectionPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L38} + /// [google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L256} /// // clang-format on - future> - UpdateServerTlsPolicy( - google::cloud::networksecurity::v1::UpdateServerTlsPolicyRequest const& - request, - Options opts = {}); + future> + UpdateTlsInspectionPolicy(google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request, + Options opts = {}); // clang-format off /// - /// @copybrief UpdateServerTlsPolicy + /// @copybrief UpdateTlsInspectionPolicy /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -969,31 +4030,32 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr UpdateServerTlsPolicy( + StatusOr UpdateTlsInspectionPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::UpdateServerTlsPolicyRequest const& - request, + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// @copybrief UpdateServerTlsPolicy + /// @copybrief UpdateTlsInspectionPolicy /// /// 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> - UpdateServerTlsPolicy(google::longrunning::Operation const& operation, - Options opts = {}); + future> + UpdateTlsInspectionPolicy(google::longrunning::Operation const& operation, + Options opts = {}); // clang-format off /// - /// Deletes a single ServerTlsPolicy. + /// Deletes a single TlsInspectionPolicy. /// - /// @param name Required. A name of the ServerTlsPolicy to delete. Must be in - /// the format `projects/*/locations/{location}/serverTlsPolicies/*`. + /// @param name Required. A name of the TlsInspectionPolicy to delete. Must be in the + /// format + /// `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`. /// @param opts Optional. Override the class-level options, such as retry and /// backoff policies. /// @return A [`future`] that becomes satisfied when the LRO @@ -1014,16 +4076,16 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L172} + /// [google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L238} /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} /// // clang-format on future> - DeleteServerTlsPolicy(std::string const& name, Options opts = {}); + DeleteTlsInspectionPolicy(std::string const& name, Options opts = {}); // clang-format off /// - /// @copybrief DeleteServerTlsPolicy + /// @copybrief DeleteTlsInspectionPolicy /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -1032,17 +4094,17 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr DeleteServerTlsPolicy( + StatusOr DeleteTlsInspectionPolicy( NoAwaitTag, std::string const& name, Options opts = {}); // clang-format off /// - /// Deletes a single ServerTlsPolicy. + /// Deletes a single TlsInspectionPolicy. /// /// @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.networksecurity.v1.DeleteServerTlsPolicyRequest]. + /// [google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest]. /// 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 @@ -1065,19 +4127,18 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/server_tls_policy.proto#L172} + /// [google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/tls_inspection_policy.proto#L238} /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} /// // clang-format on future> - DeleteServerTlsPolicy( - google::cloud::networksecurity::v1::DeleteServerTlsPolicyRequest const& - request, - Options opts = {}); + DeleteTlsInspectionPolicy(google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request, + Options opts = {}); // clang-format off /// - /// @copybrief DeleteServerTlsPolicy + /// @copybrief DeleteTlsInspectionPolicy /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -1086,15 +4147,15 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr DeleteServerTlsPolicy( + StatusOr DeleteTlsInspectionPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::DeleteServerTlsPolicyRequest const& - request, + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// @copybrief DeleteServerTlsPolicy + /// @copybrief DeleteTlsInspectionPolicy /// /// This method accepts a `google::longrunning::Operation` that corresponds /// to a previously started Long Running Operation (LRO) and polls the status @@ -1102,15 +4163,16 @@ class NetworkSecurityClient { /// // clang-format on future> - DeleteServerTlsPolicy(google::longrunning::Operation const& operation, - Options opts = {}); + DeleteTlsInspectionPolicy(google::longrunning::Operation const& operation, + Options opts = {}); // clang-format off /// - /// Lists ClientTlsPolicies in a given project and location. + /// Lists AuthzPolicies in a given project and location. /// - /// @param parent Required. The project and location from which the ClientTlsPolicies should - /// be listed, specified in the format `projects/*/locations/{location}`. + /// @param parent Required. The project and location from which the `AuthzPolicy` resources + /// are listed, specified in the following format: + /// `projects/{project}/locations/{location}`. /// @param opts Optional. Override the class-level options, such as retry and /// backoff policies. /// @return a [StreamRange](@ref google::cloud::StreamRange) @@ -1123,7 +4185,7 @@ class NetworkSecurityClient { /// 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.networksecurity.v1.ClientTlsPolicy], or rather, + /// [google.cloud.networksecurity.v1.AuthzPolicy], or rather, /// the C++ class generated by Protobuf from that type. Please consult the /// Protobuf documentation for details on the [Protobuf mapping rules]. /// @@ -1133,21 +4195,21 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} - /// [google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L73} + /// [google.cloud.networksecurity.v1.AuthzPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L35} + /// [google.cloud.networksecurity.v1.ListAuthzPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L580} /// // clang-format on - StreamRange - ListClientTlsPolicies(std::string const& parent, Options opts = {}); + StreamRange + ListAuthzPolicies(std::string const& parent, Options opts = {}); // clang-format off /// - /// Lists ClientTlsPolicies in a given project and location. + /// Lists AuthzPolicies 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.networksecurity.v1.ListClientTlsPoliciesRequest]. + /// [google.cloud.networksecurity.v1.ListAuthzPoliciesRequest]. /// 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 @@ -1162,7 +4224,7 @@ class NetworkSecurityClient { /// 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.networksecurity.v1.ClientTlsPolicy], or rather, + /// [google.cloud.networksecurity.v1.AuthzPolicy], or rather, /// the C++ class generated by Protobuf from that type. Please consult the /// Protobuf documentation for details on the [Protobuf mapping rules]. /// @@ -1172,25 +4234,26 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} - /// [google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L73} + /// [google.cloud.networksecurity.v1.AuthzPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L35} + /// [google.cloud.networksecurity.v1.ListAuthzPoliciesRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L580} /// // clang-format on - StreamRange - ListClientTlsPolicies( - google::cloud::networksecurity::v1::ListClientTlsPoliciesRequest request, + StreamRange + ListAuthzPolicies( + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest request, Options opts = {}); // clang-format off /// - /// Gets details of a single ClientTlsPolicy. + /// Gets details of a single AuthzPolicy. /// - /// @param name Required. A name of the ClientTlsPolicy to get. Must be in the format - /// `projects/*/locations/{location}/clientTlsPolicies/*`. + /// @param name Required. A name of the `AuthzPolicy` resource to get. Must be in the + /// format + /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. /// @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.networksecurity.v1.ClientTlsPolicy]) + /// ([google.cloud.networksecurity.v1.AuthzPolicy]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -1200,27 +4263,27 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} - /// [google.cloud.networksecurity.v1.GetClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L105} + /// [google.cloud.networksecurity.v1.AuthzPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L35} + /// [google.cloud.networksecurity.v1.GetAuthzPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L618} /// // clang-format on - StatusOr - GetClientTlsPolicy(std::string const& name, Options opts = {}); + StatusOr GetAuthzPolicy( + std::string const& name, Options opts = {}); // clang-format off /// - /// Gets details of a single ClientTlsPolicy. + /// Gets details of a single AuthzPolicy. /// /// @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.networksecurity.v1.GetClientTlsPolicyRequest]. + /// [google.cloud.networksecurity.v1.GetAuthzPolicyRequest]. /// 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.networksecurity.v1.ClientTlsPolicy]) + /// ([google.cloud.networksecurity.v1.AuthzPolicy]) /// is mapped to a C++ class using the [Protobuf mapping rules]. /// If the request fails, the [`StatusOr`] contains the error details. /// @@ -1230,26 +4293,22 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} - /// [google.cloud.networksecurity.v1.GetClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L105} + /// [google.cloud.networksecurity.v1.AuthzPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L35} + /// [google.cloud.networksecurity.v1.GetAuthzPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L618} /// // clang-format on - StatusOr - GetClientTlsPolicy( - google::cloud::networksecurity::v1::GetClientTlsPolicyRequest const& - request, + StatusOr GetAuthzPolicy( + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// Creates a new ClientTlsPolicy in a given project and location. + /// Creates a new AuthzPolicy in a given project and location. /// - /// @param parent Required. The parent resource of the ClientTlsPolicy. Must be in - /// the format `projects/*/locations/{location}`. - /// @param client_tls_policy Required. ClientTlsPolicy resource to be created. - /// @param client_tls_policy_id Required. Short name of the ClientTlsPolicy resource to be created. This value should - /// be 1-63 characters long, containing only letters, numbers, hyphens, and - /// underscores, and should not start with a number. E.g. "client_mtls_policy". + /// @param parent Required. The parent resource of the `AuthzPolicy` resource. Must be in + /// the format `projects/{project}/locations/{location}`. + /// @param authz_policy Required. `AuthzPolicy` resource to be created. + /// @param authz_policy_id Required. User-provided ID of the `AuthzPolicy` resource to be created. /// @param opts Optional. Override the class-level options, such as retry and /// backoff policies. /// @return A [`future`] that becomes satisfied when the LRO @@ -1259,7 +4318,7 @@ class NetworkSecurityClient { /// 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.networksecurity.v1.ClientTlsPolicy] proto message. + /// [google.cloud.networksecurity.v1.AuthzPolicy] proto message. /// The C++ class representing this message is created by Protobuf, using /// the [Protobuf mapping rules]. /// @@ -1270,20 +4329,19 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} - /// [google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L117} + /// [google.cloud.networksecurity.v1.AuthzPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L35} + /// [google.cloud.networksecurity.v1.CreateAuthzPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L544} /// // clang-format on - future> - CreateClientTlsPolicy( + future> + CreateAuthzPolicy( std::string const& parent, - google::cloud::networksecurity::v1::ClientTlsPolicy const& - client_tls_policy, - std::string const& client_tls_policy_id, Options opts = {}); + google::cloud::networksecurity::v1::AuthzPolicy const& authz_policy, + std::string const& authz_policy_id, Options opts = {}); // clang-format off /// - /// @copybrief CreateClientTlsPolicy + /// @copybrief CreateAuthzPolicy /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -1292,20 +4350,19 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr CreateClientTlsPolicy( + StatusOr CreateAuthzPolicy( NoAwaitTag, std::string const& parent, - google::cloud::networksecurity::v1::ClientTlsPolicy const& - client_tls_policy, - std::string const& client_tls_policy_id, Options opts = {}); + google::cloud::networksecurity::v1::AuthzPolicy const& authz_policy, + std::string const& authz_policy_id, Options opts = {}); // clang-format off /// - /// Creates a new ClientTlsPolicy in a given project and location. + /// Creates a new AuthzPolicy 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.networksecurity.v1.CreateClientTlsPolicyRequest]. + /// [google.cloud.networksecurity.v1.CreateAuthzPolicyRequest]. /// 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 @@ -1317,7 +4374,7 @@ class NetworkSecurityClient { /// 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.networksecurity.v1.ClientTlsPolicy] proto message. + /// [google.cloud.networksecurity.v1.AuthzPolicy] proto message. /// The C++ class representing this message is created by Protobuf, using /// the [Protobuf mapping rules]. /// @@ -1328,19 +4385,19 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} - /// [google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L117} + /// [google.cloud.networksecurity.v1.AuthzPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L35} + /// [google.cloud.networksecurity.v1.CreateAuthzPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L544} /// // clang-format on - future> - CreateClientTlsPolicy( - google::cloud::networksecurity::v1::CreateClientTlsPolicyRequest const& + future> + CreateAuthzPolicy( + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// @copybrief CreateClientTlsPolicy + /// @copybrief CreateAuthzPolicy /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -1349,36 +4406,35 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr CreateClientTlsPolicy( + StatusOr CreateAuthzPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::CreateClientTlsPolicyRequest const& + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// @copybrief CreateClientTlsPolicy + /// @copybrief CreateAuthzPolicy /// /// 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> - CreateClientTlsPolicy(google::longrunning::Operation const& operation, - Options opts = {}); + future> + CreateAuthzPolicy(google::longrunning::Operation const& operation, + Options opts = {}); // clang-format off /// - /// Updates the parameters of a single ClientTlsPolicy. + /// Updates the parameters of a single AuthzPolicy. /// - /// @param client_tls_policy Required. Updated ClientTlsPolicy resource. - /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the - /// ClientTlsPolicy 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 authz_policy Required. `AuthzPolicy` resource being updated. + /// @param update_mask Required. Used to specify the fields to be overwritten in the + /// `AuthzPolicy` resource by the update. + /// The fields specified in the `update_mask` are relative to the resource, not + /// the full request. A field is overwritten if it is in the mask. If the + /// user does not specify a mask, then all fields are overwritten. /// @param opts Optional. Override the class-level options, such as retry and /// backoff policies. /// @return A [`future`] that becomes satisfied when the LRO @@ -1388,7 +4444,7 @@ class NetworkSecurityClient { /// 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.networksecurity.v1.ClientTlsPolicy] proto message. + /// [google.cloud.networksecurity.v1.AuthzPolicy] proto message. /// The C++ class representing this message is created by Protobuf, using /// the [Protobuf mapping rules]. /// @@ -1399,19 +4455,18 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} - /// [google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L137} + /// [google.cloud.networksecurity.v1.AuthzPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L35} + /// [google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L631} /// // clang-format on - future> - UpdateClientTlsPolicy( - google::cloud::networksecurity::v1::ClientTlsPolicy const& - client_tls_policy, + future> + UpdateAuthzPolicy( + google::cloud::networksecurity::v1::AuthzPolicy const& authz_policy, google::protobuf::FieldMask const& update_mask, Options opts = {}); // clang-format off /// - /// @copybrief UpdateClientTlsPolicy + /// @copybrief UpdateAuthzPolicy /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -1420,20 +4475,19 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr UpdateClientTlsPolicy( + StatusOr UpdateAuthzPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::ClientTlsPolicy const& - client_tls_policy, + google::cloud::networksecurity::v1::AuthzPolicy const& authz_policy, google::protobuf::FieldMask const& update_mask, Options opts = {}); // clang-format off /// - /// Updates the parameters of a single ClientTlsPolicy. + /// Updates the parameters of a single AuthzPolicy. /// /// @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.networksecurity.v1.UpdateClientTlsPolicyRequest]. + /// [google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest]. /// 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 @@ -1445,7 +4499,7 @@ class NetworkSecurityClient { /// 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.networksecurity.v1.ClientTlsPolicy] proto message. + /// [google.cloud.networksecurity.v1.AuthzPolicy] proto message. /// The C++ class representing this message is created by Protobuf, using /// the [Protobuf mapping rules]. /// @@ -1456,19 +4510,19 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.ClientTlsPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L36} - /// [google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L137} + /// [google.cloud.networksecurity.v1.AuthzPolicy]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L35} + /// [google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L631} /// // clang-format on - future> - UpdateClientTlsPolicy( - google::cloud::networksecurity::v1::UpdateClientTlsPolicyRequest const& + future> + UpdateAuthzPolicy( + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// @copybrief UpdateClientTlsPolicy + /// @copybrief UpdateAuthzPolicy /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -1477,31 +4531,32 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr UpdateClientTlsPolicy( + StatusOr UpdateAuthzPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::UpdateClientTlsPolicyRequest const& + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// @copybrief UpdateClientTlsPolicy + /// @copybrief UpdateAuthzPolicy /// /// 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> - UpdateClientTlsPolicy(google::longrunning::Operation const& operation, - Options opts = {}); + future> + UpdateAuthzPolicy(google::longrunning::Operation const& operation, + Options opts = {}); // clang-format off /// - /// Deletes a single ClientTlsPolicy. + /// Deletes a single AuthzPolicy. /// - /// @param name Required. A name of the ClientTlsPolicy to delete. Must be in - /// the format `projects/*/locations/{location}/clientTlsPolicies/*`. + /// @param name Required. The name of the `AuthzPolicy` resource to delete. Must be in + /// the format + /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. /// @param opts Optional. Override the class-level options, such as retry and /// backoff policies. /// @return A [`future`] that becomes satisfied when the LRO @@ -1522,16 +4577,16 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L151} + /// [google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L663} /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} /// // clang-format on future> - DeleteClientTlsPolicy(std::string const& name, Options opts = {}); + DeleteAuthzPolicy(std::string const& name, Options opts = {}); // clang-format off /// - /// @copybrief DeleteClientTlsPolicy + /// @copybrief DeleteAuthzPolicy /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -1540,17 +4595,17 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr DeleteClientTlsPolicy( + StatusOr DeleteAuthzPolicy( NoAwaitTag, std::string const& name, Options opts = {}); // clang-format off /// - /// Deletes a single ClientTlsPolicy. + /// Deletes a single AuthzPolicy. /// /// @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.networksecurity.v1.DeleteClientTlsPolicyRequest]. + /// [google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest]. /// 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 @@ -1573,19 +4628,19 @@ class NetworkSecurityClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/client_tls_policy.proto#L151} + /// [google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest]: @googleapis_reference_link{google/cloud/networksecurity/v1/authz_policy.proto#L663} /// [google.cloud.networksecurity.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/networksecurity/v1/common.proto#L31} /// // clang-format on future> - DeleteClientTlsPolicy( - google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& + DeleteAuthzPolicy( + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// @copybrief DeleteClientTlsPolicy + /// @copybrief DeleteAuthzPolicy /// /// Specifying the [`NoAwaitTag`] immediately returns the /// [`google::longrunning::Operation`] that corresponds to the Long Running @@ -1594,15 +4649,15 @@ class NetworkSecurityClient { /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag /// // clang-format on - StatusOr DeleteClientTlsPolicy( + StatusOr DeleteAuthzPolicy( NoAwaitTag, - google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& request, Options opts = {}); // clang-format off /// - /// @copybrief DeleteClientTlsPolicy + /// @copybrief DeleteAuthzPolicy /// /// This method accepts a `google::longrunning::Operation` that corresponds /// to a previously started Long Running Operation (LRO) and polls the status @@ -1610,8 +4665,8 @@ class NetworkSecurityClient { /// // clang-format on future> - DeleteClientTlsPolicy(google::longrunning::Operation const& operation, - Options opts = {}); + DeleteAuthzPolicy(google::longrunning::Operation const& operation, + Options opts = {}); // clang-format off /// @@ -2005,7 +5060,7 @@ class NetworkSecurityClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2044,7 +5099,7 @@ class NetworkSecurityClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/networksecurity/v1/network_security_connection.cc b/google/cloud/networksecurity/v1/network_security_connection.cc index bee4aa3946186..016e9dd85fabf 100644 --- a/google/cloud/networksecurity/v1/network_security_connection.cc +++ b/google/cloud/networksecurity/v1/network_security_connection.cc @@ -127,6 +127,100 @@ NetworkSecurityConnection::DeleteAuthorizationPolicy( Status(StatusCode::kUnimplemented, "not implemented")); } +StreamRange +NetworkSecurityConnection::ListBackendAuthenticationConfigs( + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange>(); +} + +StatusOr +NetworkSecurityConnection::GetBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future< + StatusOr> +NetworkSecurityConnection::CreateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::CreateBackendAuthenticationConfig( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future< + StatusOr> +NetworkSecurityConnection::CreateBackendAuthenticationConfig( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future< + StatusOr> +NetworkSecurityConnection::UpdateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::UpdateBackendAuthenticationConfig( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future< + StatusOr> +NetworkSecurityConnection::UpdateBackendAuthenticationConfig( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::DeleteBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::DeleteBackendAuthenticationConfig( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::DeleteBackendAuthenticationConfig( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + StreamRange NetworkSecurityConnection::ListServerTlsPolicies( google::cloud::networksecurity::v1:: @@ -299,6 +393,447 @@ NetworkSecurityConnection::DeleteClientTlsPolicy( Status(StatusCode::kUnimplemented, "not implemented")); } +StreamRange +NetworkSecurityConnection::ListGatewaySecurityPolicies( + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +NetworkSecurityConnection::GetGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +NetworkSecurityConnection::CreateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::CreateGatewaySecurityPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::CreateGatewaySecurityPolicy( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::UpdateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::UpdateGatewaySecurityPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::UpdateGatewaySecurityPolicy( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::DeleteGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::DeleteGatewaySecurityPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::DeleteGatewaySecurityPolicy( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +NetworkSecurityConnection::ListGatewaySecurityPolicyRules( + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange>(); +} + +StatusOr +NetworkSecurityConnection::GetGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +NetworkSecurityConnection::CreateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::CreateGatewaySecurityPolicyRule( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::CreateGatewaySecurityPolicyRule( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::UpdateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::UpdateGatewaySecurityPolicyRule( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::UpdateGatewaySecurityPolicyRule( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::DeleteGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::DeleteGatewaySecurityPolicyRule( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::DeleteGatewaySecurityPolicyRule( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +NetworkSecurityConnection::ListUrlLists( + google::cloud::networksecurity::v1:: + ListUrlListsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +NetworkSecurityConnection::GetUrlList( + google::cloud::networksecurity::v1::GetUrlListRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +NetworkSecurityConnection::CreateUrlList( + google::cloud::networksecurity::v1::CreateUrlListRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::CreateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateUrlListRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::CreateUrlList( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::UpdateUrlList( + google::cloud::networksecurity::v1::UpdateUrlListRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::UpdateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateUrlListRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::UpdateUrlList( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::DeleteUrlList( + google::cloud::networksecurity::v1::DeleteUrlListRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::DeleteUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteUrlListRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::DeleteUrlList( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +NetworkSecurityConnection::ListTlsInspectionPolicies( + google::cloud::networksecurity::v1:: + ListTlsInspectionPoliciesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +NetworkSecurityConnection::GetTlsInspectionPolicy( + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +NetworkSecurityConnection::CreateTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::CreateTlsInspectionPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::CreateTlsInspectionPolicy( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::UpdateTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::UpdateTlsInspectionPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::UpdateTlsInspectionPolicy( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::DeleteTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::DeleteTlsInspectionPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::DeleteTlsInspectionPolicy( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +NetworkSecurityConnection::ListAuthzPolicies( + google::cloud::networksecurity::v1:: + ListAuthzPoliciesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +NetworkSecurityConnection::GetAuthzPolicy( + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +NetworkSecurityConnection::CreateAuthzPolicy( + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::CreateAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::CreateAuthzPolicy( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::UpdateAuthzPolicy( + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::UpdateAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::UpdateAuthzPolicy( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::DeleteAuthzPolicy( + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +NetworkSecurityConnection::DeleteAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +NetworkSecurityConnection::DeleteAuthzPolicy( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + StreamRange NetworkSecurityConnection::ListLocations( google::cloud::location:: diff --git a/google/cloud/networksecurity/v1/network_security_connection.h b/google/cloud/networksecurity/v1/network_security_connection.h index b69e925f227aa..c5d6fcc94628d 100644 --- a/google/cloud/networksecurity/v1/network_security_connection.h +++ b/google/cloud/networksecurity/v1/network_security_connection.h @@ -240,6 +240,66 @@ class NetworkSecurityConnection { StatusOr> DeleteAuthorizationPolicy(google::longrunning::Operation const& operation); + virtual StreamRange< + google::cloud::networksecurity::v1::BackendAuthenticationConfig> + ListBackendAuthenticationConfigs( + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest request); + + virtual StatusOr< + google::cloud::networksecurity::v1::BackendAuthenticationConfig> + GetBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request); + + virtual future< + StatusOr> + CreateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request); + + virtual StatusOr + CreateBackendAuthenticationConfig( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request); + + virtual future< + StatusOr> + CreateBackendAuthenticationConfig( + google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + UpdateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request); + + virtual StatusOr + UpdateBackendAuthenticationConfig( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request); + + virtual future< + StatusOr> + UpdateBackendAuthenticationConfig( + google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request); + + virtual StatusOr + DeleteBackendAuthenticationConfig( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request); + + virtual future< + StatusOr> + DeleteBackendAuthenticationConfig( + google::longrunning::Operation const& operation); + virtual StreamRange ListServerTlsPolicies( google::cloud::networksecurity::v1::ListServerTlsPoliciesRequest request); @@ -340,6 +400,260 @@ class NetworkSecurityConnection { StatusOr> DeleteClientTlsPolicy(google::longrunning::Operation const& operation); + virtual StreamRange + ListGatewaySecurityPolicies( + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesRequest + request); + + virtual StatusOr + GetGatewaySecurityPolicy( + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request); + + virtual future< + StatusOr> + CreateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request); + + virtual StatusOr CreateGatewaySecurityPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request); + + virtual future< + StatusOr> + CreateGatewaySecurityPolicy(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + UpdateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request); + + virtual StatusOr UpdateGatewaySecurityPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request); + + virtual future< + StatusOr> + UpdateGatewaySecurityPolicy(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request); + + virtual StatusOr DeleteGatewaySecurityPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request); + + virtual future< + StatusOr> + DeleteGatewaySecurityPolicy(google::longrunning::Operation const& operation); + + virtual StreamRange< + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule> + ListGatewaySecurityPolicyRules( + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesRequest + request); + + virtual StatusOr< + google::cloud::networksecurity::v1::GatewaySecurityPolicyRule> + GetGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request); + + virtual future< + StatusOr> + CreateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request); + + virtual StatusOr + CreateGatewaySecurityPolicyRule( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request); + + virtual future< + StatusOr> + CreateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + UpdateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request); + + virtual StatusOr + UpdateGatewaySecurityPolicyRule( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request); + + virtual future< + StatusOr> + UpdateGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request); + + virtual StatusOr + DeleteGatewaySecurityPolicyRule( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request); + + virtual future< + StatusOr> + DeleteGatewaySecurityPolicyRule( + google::longrunning::Operation const& operation); + + virtual StreamRange ListUrlLists( + google::cloud::networksecurity::v1::ListUrlListsRequest request); + + virtual StatusOr GetUrlList( + google::cloud::networksecurity::v1::GetUrlListRequest const& request); + + virtual future> + CreateUrlList( + google::cloud::networksecurity::v1::CreateUrlListRequest const& request); + + virtual StatusOr CreateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateUrlListRequest const& request); + + virtual future> + CreateUrlList(google::longrunning::Operation const& operation); + + virtual future> + UpdateUrlList( + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request); + + virtual StatusOr UpdateUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request); + + virtual future> + UpdateUrlList(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteUrlList( + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request); + + virtual StatusOr DeleteUrlList( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request); + + virtual future< + StatusOr> + DeleteUrlList(google::longrunning::Operation const& operation); + + virtual StreamRange + ListTlsInspectionPolicies( + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest + request); + + virtual StatusOr + GetTlsInspectionPolicy( + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request); + + virtual future< + StatusOr> + CreateTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request); + + virtual StatusOr CreateTlsInspectionPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request); + + virtual future< + StatusOr> + CreateTlsInspectionPolicy(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + UpdateTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request); + + virtual StatusOr UpdateTlsInspectionPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request); + + virtual future< + StatusOr> + UpdateTlsInspectionPolicy(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request); + + virtual StatusOr DeleteTlsInspectionPolicy( + NoAwaitTag, google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request); + + virtual future< + StatusOr> + DeleteTlsInspectionPolicy(google::longrunning::Operation const& operation); + + virtual StreamRange + ListAuthzPolicies( + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest request); + + virtual StatusOr + GetAuthzPolicy( + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request); + + virtual future> + CreateAuthzPolicy( + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request); + + virtual StatusOr CreateAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request); + + virtual future> + CreateAuthzPolicy(google::longrunning::Operation const& operation); + + virtual future> + UpdateAuthzPolicy( + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request); + + virtual StatusOr UpdateAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request); + + virtual future> + UpdateAuthzPolicy(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteAuthzPolicy( + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request); + + virtual StatusOr DeleteAuthzPolicy( + NoAwaitTag, + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request); + + virtual future< + StatusOr> + DeleteAuthzPolicy(google::longrunning::Operation const& operation); + virtual StreamRange ListLocations( google::cloud::location::ListLocationsRequest request); diff --git a/google/cloud/networksecurity/v1/network_security_connection_idempotency_policy.cc b/google/cloud/networksecurity/v1/network_security_connection_idempotency_policy.cc index 8e8d54a2d858d..3548af99a7b60 100644 --- a/google/cloud/networksecurity/v1/network_security_connection_idempotency_policy.cc +++ b/google/cloud/networksecurity/v1/network_security_connection_idempotency_policy.cc @@ -67,6 +67,41 @@ NetworkSecurityConnectionIdempotencyPolicy::DeleteAuthorizationPolicy( return Idempotency::kNonIdempotent; } +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::ListBackendAuthenticationConfigs( + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::GetBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::CreateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::UpdateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::DeleteBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const&) { + return Idempotency::kNonIdempotent; +} + Idempotency NetworkSecurityConnectionIdempotencyPolicy::ListServerTlsPolicies( google::cloud::networksecurity::v1:: ListServerTlsPoliciesRequest) { // NOLINT @@ -119,6 +154,159 @@ Idempotency NetworkSecurityConnectionIdempotencyPolicy::DeleteClientTlsPolicy( return Idempotency::kNonIdempotent; } +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::ListGatewaySecurityPolicies( + google::cloud::networksecurity::v1:: + ListGatewaySecurityPoliciesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::GetGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::CreateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::UpdateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::DeleteGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::ListGatewaySecurityPolicyRules( + google::cloud::networksecurity::v1:: + ListGatewaySecurityPolicyRulesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::GetGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::CreateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::UpdateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::DeleteGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency NetworkSecurityConnectionIdempotencyPolicy::ListUrlLists( + google::cloud::networksecurity::v1::ListUrlListsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency NetworkSecurityConnectionIdempotencyPolicy::GetUrlList( + google::cloud::networksecurity::v1::GetUrlListRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency NetworkSecurityConnectionIdempotencyPolicy::CreateUrlList( + google::cloud::networksecurity::v1::CreateUrlListRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency NetworkSecurityConnectionIdempotencyPolicy::UpdateUrlList( + google::cloud::networksecurity::v1::UpdateUrlListRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency NetworkSecurityConnectionIdempotencyPolicy::DeleteUrlList( + google::cloud::networksecurity::v1::DeleteUrlListRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::ListTlsInspectionPolicies( + google::cloud::networksecurity::v1:: + ListTlsInspectionPoliciesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency NetworkSecurityConnectionIdempotencyPolicy::GetTlsInspectionPolicy( + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::CreateTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::UpdateTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +NetworkSecurityConnectionIdempotencyPolicy::DeleteTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency NetworkSecurityConnectionIdempotencyPolicy::ListAuthzPolicies( + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency NetworkSecurityConnectionIdempotencyPolicy::GetAuthzPolicy( + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency NetworkSecurityConnectionIdempotencyPolicy::CreateAuthzPolicy( + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency NetworkSecurityConnectionIdempotencyPolicy::UpdateAuthzPolicy( + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency NetworkSecurityConnectionIdempotencyPolicy::DeleteAuthzPolicy( + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const&) { + return Idempotency::kNonIdempotent; +} + Idempotency NetworkSecurityConnectionIdempotencyPolicy::ListLocations( google::cloud::location::ListLocationsRequest) { // NOLINT return Idempotency::kIdempotent; diff --git a/google/cloud/networksecurity/v1/network_security_connection_idempotency_policy.h b/google/cloud/networksecurity/v1/network_security_connection_idempotency_policy.h index 66d1a0c9233ad..42269e017be39 100644 --- a/google/cloud/networksecurity/v1/network_security_connection_idempotency_policy.h +++ b/google/cloud/networksecurity/v1/network_security_connection_idempotency_policy.h @@ -60,6 +60,26 @@ class NetworkSecurityConnectionIdempotencyPolicy { google::cloud::networksecurity::v1:: DeleteAuthorizationPolicyRequest const& request); + virtual google::cloud::Idempotency ListBackendAuthenticationConfigs( + google::cloud::networksecurity::v1:: + ListBackendAuthenticationConfigsRequest request); + + virtual google::cloud::Idempotency GetBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + GetBackendAuthenticationConfigRequest const& request); + + virtual google::cloud::Idempotency CreateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + CreateBackendAuthenticationConfigRequest const& request); + + virtual google::cloud::Idempotency UpdateBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + UpdateBackendAuthenticationConfigRequest const& request); + + virtual google::cloud::Idempotency DeleteBackendAuthenticationConfig( + google::cloud::networksecurity::v1:: + DeleteBackendAuthenticationConfigRequest const& request); + virtual google::cloud::Idempotency ListServerTlsPolicies( google::cloud::networksecurity::v1::ListServerTlsPoliciesRequest request); @@ -98,6 +118,99 @@ class NetworkSecurityConnectionIdempotencyPolicy { google::cloud::networksecurity::v1::DeleteClientTlsPolicyRequest const& request); + virtual google::cloud::Idempotency ListGatewaySecurityPolicies( + google::cloud::networksecurity::v1::ListGatewaySecurityPoliciesRequest + request); + + virtual google::cloud::Idempotency GetGatewaySecurityPolicy( + google::cloud::networksecurity::v1::GetGatewaySecurityPolicyRequest const& + request); + + virtual google::cloud::Idempotency CreateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRequest const& request); + + virtual google::cloud::Idempotency UpdateGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRequest const& request); + + virtual google::cloud::Idempotency DeleteGatewaySecurityPolicy( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRequest const& request); + + virtual google::cloud::Idempotency ListGatewaySecurityPolicyRules( + google::cloud::networksecurity::v1::ListGatewaySecurityPolicyRulesRequest + request); + + virtual google::cloud::Idempotency GetGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + GetGatewaySecurityPolicyRuleRequest const& request); + + virtual google::cloud::Idempotency CreateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + CreateGatewaySecurityPolicyRuleRequest const& request); + + virtual google::cloud::Idempotency UpdateGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + UpdateGatewaySecurityPolicyRuleRequest const& request); + + virtual google::cloud::Idempotency DeleteGatewaySecurityPolicyRule( + google::cloud::networksecurity::v1:: + DeleteGatewaySecurityPolicyRuleRequest const& request); + + virtual google::cloud::Idempotency ListUrlLists( + google::cloud::networksecurity::v1::ListUrlListsRequest request); + + virtual google::cloud::Idempotency GetUrlList( + google::cloud::networksecurity::v1::GetUrlListRequest const& request); + + virtual google::cloud::Idempotency CreateUrlList( + google::cloud::networksecurity::v1::CreateUrlListRequest const& request); + + virtual google::cloud::Idempotency UpdateUrlList( + google::cloud::networksecurity::v1::UpdateUrlListRequest const& request); + + virtual google::cloud::Idempotency DeleteUrlList( + google::cloud::networksecurity::v1::DeleteUrlListRequest const& request); + + virtual google::cloud::Idempotency ListTlsInspectionPolicies( + google::cloud::networksecurity::v1::ListTlsInspectionPoliciesRequest + request); + + virtual google::cloud::Idempotency GetTlsInspectionPolicy( + google::cloud::networksecurity::v1::GetTlsInspectionPolicyRequest const& + request); + + virtual google::cloud::Idempotency CreateTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + CreateTlsInspectionPolicyRequest const& request); + + virtual google::cloud::Idempotency UpdateTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + UpdateTlsInspectionPolicyRequest const& request); + + virtual google::cloud::Idempotency DeleteTlsInspectionPolicy( + google::cloud::networksecurity::v1:: + DeleteTlsInspectionPolicyRequest const& request); + + virtual google::cloud::Idempotency ListAuthzPolicies( + google::cloud::networksecurity::v1::ListAuthzPoliciesRequest request); + + virtual google::cloud::Idempotency GetAuthzPolicy( + google::cloud::networksecurity::v1::GetAuthzPolicyRequest const& request); + + virtual google::cloud::Idempotency CreateAuthzPolicy( + google::cloud::networksecurity::v1::CreateAuthzPolicyRequest const& + request); + + virtual google::cloud::Idempotency UpdateAuthzPolicy( + google::cloud::networksecurity::v1::UpdateAuthzPolicyRequest const& + request); + + virtual google::cloud::Idempotency DeleteAuthzPolicy( + google::cloud::networksecurity::v1::DeleteAuthzPolicyRequest const& + request); + virtual google::cloud::Idempotency ListLocations( google::cloud::location::ListLocationsRequest request); diff --git a/google/cloud/networkservices/quickstart/.bazelversion b/google/cloud/networkservices/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/networkservices/quickstart/.bazelversion +++ b/google/cloud/networkservices/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/networkservices/quickstart/WORKSPACE.bazel b/google/cloud/networkservices/quickstart/WORKSPACE.bazel index 244a4d815a70f..e6fc9ef35169b 100644 --- a/google/cloud/networkservices/quickstart/WORKSPACE.bazel +++ b/google/cloud/networkservices/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/networkservices/v1/dep_client.h b/google/cloud/networkservices/v1/dep_client.h index 66533d158d641..7793ff6bc0db9 100644 --- a/google/cloud/networkservices/v1/dep_client.h +++ b/google/cloud/networkservices/v1/dep_client.h @@ -2516,7 +2516,7 @@ class DepServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2555,7 +2555,7 @@ class DepServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/networkservices/v1/network_services_client.h b/google/cloud/networkservices/v1/network_services_client.h index 875ccde795ef7..caae8d00d2d06 100644 --- a/google/cloud/networkservices/v1/network_services_client.h +++ b/google/cloud/networkservices/v1/network_services_client.h @@ -6085,7 +6085,7 @@ class NetworkServicesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -6124,7 +6124,7 @@ class NetworkServicesClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/notebooks/quickstart/.bazelversion b/google/cloud/notebooks/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/notebooks/quickstart/.bazelversion +++ b/google/cloud/notebooks/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/notebooks/quickstart/WORKSPACE.bazel b/google/cloud/notebooks/quickstart/WORKSPACE.bazel index e4628603a9183..f3608c4e3127d 100644 --- a/google/cloud/notebooks/quickstart/WORKSPACE.bazel +++ b/google/cloud/notebooks/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/notebooks/v1/managed_notebook_client.h b/google/cloud/notebooks/v1/managed_notebook_client.h index 037b298fb28a4..c8516bbd45c77 100644 --- a/google/cloud/notebooks/v1/managed_notebook_client.h +++ b/google/cloud/notebooks/v1/managed_notebook_client.h @@ -1849,7 +1849,7 @@ class ManagedNotebookServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1888,7 +1888,7 @@ class ManagedNotebookServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/notebooks/v1/notebook_client.h b/google/cloud/notebooks/v1/notebook_client.h index ea5cf119e239c..88bd4c7b3b8d4 100644 --- a/google/cloud/notebooks/v1/notebook_client.h +++ b/google/cloud/notebooks/v1/notebook_client.h @@ -3133,7 +3133,7 @@ class NotebookServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -3172,7 +3172,7 @@ class NotebookServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/notebooks/v2/notebook_client.h b/google/cloud/notebooks/v2/notebook_client.h index cbf3a5f6f318d..51be272f492a0 100644 --- a/google/cloud/notebooks/v2/notebook_client.h +++ b/google/cloud/notebooks/v2/notebook_client.h @@ -1442,7 +1442,7 @@ class NotebookServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1481,7 +1481,7 @@ class NotebookServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/oauth2/quickstart/.bazelversion b/google/cloud/oauth2/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/oauth2/quickstart/.bazelversion +++ b/google/cloud/oauth2/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/oauth2/quickstart/WORKSPACE.bazel b/google/cloud/oauth2/quickstart/WORKSPACE.bazel index b43c5fb256888..ecba39d0d821e 100644 --- a/google/cloud/oauth2/quickstart/WORKSPACE.bazel +++ b/google/cloud/oauth2/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/opentelemetry/quickstart/.bazelversion b/google/cloud/opentelemetry/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/opentelemetry/quickstart/.bazelversion +++ b/google/cloud/opentelemetry/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/opentelemetry/quickstart/WORKSPACE.bazel b/google/cloud/opentelemetry/quickstart/WORKSPACE.bazel index ce0416c25282c..0c8560afa983c 100644 --- a/google/cloud/opentelemetry/quickstart/WORKSPACE.bazel +++ b/google/cloud/opentelemetry/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/optimization/quickstart/.bazelversion b/google/cloud/optimization/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/optimization/quickstart/.bazelversion +++ b/google/cloud/optimization/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/optimization/quickstart/WORKSPACE.bazel b/google/cloud/optimization/quickstart/WORKSPACE.bazel index c3f5da07829ad..0b35065782adc 100644 --- a/google/cloud/optimization/quickstart/WORKSPACE.bazel +++ b/google/cloud/optimization/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/oracledatabase/quickstart/WORKSPACE.bazel b/google/cloud/oracledatabase/quickstart/WORKSPACE.bazel index d66b1e3073844..a6e49893664cf 100644 --- a/google/cloud/oracledatabase/quickstart/WORKSPACE.bazel +++ b/google/cloud/oracledatabase/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/oracledatabase/v1/oracle_database_client.h b/google/cloud/oracledatabase/v1/oracle_database_client.h index 12270b0d66c01..e6a39861a4f7c 100644 --- a/google/cloud/oracledatabase/v1/oracle_database_client.h +++ b/google/cloud/oracledatabase/v1/oracle_database_client.h @@ -5754,7 +5754,7 @@ class OracleDatabaseClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -5793,7 +5793,7 @@ class OracleDatabaseClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/orgpolicy/quickstart/.bazelversion b/google/cloud/orgpolicy/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/orgpolicy/quickstart/.bazelversion +++ b/google/cloud/orgpolicy/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/orgpolicy/quickstart/WORKSPACE.bazel b/google/cloud/orgpolicy/quickstart/WORKSPACE.bazel index b764353fae762..68c1a035be95f 100644 --- a/google/cloud/orgpolicy/quickstart/WORKSPACE.bazel +++ b/google/cloud/orgpolicy/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/osconfig/quickstart/.bazelversion b/google/cloud/osconfig/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/osconfig/quickstart/.bazelversion +++ b/google/cloud/osconfig/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/osconfig/quickstart/WORKSPACE.bazel b/google/cloud/osconfig/quickstart/WORKSPACE.bazel index 8d74e31a00331..415e0ac028bba 100644 --- a/google/cloud/osconfig/quickstart/WORKSPACE.bazel +++ b/google/cloud/osconfig/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/oslogin/quickstart/.bazelversion b/google/cloud/oslogin/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/oslogin/quickstart/.bazelversion +++ b/google/cloud/oslogin/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/oslogin/quickstart/WORKSPACE.bazel b/google/cloud/oslogin/quickstart/WORKSPACE.bazel index fc584f26d94b8..07f9e42e28b74 100644 --- a/google/cloud/oslogin/quickstart/WORKSPACE.bazel +++ b/google/cloud/oslogin/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/parallelstore/quickstart/.bazelversion b/google/cloud/parallelstore/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/parallelstore/quickstart/.bazelversion +++ b/google/cloud/parallelstore/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/parallelstore/quickstart/WORKSPACE.bazel b/google/cloud/parallelstore/quickstart/WORKSPACE.bazel index cec8da9861081..94fb0576a74a2 100644 --- a/google/cloud/parallelstore/quickstart/WORKSPACE.bazel +++ b/google/cloud/parallelstore/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/parallelstore/v1/parallelstore_client.h b/google/cloud/parallelstore/v1/parallelstore_client.h index 85ec1d27e92a7..22147b3260706 100644 --- a/google/cloud/parallelstore/v1/parallelstore_client.h +++ b/google/cloud/parallelstore/v1/parallelstore_client.h @@ -1021,7 +1021,7 @@ class ParallelstoreClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1060,7 +1060,7 @@ class ParallelstoreClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/parametermanager/quickstart/WORKSPACE.bazel b/google/cloud/parametermanager/quickstart/WORKSPACE.bazel index 7276963c32426..c09ddd91bdc14 100644 --- a/google/cloud/parametermanager/quickstart/WORKSPACE.bazel +++ b/google/cloud/parametermanager/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/policysimulator/quickstart/.bazelversion b/google/cloud/policysimulator/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/policysimulator/quickstart/.bazelversion +++ b/google/cloud/policysimulator/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/policysimulator/quickstart/WORKSPACE.bazel b/google/cloud/policysimulator/quickstart/WORKSPACE.bazel index 8c570e7cf4bd8..5e3a450b05212 100644 --- a/google/cloud/policysimulator/quickstart/WORKSPACE.bazel +++ b/google/cloud/policysimulator/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/policytroubleshooter/quickstart/.bazelversion b/google/cloud/policytroubleshooter/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/policytroubleshooter/quickstart/.bazelversion +++ b/google/cloud/policytroubleshooter/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/policytroubleshooter/quickstart/WORKSPACE.bazel b/google/cloud/policytroubleshooter/quickstart/WORKSPACE.bazel index 4b37a2a6922bb..2a9acf0e673f1 100644 --- a/google/cloud/policytroubleshooter/quickstart/WORKSPACE.bazel +++ b/google/cloud/policytroubleshooter/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/privateca/quickstart/.bazelversion b/google/cloud/privateca/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/privateca/quickstart/.bazelversion +++ b/google/cloud/privateca/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/privateca/quickstart/WORKSPACE.bazel b/google/cloud/privateca/quickstart/WORKSPACE.bazel index d7231621b4e8a..2145206959353 100644 --- a/google/cloud/privateca/quickstart/WORKSPACE.bazel +++ b/google/cloud/privateca/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/privateca/v1/certificate_authority_client.h b/google/cloud/privateca/v1/certificate_authority_client.h index 62155d3937a24..bf7c1f67f41c4 100644 --- a/google/cloud/privateca/v1/certificate_authority_client.h +++ b/google/cloud/privateca/v1/certificate_authority_client.h @@ -3320,7 +3320,7 @@ class CertificateAuthorityServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -3359,7 +3359,7 @@ class CertificateAuthorityServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/privilegedaccessmanager/quickstart/.bazelversion b/google/cloud/privilegedaccessmanager/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/privilegedaccessmanager/quickstart/.bazelversion +++ b/google/cloud/privilegedaccessmanager/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/privilegedaccessmanager/quickstart/WORKSPACE.bazel b/google/cloud/privilegedaccessmanager/quickstart/WORKSPACE.bazel index a415ee70f9889..0be3ae6946e6b 100644 --- a/google/cloud/privilegedaccessmanager/quickstart/WORKSPACE.bazel +++ b/google/cloud/privilegedaccessmanager/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/profiler/quickstart/.bazelversion b/google/cloud/profiler/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/profiler/quickstart/.bazelversion +++ b/google/cloud/profiler/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/profiler/quickstart/WORKSPACE.bazel b/google/cloud/profiler/quickstart/WORKSPACE.bazel index 3d3d637069c74..a9fe8891f7018 100644 --- a/google/cloud/profiler/quickstart/WORKSPACE.bazel +++ b/google/cloud/profiler/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/publicca/quickstart/.bazelversion b/google/cloud/publicca/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/publicca/quickstart/.bazelversion +++ b/google/cloud/publicca/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/publicca/quickstart/WORKSPACE.bazel b/google/cloud/publicca/quickstart/WORKSPACE.bazel index 5785e248c8a6f..d7427c6d6d984 100644 --- a/google/cloud/publicca/quickstart/WORKSPACE.bazel +++ b/google/cloud/publicca/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/pubsub/admin/subscription_admin_client.h b/google/cloud/pubsub/admin/subscription_admin_client.h index b015cba278408..9ce5b825aea4b 100644 --- a/google/cloud/pubsub/admin/subscription_admin_client.h +++ b/google/cloud/pubsub/admin/subscription_admin_client.h @@ -211,7 +211,7 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.GetSubscriptionRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L1995} + /// [google.pubsub.v1.GetSubscriptionRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2077} /// [google.pubsub.v1.Subscription]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L1405} /// // clang-format on @@ -241,7 +241,7 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.GetSubscriptionRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L1995} + /// [google.pubsub.v1.GetSubscriptionRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2077} /// [google.pubsub.v1.Subscription]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L1405} /// // clang-format on @@ -272,7 +272,7 @@ class SubscriptionAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.pubsub.v1.Subscription]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L1405} - /// [google.pubsub.v1.UpdateSubscriptionRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2007} + /// [google.pubsub.v1.UpdateSubscriptionRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2089} /// // clang-format on StatusOr UpdateSubscription( @@ -305,7 +305,7 @@ class SubscriptionAdminClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.pubsub.v1.Subscription]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L1405} - /// [google.pubsub.v1.UpdateSubscriptionRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2007} + /// [google.pubsub.v1.UpdateSubscriptionRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2089} /// // clang-format on StatusOr UpdateSubscription( @@ -340,7 +340,7 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.ListSubscriptionsRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2018} + /// [google.pubsub.v1.ListSubscriptionsRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2100} /// [google.pubsub.v1.Subscription]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L1405} /// // clang-format on @@ -379,7 +379,7 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.ListSubscriptionsRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2018} + /// [google.pubsub.v1.ListSubscriptionsRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2100} /// [google.pubsub.v1.Subscription]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L1405} /// // clang-format on @@ -407,7 +407,7 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.DeleteSubscriptionRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2050} + /// [google.pubsub.v1.DeleteSubscriptionRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2132} /// // clang-format on Status DeleteSubscription(std::string const& subscription, Options opts = {}); @@ -437,7 +437,7 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.DeleteSubscriptionRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2050} + /// [google.pubsub.v1.DeleteSubscriptionRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2132} /// // clang-format on Status DeleteSubscription( @@ -472,7 +472,7 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.ModifyPushConfigRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2062} + /// [google.pubsub.v1.ModifyPushConfigRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2144} /// // clang-format on Status ModifyPushConfig(std::string const& subscription, @@ -505,7 +505,7 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.ModifyPushConfigRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2062} + /// [google.pubsub.v1.ModifyPushConfigRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2144} /// // clang-format on Status ModifyPushConfig( @@ -535,8 +535,8 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.GetSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2419} - /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2382} + /// [google.pubsub.v1.GetSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2501} + /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2464} /// // clang-format on StatusOr GetSnapshot( @@ -569,8 +569,8 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.GetSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2419} - /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2382} + /// [google.pubsub.v1.GetSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2501} + /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2464} /// // clang-format on StatusOr GetSnapshot( @@ -608,8 +608,8 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.ListSnapshotsRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2429} - /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2382} + /// [google.pubsub.v1.ListSnapshotsRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2511} + /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2464} /// // clang-format on StreamRange ListSnapshots( @@ -651,8 +651,8 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.ListSnapshotsRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2429} - /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2382} + /// [google.pubsub.v1.ListSnapshotsRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2511} + /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2464} /// // clang-format on StreamRange ListSnapshots( @@ -705,8 +705,8 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.CreateSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2321} - /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2382} + /// [google.pubsub.v1.CreateSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2403} + /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2464} /// // clang-format on StatusOr CreateSnapshot( @@ -751,8 +751,8 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.CreateSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2321} - /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2382} + /// [google.pubsub.v1.CreateSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2403} + /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2464} /// // clang-format on StatusOr CreateSnapshot( @@ -784,8 +784,8 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2382} - /// [google.pubsub.v1.UpdateSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2367} + /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2464} + /// [google.pubsub.v1.UpdateSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2449} /// // clang-format on StatusOr UpdateSnapshot( @@ -820,8 +820,8 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2382} - /// [google.pubsub.v1.UpdateSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2367} + /// [google.pubsub.v1.Snapshot]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2464} + /// [google.pubsub.v1.UpdateSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2449} /// // clang-format on StatusOr UpdateSnapshot( @@ -853,7 +853,7 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.DeleteSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2460} + /// [google.pubsub.v1.DeleteSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2542} /// // clang-format on Status DeleteSnapshot(std::string const& snapshot, Options opts = {}); @@ -887,7 +887,7 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.DeleteSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2460} + /// [google.pubsub.v1.DeleteSnapshotRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2542} /// // clang-format on Status DeleteSnapshot( @@ -923,8 +923,8 @@ class SubscriptionAdminClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.pubsub.v1.SeekRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2470} - /// [google.pubsub.v1.SeekResponse]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2506} + /// [google.pubsub.v1.SeekRequest]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2552} + /// [google.pubsub.v1.SeekResponse]: @googleapis_reference_link{google/pubsub/v1/pubsub.proto#L2588} /// // clang-format on StatusOr Seek( diff --git a/google/cloud/pubsub/quickstart/.bazelversion b/google/cloud/pubsub/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/pubsub/quickstart/.bazelversion +++ b/google/cloud/pubsub/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/pubsub/quickstart/MODULE.bazel b/google/cloud/pubsub/quickstart/MODULE.bazel index 769db68723a0d..e47bfb6fa8af0 100644 --- a/google/cloud/pubsub/quickstart/MODULE.bazel +++ b/google/cloud/pubsub/quickstart/MODULE.bazel @@ -17,4 +17,4 @@ module( version = "0.0.0", ) -bazel_dep(name = "google_cloud_cpp", version = "3.1.0") +bazel_dep(name = "google_cloud_cpp", version = "3.2.0") diff --git a/google/cloud/pubsub/quickstart/WORKSPACE.bazel b/google/cloud/pubsub/quickstart/WORKSPACE.bazel index da38437e192c7..45cd7155f98eb 100644 --- a/google/cloud/pubsub/quickstart/WORKSPACE.bazel +++ b/google/cloud/pubsub/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/pubsublite/admin_client.h b/google/cloud/pubsublite/admin_client.h index f68edbe3097c3..389a7cd26b566 100644 --- a/google/cloud/pubsublite/admin_client.h +++ b/google/cloud/pubsublite/admin_client.h @@ -1505,7 +1505,7 @@ class AdminServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1544,7 +1544,7 @@ class AdminServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/pubsublite/quickstart/.bazelversion b/google/cloud/pubsublite/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/pubsublite/quickstart/.bazelversion +++ b/google/cloud/pubsublite/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/pubsublite/quickstart/WORKSPACE.bazel b/google/cloud/pubsublite/quickstart/WORKSPACE.bazel index 77b716b6ce1bd..f2f397a2ff426 100644 --- a/google/cloud/pubsublite/quickstart/WORKSPACE.bazel +++ b/google/cloud/pubsublite/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/pubsublite/topic_stats_client.h b/google/cloud/pubsublite/topic_stats_client.h index 0f398becbcc11..d6d8ee8eccbf3 100644 --- a/google/cloud/pubsublite/topic_stats_client.h +++ b/google/cloud/pubsublite/topic_stats_client.h @@ -409,7 +409,7 @@ class TopicStatsServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -448,7 +448,7 @@ class TopicStatsServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/rapidmigrationassessment/quickstart/.bazelversion b/google/cloud/rapidmigrationassessment/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/rapidmigrationassessment/quickstart/.bazelversion +++ b/google/cloud/rapidmigrationassessment/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/rapidmigrationassessment/quickstart/WORKSPACE.bazel b/google/cloud/rapidmigrationassessment/quickstart/WORKSPACE.bazel index 011e813555997..d904b33a6a3c2 100644 --- a/google/cloud/rapidmigrationassessment/quickstart/WORKSPACE.bazel +++ b/google/cloud/rapidmigrationassessment/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_client.h b/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_client.h index ebdf0a4521f23..2b7741b4271e9 100644 --- a/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_client.h +++ b/google/cloud/rapidmigrationassessment/v1/rapid_migration_assessment_client.h @@ -1410,7 +1410,7 @@ class RapidMigrationAssessmentClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1449,7 +1449,7 @@ class RapidMigrationAssessmentClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/recaptchaenterprise/quickstart/.bazelversion b/google/cloud/recaptchaenterprise/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/recaptchaenterprise/quickstart/.bazelversion +++ b/google/cloud/recaptchaenterprise/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/recaptchaenterprise/quickstart/WORKSPACE.bazel b/google/cloud/recaptchaenterprise/quickstart/WORKSPACE.bazel index ad26f4b6e56b0..f516d662ff52c 100644 --- a/google/cloud/recaptchaenterprise/quickstart/WORKSPACE.bazel +++ b/google/cloud/recaptchaenterprise/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/recommender/quickstart/.bazelversion b/google/cloud/recommender/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/recommender/quickstart/.bazelversion +++ b/google/cloud/recommender/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/recommender/quickstart/WORKSPACE.bazel b/google/cloud/recommender/quickstart/WORKSPACE.bazel index 9117cf6471e09..c1475484a0c69 100644 --- a/google/cloud/recommender/quickstart/WORKSPACE.bazel +++ b/google/cloud/recommender/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/redis/cluster/v1/cloud_redis_cluster_client.cc b/google/cloud/redis/cluster/v1/cloud_redis_cluster_client.cc index 44712c0c6901e..54104bb9494dd 100644 --- a/google/cloud/redis/cluster/v1/cloud_redis_cluster_client.cc +++ b/google/cloud/redis/cluster/v1/cloud_redis_cluster_client.cc @@ -212,6 +212,25 @@ CloudRedisClusterClient::GetClusterCertificateAuthority( return connection_->GetClusterCertificateAuthority(request); } +StatusOr +CloudRedisClusterClient::GetSharedRegionalCertificateAuthority( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest request; + request.set_name(name); + return connection_->GetSharedRegionalCertificateAuthority(request); +} + +StatusOr +CloudRedisClusterClient::GetSharedRegionalCertificateAuthority( + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetSharedRegionalCertificateAuthority(request); +} + future> CloudRedisClusterClient::RescheduleClusterMaintenance( std::string const& name, diff --git a/google/cloud/redis/cluster/v1/cloud_redis_cluster_client.h b/google/cloud/redis/cluster/v1/cloud_redis_cluster_client.h index 4ec7699578834..5a46966d9b90e 100644 --- a/google/cloud/redis/cluster/v1/cloud_redis_cluster_client.h +++ b/google/cloud/redis/cluster/v1/cloud_redis_cluster_client.h @@ -142,8 +142,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L634} - /// [google.cloud.redis.cluster.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L366} + /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L664} + /// [google.cloud.redis.cluster.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L396} /// // clang-format on StreamRange ListClusters( @@ -189,8 +189,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L634} - /// [google.cloud.redis.cluster.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L366} + /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L664} + /// [google.cloud.redis.cluster.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L396} /// // clang-format on StreamRange ListClusters( @@ -217,8 +217,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L634} - /// [google.cloud.redis.cluster.v1.GetClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L434} + /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L664} + /// [google.cloud.redis.cluster.v1.GetClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L464} /// // clang-format on StatusOr GetCluster( @@ -247,8 +247,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L634} - /// [google.cloud.redis.cluster.v1.GetClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L434} + /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L664} + /// [google.cloud.redis.cluster.v1.GetClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L464} /// // clang-format on StatusOr GetCluster( @@ -291,8 +291,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L634} - /// [google.cloud.redis.cluster.v1.UpdateClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L415} + /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L664} + /// [google.cloud.redis.cluster.v1.UpdateClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L445} /// // clang-format on future> UpdateCluster( @@ -348,8 +348,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L634} - /// [google.cloud.redis.cluster.v1.UpdateClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L415} + /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L664} + /// [google.cloud.redis.cluster.v1.UpdateClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L445} /// // clang-format on future> UpdateCluster( @@ -412,7 +412,7 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.DeleteClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L445} + /// [google.cloud.redis.cluster.v1.DeleteClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L475} /// [google.protobuf.Any]: @googleapis_reference_link{google/protobuf/any.proto#L128} /// // clang-format on @@ -464,7 +464,7 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.DeleteClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L445} + /// [google.cloud.redis.cluster.v1.DeleteClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L475} /// [google.protobuf.Any]: @googleapis_reference_link{google/protobuf/any.proto#L128} /// // clang-format on @@ -543,8 +543,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L634} - /// [google.cloud.redis.cluster.v1.CreateClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L337} + /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L664} + /// [google.cloud.redis.cluster.v1.CreateClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L367} /// // clang-format on future> CreateCluster( @@ -605,8 +605,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L634} - /// [google.cloud.redis.cluster.v1.CreateClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L337} + /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L664} + /// [google.cloud.redis.cluster.v1.CreateClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L367} /// // clang-format on future> CreateCluster( @@ -661,8 +661,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.CertificateAuthority]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L1361} - /// [google.cloud.redis.cluster.v1.GetClusterCertificateAuthorityRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L460} + /// [google.cloud.redis.cluster.v1.CertificateAuthority]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L1459} + /// [google.cloud.redis.cluster.v1.GetClusterCertificateAuthorityRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L490} /// // clang-format on StatusOr @@ -691,8 +691,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.CertificateAuthority]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L1361} - /// [google.cloud.redis.cluster.v1.GetClusterCertificateAuthorityRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L460} + /// [google.cloud.redis.cluster.v1.CertificateAuthority]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L1459} + /// [google.cloud.redis.cluster.v1.GetClusterCertificateAuthorityRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L490} /// // clang-format on StatusOr @@ -701,6 +701,71 @@ class CloudRedisClusterClient { GetClusterCertificateAuthorityRequest const& request, Options opts = {}); + // clang-format off + /// + /// Gets the details of regional certificate authority information for Redis + /// cluster. + /// + /// @param name Required. Regional certificate authority resource name using the form: + /// `projects/{project_id}/locations/{location_id}/sharedRegionalCertificateAuthority` + /// where `location_id` refers to a Google Cloud region. + /// @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.redis.cluster.v1.SharedRegionalCertificateAuthority]) + /// 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.redis.cluster.v1.GetSharedRegionalCertificateAuthorityRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L1416} + /// [google.cloud.redis.cluster.v1.SharedRegionalCertificateAuthority]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L1381} + /// + // clang-format on + StatusOr< + google::cloud::redis::cluster::v1::SharedRegionalCertificateAuthority> + GetSharedRegionalCertificateAuthority(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Gets the details of regional certificate authority information for Redis + /// cluster. + /// + /// @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.redis.cluster.v1.GetSharedRegionalCertificateAuthorityRequest]. + /// 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.redis.cluster.v1.SharedRegionalCertificateAuthority]) + /// 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.redis.cluster.v1.GetSharedRegionalCertificateAuthorityRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L1416} + /// [google.cloud.redis.cluster.v1.SharedRegionalCertificateAuthority]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L1381} + /// + // clang-format on + StatusOr< + google::cloud::redis::cluster::v1::SharedRegionalCertificateAuthority> + GetSharedRegionalCertificateAuthority( + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request, + Options opts = {}); + // clang-format off /// /// Reschedules upcoming maintenance event. @@ -733,8 +798,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L634} - /// [google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L1500} + /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L664} + /// [google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L1598} /// // clang-format on future> @@ -791,8 +856,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L634} - /// [google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L1500} + /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L664} + /// [google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L1598} /// // clang-format on future> @@ -865,8 +930,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.BackupCollection]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L884} - /// [google.cloud.redis.cluster.v1.ListBackupCollectionsRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L473} + /// [google.cloud.redis.cluster.v1.BackupCollection]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L934} + /// [google.cloud.redis.cluster.v1.ListBackupCollectionsRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L503} /// // clang-format on StreamRange @@ -908,8 +973,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.BackupCollection]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L884} - /// [google.cloud.redis.cluster.v1.ListBackupCollectionsRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L473} + /// [google.cloud.redis.cluster.v1.BackupCollection]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L934} + /// [google.cloud.redis.cluster.v1.ListBackupCollectionsRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L503} /// // clang-format on StreamRange @@ -937,8 +1002,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.BackupCollection]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L884} - /// [google.cloud.redis.cluster.v1.GetBackupCollectionRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L522} + /// [google.cloud.redis.cluster.v1.BackupCollection]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L934} + /// [google.cloud.redis.cluster.v1.GetBackupCollectionRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L552} /// // clang-format on StatusOr @@ -967,8 +1032,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.BackupCollection]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L884} - /// [google.cloud.redis.cluster.v1.GetBackupCollectionRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L522} + /// [google.cloud.redis.cluster.v1.BackupCollection]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L934} + /// [google.cloud.redis.cluster.v1.GetBackupCollectionRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L552} /// // clang-format on StatusOr @@ -1005,8 +1070,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Backup]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L926} - /// [google.cloud.redis.cluster.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L535} + /// [google.cloud.redis.cluster.v1.Backup]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L976} + /// [google.cloud.redis.cluster.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L565} /// // clang-format on StreamRange ListBackups( @@ -1044,8 +1109,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Backup]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L926} - /// [google.cloud.redis.cluster.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L535} + /// [google.cloud.redis.cluster.v1.Backup]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L976} + /// [google.cloud.redis.cluster.v1.ListBackupsRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L565} /// // clang-format on StreamRange ListBackups( @@ -1071,8 +1136,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Backup]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L926} - /// [google.cloud.redis.cluster.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L573} + /// [google.cloud.redis.cluster.v1.Backup]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L976} + /// [google.cloud.redis.cluster.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L603} /// // clang-format on StatusOr GetBackup( @@ -1101,8 +1166,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Backup]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L926} - /// [google.cloud.redis.cluster.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L573} + /// [google.cloud.redis.cluster.v1.Backup]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L976} + /// [google.cloud.redis.cluster.v1.GetBackupRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L603} /// // clang-format on StatusOr GetBackup( @@ -1135,7 +1200,7 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.DeleteBackupRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L583} + /// [google.cloud.redis.cluster.v1.DeleteBackupRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L613} /// [google.protobuf.Any]: @googleapis_reference_link{google/protobuf/any.proto#L128} /// // clang-format on @@ -1187,7 +1252,7 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.DeleteBackupRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L583} + /// [google.cloud.redis.cluster.v1.DeleteBackupRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L613} /// [google.protobuf.Any]: @googleapis_reference_link{google/protobuf/any.proto#L128} /// // clang-format on @@ -1253,8 +1318,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.Backup]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L926} - /// [google.cloud.redis.cluster.v1.ExportBackupRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L599} + /// [google.cloud.redis.cluster.v1.Backup]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L976} + /// [google.cloud.redis.cluster.v1.ExportBackupRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L629} /// // clang-format on future> ExportBackup( @@ -1327,8 +1392,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.BackupClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L615} - /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L634} + /// [google.cloud.redis.cluster.v1.BackupClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L645} + /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L664} /// // clang-format on future> BackupCluster( @@ -1389,8 +1454,8 @@ class CloudRedisClusterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.redis.cluster.v1.BackupClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L615} - /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L634} + /// [google.cloud.redis.cluster.v1.BackupClusterRequest]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L645} + /// [google.cloud.redis.cluster.v1.Cluster]: @googleapis_reference_link{google/cloud/redis/cluster/v1/cloud_redis_cluster.proto#L664} /// // clang-format on future> BackupCluster( @@ -1715,7 +1780,7 @@ class CloudRedisClusterClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1754,7 +1819,7 @@ class CloudRedisClusterClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection.cc b/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection.cc index 38ae1c2148daf..e69d7442a485a 100644 --- a/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection.cc +++ b/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection.cc @@ -129,6 +129,13 @@ CloudRedisClusterConnection::GetClusterCertificateAuthority( return Status(StatusCode::kUnimplemented, "not implemented"); } +StatusOr +CloudRedisClusterConnection::GetSharedRegionalCertificateAuthority( + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + future> CloudRedisClusterConnection::RescheduleClusterMaintenance( google::cloud::redis::cluster::v1:: diff --git a/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection.h b/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection.h index 890d78c09fb57..f4148d9b64d9d 100644 --- a/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection.h +++ b/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection.h @@ -230,6 +230,12 @@ class CloudRedisClusterConnection { google::cloud::redis::cluster::v1:: GetClusterCertificateAuthorityRequest const& request); + virtual StatusOr< + google::cloud::redis::cluster::v1::SharedRegionalCertificateAuthority> + GetSharedRegionalCertificateAuthority( + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request); + virtual future> RescheduleClusterMaintenance( google::cloud::redis::cluster::v1:: diff --git a/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection_idempotency_policy.cc b/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection_idempotency_policy.cc index 56bdcf52f9908..daad1820c555a 100644 --- a/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection_idempotency_policy.cc +++ b/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection_idempotency_policy.cc @@ -66,6 +66,13 @@ CloudRedisClusterConnectionIdempotencyPolicy::GetClusterCertificateAuthority( return Idempotency::kIdempotent; } +Idempotency CloudRedisClusterConnectionIdempotencyPolicy:: + GetSharedRegionalCertificateAuthority( + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const&) { + return Idempotency::kIdempotent; +} + Idempotency CloudRedisClusterConnectionIdempotencyPolicy::RescheduleClusterMaintenance( google::cloud::redis::cluster::v1:: diff --git a/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection_idempotency_policy.h b/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection_idempotency_policy.h index 7a9fd425c3f07..7f8fa781479ef 100644 --- a/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection_idempotency_policy.h +++ b/google/cloud/redis/cluster/v1/cloud_redis_cluster_connection_idempotency_policy.h @@ -58,6 +58,10 @@ class CloudRedisClusterConnectionIdempotencyPolicy { google::cloud::redis::cluster::v1:: GetClusterCertificateAuthorityRequest const& request); + virtual google::cloud::Idempotency GetSharedRegionalCertificateAuthority( + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request); + virtual google::cloud::Idempotency RescheduleClusterMaintenance( google::cloud::redis::cluster::v1:: RescheduleClusterMaintenanceRequest const& request); diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_auth_decorator.cc b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_auth_decorator.cc index aac5dba75a6c1..1e669cf9dd13b 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_auth_decorator.cc +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_auth_decorator.cc @@ -146,6 +146,17 @@ CloudRedisClusterAuth::GetClusterCertificateAuthority( return child_->GetClusterCertificateAuthority(context, options, request); } +StatusOr +CloudRedisClusterAuth::GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetSharedRegionalCertificateAuthority(context, options, + request); +} + future> CloudRedisClusterAuth::AsyncRescheduleClusterMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_auth_decorator.h b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_auth_decorator.h index 1a1565cfc6ad3..57b065bfa9eef 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_auth_decorator.h +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_auth_decorator.h @@ -94,6 +94,13 @@ class CloudRedisClusterAuth : public CloudRedisClusterStub { google::cloud::redis::cluster::v1:: GetClusterCertificateAuthorityRequest const& request) override; + StatusOr< + google::cloud::redis::cluster::v1::SharedRegionalCertificateAuthority> + GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> AsyncRescheduleClusterMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_connection_impl.cc b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_connection_impl.cc index b93057c398b3c..c7bbe30cad782 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_connection_impl.cc +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_connection_impl.cc @@ -408,6 +408,24 @@ CloudRedisClusterConnectionImpl::GetClusterCertificateAuthority( *current, request, __func__); } +StatusOr +CloudRedisClusterConnectionImpl::GetSharedRegionalCertificateAuthority( + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetSharedRegionalCertificateAuthority( + request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + return stub_->GetSharedRegionalCertificateAuthority(context, options, + request); + }, + *current, request, __func__); +} + future> CloudRedisClusterConnectionImpl::RescheduleClusterMaintenance( google::cloud::redis::cluster::v1:: diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_connection_impl.h b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_connection_impl.h index 6f999987a375f..fc4bcccb9937b 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_connection_impl.h +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_connection_impl.h @@ -100,6 +100,12 @@ class CloudRedisClusterConnectionImpl google::cloud::redis::cluster::v1:: GetClusterCertificateAuthorityRequest const& request) override; + StatusOr< + google::cloud::redis::cluster::v1::SharedRegionalCertificateAuthority> + GetSharedRegionalCertificateAuthority( + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> RescheduleClusterMaintenance( google::cloud::redis::cluster::v1:: diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_logging_decorator.cc b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_logging_decorator.cc index b6453e74c0863..1a7e9719f8978 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_logging_decorator.cc +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_logging_decorator.cc @@ -175,6 +175,21 @@ CloudRedisClusterLogging::GetClusterCertificateAuthority( context, options, request, __func__, tracing_options_); } +StatusOr +CloudRedisClusterLogging::GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + return child_->GetSharedRegionalCertificateAuthority(context, options, + request); + }, + context, options, request, __func__, tracing_options_); +} + future> CloudRedisClusterLogging::AsyncRescheduleClusterMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_logging_decorator.h b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_logging_decorator.h index f365739d2ee17..572756db96491 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_logging_decorator.h +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_logging_decorator.h @@ -94,6 +94,13 @@ class CloudRedisClusterLogging : public CloudRedisClusterStub { google::cloud::redis::cluster::v1:: GetClusterCertificateAuthorityRequest const& request) override; + StatusOr< + google::cloud::redis::cluster::v1::SharedRegionalCertificateAuthority> + GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> AsyncRescheduleClusterMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_metadata_decorator.cc b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_metadata_decorator.cc index b8ea420c1fab3..1e0978632d375 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_metadata_decorator.cc +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_metadata_decorator.cc @@ -141,6 +141,17 @@ CloudRedisClusterMetadata::GetClusterCertificateAuthority( return child_->GetClusterCertificateAuthority(context, options, request); } +StatusOr +CloudRedisClusterMetadata::GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetSharedRegionalCertificateAuthority(context, options, + request); +} + future> CloudRedisClusterMetadata::AsyncRescheduleClusterMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_metadata_decorator.h b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_metadata_decorator.h index 59493d1e19eab..cffe913735af6 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_metadata_decorator.h +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_metadata_decorator.h @@ -95,6 +95,13 @@ class CloudRedisClusterMetadata : public CloudRedisClusterStub { google::cloud::redis::cluster::v1:: GetClusterCertificateAuthorityRequest const& request) override; + StatusOr< + google::cloud::redis::cluster::v1::SharedRegionalCertificateAuthority> + GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> AsyncRescheduleClusterMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub.cc b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub.cc index f0bbaef810cc3..52a19ac992e10 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub.cc +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub.cc @@ -165,6 +165,21 @@ DefaultCloudRedisClusterStub::GetClusterCertificateAuthority( return response; } +StatusOr +DefaultCloudRedisClusterStub::GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const&, + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + google::cloud::redis::cluster::v1::SharedRegionalCertificateAuthority + response; + auto status = grpc_stub_->GetSharedRegionalCertificateAuthority( + &context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + future> DefaultCloudRedisClusterStub::AsyncRescheduleClusterMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub.h b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub.h index e116853abd725..861dcb2ea5cce 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub.h +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_stub.h @@ -93,6 +93,13 @@ class CloudRedisClusterStub { google::cloud::redis::cluster::v1:: GetClusterCertificateAuthorityRequest const& request) = 0; + virtual StatusOr< + google::cloud::redis::cluster::v1::SharedRegionalCertificateAuthority> + GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) = 0; + virtual future> AsyncRescheduleClusterMaintenance( google::cloud::CompletionQueue& cq, @@ -268,6 +275,13 @@ class DefaultCloudRedisClusterStub : public CloudRedisClusterStub { google::cloud::redis::cluster::v1:: GetClusterCertificateAuthorityRequest const& request) override; + StatusOr< + google::cloud::redis::cluster::v1::SharedRegionalCertificateAuthority> + GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> AsyncRescheduleClusterMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_connection.cc b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_connection.cc index 212fba3d582c7..81032045015a1 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_connection.cc +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_connection.cc @@ -148,6 +148,18 @@ CloudRedisClusterTracingConnection::GetClusterCertificateAuthority( child_->GetClusterCertificateAuthority(request)); } +StatusOr +CloudRedisClusterTracingConnection::GetSharedRegionalCertificateAuthority( + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + auto span = internal::MakeSpan( + "redis_cluster_v1::CloudRedisClusterConnection::" + "GetSharedRegionalCertificateAuthority"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan( + *span, child_->GetSharedRegionalCertificateAuthority(request)); +} + future> CloudRedisClusterTracingConnection::RescheduleClusterMaintenance( google::cloud::redis::cluster::v1:: diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_connection.h b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_connection.h index 7c2061144db32..5fbb9b79c1109 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_connection.h +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_connection.h @@ -86,6 +86,12 @@ class CloudRedisClusterTracingConnection google::cloud::redis::cluster::v1:: GetClusterCertificateAuthorityRequest const& request) override; + StatusOr< + google::cloud::redis::cluster::v1::SharedRegionalCertificateAuthority> + GetSharedRegionalCertificateAuthority( + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> RescheduleClusterMaintenance( google::cloud::redis::cluster::v1:: diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_stub.cc b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_stub.cc index bcbcfd83932da..d48b1f71fb3ca 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_stub.cc +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_stub.cc @@ -150,6 +150,21 @@ CloudRedisClusterTracingStub::GetClusterCertificateAuthority( child_->GetClusterCertificateAuthority(context, options, request)); } +StatusOr +CloudRedisClusterTracingStub::GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.redis.cluster.v1.CloudRedisCluster", + "GetSharedRegionalCertificateAuthority"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->GetSharedRegionalCertificateAuthority(context, options, request)); +} + future> CloudRedisClusterTracingStub::AsyncRescheduleClusterMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_stub.h b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_stub.h index fe6597df2806c..3e115bffb65d4 100644 --- a/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_stub.h +++ b/google/cloud/redis/cluster/v1/internal/cloud_redis_cluster_tracing_stub.h @@ -92,6 +92,13 @@ class CloudRedisClusterTracingStub : public CloudRedisClusterStub { google::cloud::redis::cluster::v1:: GetClusterCertificateAuthorityRequest const& request) override; + StatusOr< + google::cloud::redis::cluster::v1::SharedRegionalCertificateAuthority> + GetSharedRegionalCertificateAuthority( + grpc::ClientContext& context, Options const& options, + google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request) override; + future> AsyncRescheduleClusterMaintenance( google::cloud::CompletionQueue& cq, diff --git a/google/cloud/redis/cluster/v1/mocks/mock_cloud_redis_cluster_connection.h b/google/cloud/redis/cluster/v1/mocks/mock_cloud_redis_cluster_connection.h index 7de5bb9edc289..cfe0a06b562c5 100644 --- a/google/cloud/redis/cluster/v1/mocks/mock_cloud_redis_cluster_connection.h +++ b/google/cloud/redis/cluster/v1/mocks/mock_cloud_redis_cluster_connection.h @@ -178,6 +178,13 @@ class MockCloudRedisClusterConnection GetClusterCertificateAuthorityRequest const& request), (override)); + MOCK_METHOD(StatusOr, + GetSharedRegionalCertificateAuthority, + (google::cloud::redis::cluster::v1:: + GetSharedRegionalCertificateAuthorityRequest const& request), + (override)); + /// To disambiguate calls, use: /// /// @code diff --git a/google/cloud/redis/quickstart/.bazelversion b/google/cloud/redis/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/redis/quickstart/.bazelversion +++ b/google/cloud/redis/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/redis/quickstart/WORKSPACE.bazel b/google/cloud/redis/quickstart/WORKSPACE.bazel index 587be37254da2..277040ed975c0 100644 --- a/google/cloud/redis/quickstart/WORKSPACE.bazel +++ b/google/cloud/redis/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/redis/v1/cloud_redis_client.h b/google/cloud/redis/v1/cloud_redis_client.h index 956bcc79c7ea8..973a8ec9040cd 100644 --- a/google/cloud/redis/v1/cloud_redis_client.h +++ b/google/cloud/redis/v1/cloud_redis_client.h @@ -1631,7 +1631,7 @@ class CloudRedisClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1670,7 +1670,7 @@ class CloudRedisClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/resourcemanager/quickstart/.bazelversion b/google/cloud/resourcemanager/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/resourcemanager/quickstart/.bazelversion +++ b/google/cloud/resourcemanager/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/resourcemanager/quickstart/WORKSPACE.bazel b/google/cloud/resourcemanager/quickstart/WORKSPACE.bazel index dcbe032d4f767..c491663ee78b4 100644 --- a/google/cloud/resourcemanager/quickstart/WORKSPACE.bazel +++ b/google/cloud/resourcemanager/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/retail/quickstart/.bazelversion b/google/cloud/retail/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/retail/quickstart/.bazelversion +++ b/google/cloud/retail/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/retail/quickstart/WORKSPACE.bazel b/google/cloud/retail/quickstart/WORKSPACE.bazel index 62554acf25303..1edd1936cea5d 100644 --- a/google/cloud/retail/quickstart/WORKSPACE.bazel +++ b/google/cloud/retail/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/run/quickstart/.bazelversion b/google/cloud/run/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/run/quickstart/.bazelversion +++ b/google/cloud/run/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/run/quickstart/WORKSPACE.bazel b/google/cloud/run/quickstart/WORKSPACE.bazel index 9829486a879ce..373bc95ac6088 100644 --- a/google/cloud/run/quickstart/WORKSPACE.bazel +++ b/google/cloud/run/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/scheduler/quickstart/.bazelversion b/google/cloud/scheduler/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/scheduler/quickstart/.bazelversion +++ b/google/cloud/scheduler/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/scheduler/quickstart/WORKSPACE.bazel b/google/cloud/scheduler/quickstart/WORKSPACE.bazel index 512d591a6bf66..5c40eea7b7af3 100644 --- a/google/cloud/scheduler/quickstart/WORKSPACE.bazel +++ b/google/cloud/scheduler/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/secretmanager/quickstart/.bazelversion b/google/cloud/secretmanager/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/secretmanager/quickstart/.bazelversion +++ b/google/cloud/secretmanager/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/secretmanager/quickstart/WORKSPACE.bazel b/google/cloud/secretmanager/quickstart/WORKSPACE.bazel index 80d05ab1c9b18..c36868fc4ceb1 100644 --- a/google/cloud/secretmanager/quickstart/WORKSPACE.bazel +++ b/google/cloud/secretmanager/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/securesourcemanager/quickstart/.bazelversion b/google/cloud/securesourcemanager/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/securesourcemanager/quickstart/.bazelversion +++ b/google/cloud/securesourcemanager/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/securesourcemanager/quickstart/WORKSPACE.bazel b/google/cloud/securesourcemanager/quickstart/WORKSPACE.bazel index 21cc1c39e8364..64495cfe9fe47 100644 --- a/google/cloud/securesourcemanager/quickstart/WORKSPACE.bazel +++ b/google/cloud/securesourcemanager/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/securesourcemanager/v1/secure_source_manager_client.h b/google/cloud/securesourcemanager/v1/secure_source_manager_client.h index 4bfc19fe73fed..42b72f1cc36c3 100644 --- a/google/cloud/securesourcemanager/v1/secure_source_manager_client.h +++ b/google/cloud/securesourcemanager/v1/secure_source_manager_client.h @@ -119,8 +119,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Instance]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L672} - /// [google.cloud.securesourcemanager.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1453} + /// [google.cloud.securesourcemanager.v1.Instance]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L673} + /// [google.cloud.securesourcemanager.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1498} /// // clang-format on StreamRange ListInstances( @@ -158,8 +158,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Instance]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L672} - /// [google.cloud.securesourcemanager.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1453} + /// [google.cloud.securesourcemanager.v1.Instance]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L673} + /// [google.cloud.securesourcemanager.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1498} /// // clang-format on StreamRange ListInstances( @@ -184,8 +184,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1488} - /// [google.cloud.securesourcemanager.v1.Instance]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L672} + /// [google.cloud.securesourcemanager.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1533} + /// [google.cloud.securesourcemanager.v1.Instance]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L673} /// // clang-format on StatusOr GetInstance( @@ -214,8 +214,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1488} - /// [google.cloud.securesourcemanager.v1.Instance]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L672} + /// [google.cloud.securesourcemanager.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1533} + /// [google.cloud.securesourcemanager.v1.Instance]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L673} /// // clang-format on StatusOr GetInstance( @@ -249,8 +249,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CreateInstanceRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1499} - /// [google.cloud.securesourcemanager.v1.Instance]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L672} + /// [google.cloud.securesourcemanager.v1.CreateInstanceRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1544} + /// [google.cloud.securesourcemanager.v1.Instance]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L673} /// // clang-format on future> @@ -305,8 +305,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CreateInstanceRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1499} - /// [google.cloud.securesourcemanager.v1.Instance]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L672} + /// [google.cloud.securesourcemanager.v1.CreateInstanceRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1544} + /// [google.cloud.securesourcemanager.v1.Instance]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L673} /// // clang-format on future> @@ -370,8 +370,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeleteInstanceRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1531} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeleteInstanceRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1579} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -421,8 +421,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeleteInstanceRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1531} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeleteInstanceRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1579} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -491,8 +491,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.ListRepositoriesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1587} - /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L835} + /// [google.cloud.securesourcemanager.v1.ListRepositoriesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1641} + /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L863} /// // clang-format on StreamRange @@ -533,8 +533,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.ListRepositoriesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1587} - /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L835} + /// [google.cloud.securesourcemanager.v1.ListRepositoriesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1641} + /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L863} /// // clang-format on StreamRange @@ -562,8 +562,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1629} - /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L835} + /// [google.cloud.securesourcemanager.v1.GetRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1683} + /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L863} /// // clang-format on StatusOr GetRepository( @@ -592,8 +592,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1629} - /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L835} + /// [google.cloud.securesourcemanager.v1.GetRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1683} + /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L863} /// // clang-format on StatusOr GetRepository( @@ -634,8 +634,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CreateRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1642} - /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L835} + /// [google.cloud.securesourcemanager.v1.CreateRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1696} + /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L863} /// // clang-format on future> @@ -693,8 +693,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CreateRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1642} - /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L835} + /// [google.cloud.securesourcemanager.v1.CreateRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1696} + /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L863} /// // clang-format on future> @@ -763,8 +763,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L835} - /// [google.cloud.securesourcemanager.v1.UpdateRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1662} + /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L863} + /// [google.cloud.securesourcemanager.v1.UpdateRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1716} /// // clang-format on future> @@ -818,8 +818,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L835} - /// [google.cloud.securesourcemanager.v1.UpdateRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1662} + /// [google.cloud.securesourcemanager.v1.Repository]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L863} + /// [google.cloud.securesourcemanager.v1.UpdateRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1716} /// // clang-format on future> @@ -885,8 +885,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeleteRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1680} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeleteRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1734} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -936,8 +936,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeleteRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1680} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeleteRepositoryRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1734} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -1003,8 +1003,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1039} - /// [google.cloud.securesourcemanager.v1.ListHooksRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1697} + /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1070} + /// [google.cloud.securesourcemanager.v1.ListHooksRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1751} /// // clang-format on StreamRange ListHooks( @@ -1042,8 +1042,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1039} - /// [google.cloud.securesourcemanager.v1.ListHooksRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1697} + /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1070} + /// [google.cloud.securesourcemanager.v1.ListHooksRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1751} /// // clang-format on StreamRange ListHooks( @@ -1070,8 +1070,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1724} - /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1039} + /// [google.cloud.securesourcemanager.v1.GetHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1778} + /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1070} /// // clang-format on StatusOr GetHook( @@ -1100,8 +1100,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1724} - /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1039} + /// [google.cloud.securesourcemanager.v1.GetHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1778} + /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1070} /// // clang-format on StatusOr GetHook( @@ -1140,8 +1140,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CreateHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1737} - /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1039} + /// [google.cloud.securesourcemanager.v1.CreateHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1791} + /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1070} /// // clang-format on future> CreateHook( @@ -1195,8 +1195,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CreateHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1737} - /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1039} + /// [google.cloud.securesourcemanager.v1.CreateHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1791} + /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1070} /// // clang-format on future> CreateHook( @@ -1236,7 +1236,7 @@ class SecureSourceManagerClient { /// Updates the metadata of a hook. /// /// @param hook Required. The hook being updated. - /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the /// hook 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. @@ -1261,8 +1261,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1039} - /// [google.cloud.securesourcemanager.v1.UpdateHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1759} + /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1070} + /// [google.cloud.securesourcemanager.v1.UpdateHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1813} /// // clang-format on future> UpdateHook( @@ -1314,8 +1314,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1039} - /// [google.cloud.securesourcemanager.v1.UpdateHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1759} + /// [google.cloud.securesourcemanager.v1.Hook]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1070} + /// [google.cloud.securesourcemanager.v1.UpdateHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1813} /// // clang-format on future> UpdateHook( @@ -1377,8 +1377,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeleteHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1773} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeleteHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1827} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -1429,8 +1429,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeleteHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1773} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeleteHookRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1827} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -1665,8 +1665,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1100} - /// [google.cloud.securesourcemanager.v1.CreateBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1799} + /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1134} + /// [google.cloud.securesourcemanager.v1.CreateBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1853} /// // clang-format on future> @@ -1721,8 +1721,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1100} - /// [google.cloud.securesourcemanager.v1.CreateBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1799} + /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1134} + /// [google.cloud.securesourcemanager.v1.CreateBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1853} /// // clang-format on future> @@ -1788,8 +1788,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1100} - /// [google.cloud.securesourcemanager.v1.ListBranchRulesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1813} + /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1134} + /// [google.cloud.securesourcemanager.v1.ListBranchRulesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1867} /// // clang-format on StreamRange @@ -1827,8 +1827,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1100} - /// [google.cloud.securesourcemanager.v1.ListBranchRulesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1813} + /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1134} + /// [google.cloud.securesourcemanager.v1.ListBranchRulesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1867} /// // clang-format on StreamRange @@ -1856,8 +1856,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1100} - /// [google.cloud.securesourcemanager.v1.GetBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1786} + /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1134} + /// [google.cloud.securesourcemanager.v1.GetBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1840} /// // clang-format on StatusOr GetBranchRule( @@ -1886,8 +1886,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1100} - /// [google.cloud.securesourcemanager.v1.GetBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1786} + /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1134} + /// [google.cloud.securesourcemanager.v1.GetBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1840} /// // clang-format on StatusOr GetBranchRule( @@ -1900,7 +1900,7 @@ class SecureSourceManagerClient { /// UpdateBranchRule updates a branch rule. /// /// @param branch_rule - /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the /// branchRule 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. @@ -1925,8 +1925,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1100} - /// [google.cloud.securesourcemanager.v1.UpdateBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1841} + /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1134} + /// [google.cloud.securesourcemanager.v1.UpdateBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1898} /// // clang-format on future> @@ -1980,8 +1980,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1100} - /// [google.cloud.securesourcemanager.v1.UpdateBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1841} + /// [google.cloud.securesourcemanager.v1.BranchRule]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1134} + /// [google.cloud.securesourcemanager.v1.UpdateBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1898} /// // clang-format on future> @@ -2045,8 +2045,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeleteBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1827} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeleteBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1884} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -2096,8 +2096,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeleteBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1827} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeleteBranchRuleRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1884} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -2163,8 +2163,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CreatePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1867} - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} + /// [google.cloud.securesourcemanager.v1.CreatePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1924} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} /// // clang-format on future> @@ -2219,8 +2219,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CreatePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1867} - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} + /// [google.cloud.securesourcemanager.v1.CreatePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1924} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} /// // clang-format on future> @@ -2279,8 +2279,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetPullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1882} - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} + /// [google.cloud.securesourcemanager.v1.GetPullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1939} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} /// // clang-format on StatusOr GetPullRequest( @@ -2309,8 +2309,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetPullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1882} - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} + /// [google.cloud.securesourcemanager.v1.GetPullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1939} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} /// // clang-format on StatusOr GetPullRequest( @@ -2346,8 +2346,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.ListPullRequestsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1895} - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} + /// [google.cloud.securesourcemanager.v1.ListPullRequestsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1952} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} /// // clang-format on StreamRange @@ -2385,8 +2385,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.ListPullRequestsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1895} - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} + /// [google.cloud.securesourcemanager.v1.ListPullRequestsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1952} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} /// // clang-format on StreamRange @@ -2424,8 +2424,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} - /// [google.cloud.securesourcemanager.v1.UpdatePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1923} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} + /// [google.cloud.securesourcemanager.v1.UpdatePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1980} /// // clang-format on future> @@ -2479,8 +2479,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} - /// [google.cloud.securesourcemanager.v1.UpdatePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1923} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} + /// [google.cloud.securesourcemanager.v1.UpdatePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1980} /// // clang-format on future> @@ -2546,8 +2546,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.MergePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1937} - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} + /// [google.cloud.securesourcemanager.v1.MergePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1994} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} /// // clang-format on future> @@ -2597,8 +2597,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.MergePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1937} - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} + /// [google.cloud.securesourcemanager.v1.MergePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1994} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} /// // clang-format on future> @@ -2664,8 +2664,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.OpenPullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1950} - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} + /// [google.cloud.securesourcemanager.v1.OpenPullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2007} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} /// // clang-format on future> @@ -2715,8 +2715,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.OpenPullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1950} - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} + /// [google.cloud.securesourcemanager.v1.OpenPullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2007} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} /// // clang-format on future> @@ -2782,8 +2782,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.ClosePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1963} - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} + /// [google.cloud.securesourcemanager.v1.ClosePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2020} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} /// // clang-format on future> @@ -2833,8 +2833,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.ClosePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1963} - /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1177} + /// [google.cloud.securesourcemanager.v1.ClosePullRequestRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2020} + /// [google.cloud.securesourcemanager.v1.PullRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1219} /// // clang-format on future> @@ -2902,8 +2902,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.FileDiff]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1244} - /// [google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1977} + /// [google.cloud.securesourcemanager.v1.FileDiff]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1289} + /// [google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2034} /// // clang-format on StreamRange @@ -2941,8 +2941,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.FileDiff]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1244} - /// [google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1977} + /// [google.cloud.securesourcemanager.v1.FileDiff]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1289} + /// [google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2034} /// // clang-format on StreamRange @@ -2983,8 +2983,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.FetchTreeRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2169} - /// [google.cloud.securesourcemanager.v1.TreeEntry]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2134} + /// [google.cloud.securesourcemanager.v1.FetchTreeRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2226} + /// [google.cloud.securesourcemanager.v1.TreeEntry]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2191} /// // clang-format on StreamRange FetchTree( @@ -3014,8 +3014,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.FetchBlobRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2206} - /// [google.cloud.securesourcemanager.v1.FetchBlobResponse]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2222} + /// [google.cloud.securesourcemanager.v1.FetchBlobRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2263} + /// [google.cloud.securesourcemanager.v1.FetchBlobResponse]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2279} /// // clang-format on StatusOr FetchBlob( @@ -3049,8 +3049,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CreateIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2007} - /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1274} + /// [google.cloud.securesourcemanager.v1.CreateIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2064} + /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1319} /// // clang-format on future> CreateIssue( @@ -3104,8 +3104,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CreateIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2007} - /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1274} + /// [google.cloud.securesourcemanager.v1.CreateIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2064} + /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1319} /// // clang-format on future> CreateIssue( @@ -3160,8 +3160,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2022} - /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1274} + /// [google.cloud.securesourcemanager.v1.GetIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2079} + /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1319} /// // clang-format on StatusOr GetIssue( @@ -3190,8 +3190,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2022} - /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1274} + /// [google.cloud.securesourcemanager.v1.GetIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2079} + /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1319} /// // clang-format on StatusOr GetIssue( @@ -3226,8 +3226,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1274} - /// [google.cloud.securesourcemanager.v1.ListIssuesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2035} + /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1319} + /// [google.cloud.securesourcemanager.v1.ListIssuesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2092} /// // clang-format on StreamRange ListIssues( @@ -3265,8 +3265,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1274} - /// [google.cloud.securesourcemanager.v1.ListIssuesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2035} + /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1319} + /// [google.cloud.securesourcemanager.v1.ListIssuesRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2092} /// // clang-format on StreamRange ListIssues( @@ -3303,8 +3303,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1274} - /// [google.cloud.securesourcemanager.v1.UpdateIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2066} + /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1319} + /// [google.cloud.securesourcemanager.v1.UpdateIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2123} /// // clang-format on future> UpdateIssue( @@ -3356,8 +3356,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1274} - /// [google.cloud.securesourcemanager.v1.UpdateIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2066} + /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1319} + /// [google.cloud.securesourcemanager.v1.UpdateIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2123} /// // clang-format on future> UpdateIssue( @@ -3419,8 +3419,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeleteIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2080} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeleteIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2137} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -3471,8 +3471,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeleteIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2080} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeleteIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2137} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -3536,8 +3536,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1274} - /// [google.cloud.securesourcemanager.v1.OpenIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2116} + /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1319} + /// [google.cloud.securesourcemanager.v1.OpenIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2173} /// // clang-format on future> OpenIssue( @@ -3588,8 +3588,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1274} - /// [google.cloud.securesourcemanager.v1.OpenIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2116} + /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1319} + /// [google.cloud.securesourcemanager.v1.OpenIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2173} /// // clang-format on future> OpenIssue( @@ -3651,8 +3651,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CloseIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2098} - /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1274} + /// [google.cloud.securesourcemanager.v1.CloseIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2155} + /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1319} /// // clang-format on future> CloseIssue( @@ -3703,8 +3703,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CloseIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2098} - /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1274} + /// [google.cloud.securesourcemanager.v1.CloseIssueRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2155} + /// [google.cloud.securesourcemanager.v1.Issue]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1319} /// // clang-format on future> CloseIssue( @@ -3759,8 +3759,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetPullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2331} - /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1349} + /// [google.cloud.securesourcemanager.v1.GetPullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2387} + /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1394} /// // clang-format on StatusOr @@ -3789,8 +3789,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetPullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2331} - /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1349} + /// [google.cloud.securesourcemanager.v1.GetPullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2387} + /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1394} /// // clang-format on StatusOr @@ -3826,8 +3826,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.ListPullRequestCommentsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2231} - /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1349} + /// [google.cloud.securesourcemanager.v1.ListPullRequestCommentsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2288} + /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1394} /// // clang-format on StreamRange @@ -3865,8 +3865,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.ListPullRequestCommentsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2231} - /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1349} + /// [google.cloud.securesourcemanager.v1.ListPullRequestCommentsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2288} + /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1394} /// // clang-format on StreamRange @@ -3907,8 +3907,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2261} - /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1349} + /// [google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2317} + /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1394} /// // clang-format on future> @@ -3969,8 +3969,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2261} - /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1349} + /// [google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2317} + /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1394} /// // clang-format on future> @@ -4036,8 +4036,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1349} - /// [google.cloud.securesourcemanager.v1.UpdatePullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2304} + /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1394} + /// [google.cloud.securesourcemanager.v1.UpdatePullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2360} /// // clang-format on future> @@ -4093,8 +4093,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1349} - /// [google.cloud.securesourcemanager.v1.UpdatePullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2304} + /// [google.cloud.securesourcemanager.v1.PullRequestComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1394} + /// [google.cloud.securesourcemanager.v1.UpdatePullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2360} /// // clang-format on future> @@ -4159,8 +4159,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeletePullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2318} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeletePullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2374} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -4210,8 +4210,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeletePullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2318} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeletePullRequestCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2374} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -4254,7 +4254,7 @@ class SecureSourceManagerClient { /// Batch creates pull request comments. This function is used to create /// multiple PullRequestComments for code review. There needs to be exactly one /// PullRequestComment of type Review, and at most 100 PullRequestComments of - /// type Code per request. The Postition of the code comments must be unique + /// type Code per request. The Position of the code comments must be unique /// within the request. /// /// @param parent Required. The pull request in which to create the pull request comments. @@ -4284,8 +4284,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2278} - /// [google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsResponse]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2298} + /// [google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2334} + /// [google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsResponse]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2354} /// // clang-format on future> @@ -4738,8 +4738,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.CreateIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2412} - /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1325} + /// [google.cloud.securesourcemanager.v1.CreateIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2468} + /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1370} /// // clang-format on future> @@ -4798,8 +4798,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2427} - /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1325} + /// [google.cloud.securesourcemanager.v1.GetIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2483} + /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1370} /// // clang-format on StatusOr @@ -4828,8 +4828,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.GetIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2427} - /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1325} + /// [google.cloud.securesourcemanager.v1.GetIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2483} + /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1370} /// // clang-format on StatusOr @@ -4866,8 +4866,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1325} - /// [google.cloud.securesourcemanager.v1.ListIssueCommentsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2440} + /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1370} + /// [google.cloud.securesourcemanager.v1.ListIssueCommentsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2496} /// // clang-format on StreamRange @@ -4905,8 +4905,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1325} - /// [google.cloud.securesourcemanager.v1.ListIssueCommentsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2440} + /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1370} + /// [google.cloud.securesourcemanager.v1.ListIssueCommentsRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2496} /// // clang-format on StreamRange @@ -4944,8 +4944,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1325} - /// [google.cloud.securesourcemanager.v1.UpdateIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2468} + /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1370} + /// [google.cloud.securesourcemanager.v1.UpdateIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2524} /// // clang-format on future> @@ -4999,8 +4999,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1325} - /// [google.cloud.securesourcemanager.v1.UpdateIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2468} + /// [google.cloud.securesourcemanager.v1.IssueComment]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1370} + /// [google.cloud.securesourcemanager.v1.UpdateIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2524} /// // clang-format on future> @@ -5066,8 +5066,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeleteIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2482} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeleteIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2538} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -5117,8 +5117,8 @@ class SecureSourceManagerClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securesourcemanager.v1.DeleteIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2482} - /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1557} + /// [google.cloud.securesourcemanager.v1.DeleteIssueCommentRequest]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L2538} + /// [google.cloud.securesourcemanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/securesourcemanager/v1/secure_source_manager.proto#L1611} /// // clang-format on future> @@ -5549,7 +5549,7 @@ class SecureSourceManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -5588,7 +5588,7 @@ class SecureSourceManagerClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/securitycenter/quickstart/.bazelversion b/google/cloud/securitycenter/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/securitycenter/quickstart/.bazelversion +++ b/google/cloud/securitycenter/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/securitycenter/quickstart/WORKSPACE.bazel b/google/cloud/securitycenter/quickstart/WORKSPACE.bazel index 386f00abb504b..0fce6b0ef9d83 100644 --- a/google/cloud/securitycenter/quickstart/WORKSPACE.bazel +++ b/google/cloud/securitycenter/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/securitycenter/v1/security_center_client.h b/google/cloud/securitycenter/v1/security_center_client.h index df5ec15dc5ea2..6440931b97db7 100644 --- a/google/cloud/securitycenter/v1/security_center_client.h +++ b/google/cloud/securitycenter/v1/security_center_client.h @@ -374,7 +374,7 @@ class SecurityCenterClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.securitycenter.v1.CreateFindingRequest]: @googleapis_reference_link{google/cloud/securitycenter/v1/securitycenter_service.proto#L1151} - /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L68} + /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L70} /// // clang-format on StatusOr CreateFinding( @@ -407,7 +407,7 @@ class SecurityCenterClient { /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status /// [google.cloud.securitycenter.v1.CreateFindingRequest]: @googleapis_reference_link{google/cloud/securitycenter/v1/securitycenter_service.proto#L1151} - /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L68} + /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L70} /// // clang-format on StatusOr CreateFinding( @@ -2272,7 +2272,7 @@ class SecurityCenterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L68} + /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L70} /// [google.cloud.securitycenter.v1.SetFindingStateRequest]: @googleapis_reference_link{google/cloud/securitycenter/v1/securitycenter_service.proto#L2643} /// // clang-format on @@ -2304,7 +2304,7 @@ class SecurityCenterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L68} + /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L70} /// [google.cloud.securitycenter.v1.SetFindingStateRequest]: @googleapis_reference_link{google/cloud/securitycenter/v1/securitycenter_service.proto#L2643} /// // clang-format on @@ -2336,7 +2336,7 @@ class SecurityCenterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L68} + /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L70} /// [google.cloud.securitycenter.v1.SetMuteRequest]: @googleapis_reference_link{google/cloud/securitycenter/v1/securitycenter_service.proto#L2666} /// // clang-format on @@ -2367,7 +2367,7 @@ class SecurityCenterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L68} + /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L70} /// [google.cloud.securitycenter.v1.SetMuteRequest]: @googleapis_reference_link{google/cloud/securitycenter/v1/securitycenter_service.proto#L2666} /// // clang-format on @@ -2681,7 +2681,7 @@ class SecurityCenterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L68} + /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L70} /// [google.cloud.securitycenter.v1.UpdateFindingRequest]: @googleapis_reference_link{google/cloud/securitycenter/v1/securitycenter_service.proto#L2765} /// // clang-format on @@ -2713,7 +2713,7 @@ class SecurityCenterClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L68} + /// [google.cloud.securitycenter.v1.Finding]: @googleapis_reference_link{google/cloud/securitycenter/v1/finding.proto#L70} /// [google.cloud.securitycenter.v1.UpdateFindingRequest]: @googleapis_reference_link{google/cloud/securitycenter/v1/securitycenter_service.proto#L2765} /// // clang-format on @@ -4743,7 +4743,7 @@ class SecurityCenterClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -4782,7 +4782,7 @@ class SecurityCenterClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/securitycenter/v2/security_center_client.h b/google/cloud/securitycenter/v2/security_center_client.h index 98b79b2f6f0d4..42084ed9268a7 100644 --- a/google/cloud/securitycenter/v2/security_center_client.h +++ b/google/cloud/securitycenter/v2/security_center_client.h @@ -3176,7 +3176,7 @@ class SecurityCenterClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -3215,7 +3215,7 @@ class SecurityCenterClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/securitycentermanagement/quickstart/.bazelversion b/google/cloud/securitycentermanagement/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/securitycentermanagement/quickstart/.bazelversion +++ b/google/cloud/securitycentermanagement/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/securitycentermanagement/quickstart/WORKSPACE.bazel b/google/cloud/securitycentermanagement/quickstart/WORKSPACE.bazel index 7300300c3ce7b..7ecdd6e9a9fb4 100644 --- a/google/cloud/securitycentermanagement/quickstart/WORKSPACE.bazel +++ b/google/cloud/securitycentermanagement/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/servicecontrol/quickstart/.bazelversion b/google/cloud/servicecontrol/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/servicecontrol/quickstart/.bazelversion +++ b/google/cloud/servicecontrol/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/servicecontrol/quickstart/WORKSPACE.bazel b/google/cloud/servicecontrol/quickstart/WORKSPACE.bazel index f91f7800ab6c7..2b0ffe289ab13 100644 --- a/google/cloud/servicecontrol/quickstart/WORKSPACE.bazel +++ b/google/cloud/servicecontrol/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/servicedirectory/quickstart/.bazelversion b/google/cloud/servicedirectory/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/servicedirectory/quickstart/.bazelversion +++ b/google/cloud/servicedirectory/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/servicedirectory/quickstart/WORKSPACE.bazel b/google/cloud/servicedirectory/quickstart/WORKSPACE.bazel index 91321f25d1e65..664e8ebfa65bf 100644 --- a/google/cloud/servicedirectory/quickstart/WORKSPACE.bazel +++ b/google/cloud/servicedirectory/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/servicehealth/quickstart/.bazelversion b/google/cloud/servicehealth/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/servicehealth/quickstart/.bazelversion +++ b/google/cloud/servicehealth/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/servicehealth/quickstart/WORKSPACE.bazel b/google/cloud/servicehealth/quickstart/WORKSPACE.bazel index f2f2bcf37594b..d0d0b23f31d32 100644 --- a/google/cloud/servicehealth/quickstart/WORKSPACE.bazel +++ b/google/cloud/servicehealth/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/servicemanagement/quickstart/.bazelversion b/google/cloud/servicemanagement/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/servicemanagement/quickstart/.bazelversion +++ b/google/cloud/servicemanagement/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/servicemanagement/quickstart/WORKSPACE.bazel b/google/cloud/servicemanagement/quickstart/WORKSPACE.bazel index b571cf37ce122..eac98bbaad907 100644 --- a/google/cloud/servicemanagement/quickstart/WORKSPACE.bazel +++ b/google/cloud/servicemanagement/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/serviceusage/quickstart/.bazelversion b/google/cloud/serviceusage/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/serviceusage/quickstart/.bazelversion +++ b/google/cloud/serviceusage/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/serviceusage/quickstart/WORKSPACE.bazel b/google/cloud/serviceusage/quickstart/WORKSPACE.bazel index 1e62b8c02b91c..967635f261355 100644 --- a/google/cloud/serviceusage/quickstart/WORKSPACE.bazel +++ b/google/cloud/serviceusage/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/shell/quickstart/.bazelversion b/google/cloud/shell/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/shell/quickstart/.bazelversion +++ b/google/cloud/shell/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/shell/quickstart/WORKSPACE.bazel b/google/cloud/shell/quickstart/WORKSPACE.bazel index 1cd510cfb18cb..2ff74c2066f0a 100644 --- a/google/cloud/shell/quickstart/WORKSPACE.bazel +++ b/google/cloud/shell/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/spanner/admin/database_admin_client.h b/google/cloud/spanner/admin/database_admin_client.h index f0d15993bb016..1d207599ac710 100644 --- a/google/cloud/spanner/admin/database_admin_client.h +++ b/google/cloud/spanner/admin/database_admin_client.h @@ -2713,7 +2713,7 @@ class DatabaseAdminClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2752,7 +2752,7 @@ class DatabaseAdminClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/spanner/admin/instance_admin_client.h b/google/cloud/spanner/admin/instance_admin_client.h index 553e5312d4e8c..2302c1e84c71a 100644 --- a/google/cloud/spanner/admin/instance_admin_client.h +++ b/google/cloud/spanner/admin/instance_admin_client.h @@ -2790,7 +2790,7 @@ class InstanceAdminClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2829,7 +2829,7 @@ class InstanceAdminClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/spanner/options.h b/google/cloud/spanner/options.h index 71ff33fcc68b0..f749c73914da3 100644 --- a/google/cloud/spanner/options.h +++ b/google/cloud/spanner/options.h @@ -430,6 +430,15 @@ struct TransactionIsolationLevelOption { using Type = spanner::Transaction::IsolationLevel; }; +/** + * Option for `google::cloud::Options` to set the transaction read lock mode. + * + * @ingroup google-cloud-spanner-options + */ +struct TransactionReadLockModeOption { + using Type = spanner::Transaction::ReadLockMode; +}; + /** * Option for `google::cloud::Options` to return additional statistics * about the committed transaction in a `spanner::CommitResult`. diff --git a/google/cloud/spanner/quickstart/.bazelversion b/google/cloud/spanner/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/spanner/quickstart/.bazelversion +++ b/google/cloud/spanner/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/spanner/quickstart/MODULE.bazel b/google/cloud/spanner/quickstart/MODULE.bazel index 769db68723a0d..e47bfb6fa8af0 100644 --- a/google/cloud/spanner/quickstart/MODULE.bazel +++ b/google/cloud/spanner/quickstart/MODULE.bazel @@ -17,4 +17,4 @@ module( version = "0.0.0", ) -bazel_dep(name = "google_cloud_cpp", version = "3.1.0") +bazel_dep(name = "google_cloud_cpp", version = "3.2.0") diff --git a/google/cloud/spanner/quickstart/WORKSPACE.bazel b/google/cloud/spanner/quickstart/WORKSPACE.bazel index a37dd50df9ec5..e105d5e2f3971 100644 --- a/google/cloud/spanner/quickstart/WORKSPACE.bazel +++ b/google/cloud/spanner/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/spanner/samples/samples.cc b/google/cloud/spanner/samples/samples.cc index 50fedd8ec1f0c..e3abff8e3cc04 100644 --- a/google/cloud/spanner/samples/samples.cc +++ b/google/cloud/spanner/samples/samples.cc @@ -3539,6 +3539,71 @@ void IsolationLevelSettingCommand(std::vector argv) { IsolationLevelSetting(argv[0], argv[1], argv[2]); } +//! [START spanner_read_lock_mode] +void ReadLockModeSetting(std::string const& project_id, + std::string const& instance_id, + std::string const& database_id) { + namespace spanner = ::google::cloud::spanner; + using ::google::cloud::Options; + using ::google::cloud::StatusOr; + + auto db = spanner::Database(project_id, instance_id, database_id); + + // The read lock mode specified at the client-level will be applied + // to all RW transactions. + auto options = Options{}.set( + spanner::Transaction::ReadLockMode::kOptimistic); + auto client = spanner::Client(spanner::MakeConnection(db, options)); + + auto commit = client.Commit( + [&client]( + spanner::Transaction const& txn) -> StatusOr { + // Read an AlbumTitle. + auto sql = spanner::SqlStatement( + "SELECT AlbumTitle from Albums WHERE SingerId = @SingerId and " + "AlbumId = @AlbumId", + {{"SingerId", spanner::Value(2)}, {"AlbumId", spanner::Value(1)}}); + auto rows = client.ExecuteQuery(txn, std::move(sql)); + for (auto const& row : + spanner::StreamOf>(rows)) { + if (!row) return row.status(); + std::cout << "Current Album Title: " << std::get<0>(*row) << "\n"; + } + + // Update the title. + auto update_sql = spanner::SqlStatement( + "UPDATE Albums " + "SET AlbumTitle = @AlbumTitle " + "WHERE SingerId = @SingerId and AlbumId = @AlbumId", + {{"AlbumTitle", spanner::Value("A New Title")}, + {"SingerId", spanner::Value(2)}, + {"AlbumId", spanner::Value(1)}}); + auto result = client.ExecuteDml(txn, std::move(update_sql)); + if (!result) return result.status(); + std::cout << result->RowsModified() << " record(s) updated.\n"; + + return spanner::Mutations{}; + }, + // The read lock mode specified at the transaction-level takes + // precedence over the read lock mode configured at the client-level. + // kPessimistic is used here to demonstrate overriding the client-level + // setting. + Options{}.set( + spanner::Transaction::ReadLockMode::kPessimistic)); + + if (!commit) throw std::move(commit).status(); + std::cout << "Update was successful [spanner_read_lock_mode]\n"; +} +//! [END spanner_read_lock_mode] + +void ReadLockModeSettingCommand(std::vector argv) { + if (argv.size() != 3) { + throw std::runtime_error( + "read-lock-mode-setting "); + } + ReadLockModeSetting(argv[0], argv[1], argv[2]); +} + //! [START spanner_get_commit_stats] void GetCommitStatistics(google::cloud::spanner::Client client) { namespace spanner = ::google::cloud::spanner; @@ -5258,6 +5323,7 @@ int RunOneCommand(std::vector argv) { ReadDataWithStoringIndex), make_command_entry("read-write-transaction", ReadWriteTransaction), {"isolation-level-setting", IsolationLevelSettingCommand}, + {"read-lock-mode-setting", ReadLockModeSettingCommand}, make_command_entry("get-commit-stats", GetCommitStatistics), make_command_entry("dml-standard-insert", DmlStandardInsert), make_command_entry("dml-standard-update", DmlStandardUpdate), diff --git a/google/cloud/spanner/transaction.cc b/google/cloud/spanner/transaction.cc index e4d76227fa45c..2a9b4803c11c5 100644 --- a/google/cloud/spanner/transaction.cc +++ b/google/cloud/spanner/transaction.cc @@ -93,6 +93,14 @@ google::spanner::v1::TransactionOptions MakeOpts( ProtoIsolationLevel(current.get())); } + if (opts.read_write().read_lock_mode() == + google::spanner::v1::TransactionOptions_ReadWrite_ReadLockMode:: + TransactionOptions_ReadWrite_ReadLockMode_READ_LOCK_MODE_UNSPECIFIED && + current.has()) { + opts.mutable_read_write()->set_read_lock_mode( + ProtoReadLockMode(current.get())); + } + return opts; } diff --git a/google/cloud/spanner/transaction_test.cc b/google/cloud/spanner/transaction_test.cc index b3ca3ba7cf819..11577fa494a87 100644 --- a/google/cloud/spanner/transaction_test.cc +++ b/google/cloud/spanner/transaction_test.cc @@ -217,6 +217,58 @@ TEST(Transaction, IsolationLevelNotSpecified) { }); } +TEST(Transaction, ReadLockModePrecedence) { + internal::OptionsSpan span(Options{}.set( + Transaction::ReadLockMode::kOptimistic)); + + // Case 1: Per-call overrides default options + auto opts = + Transaction::ReadWriteOptions(Transaction::ReadLockMode::kPessimistic); + Transaction txn = MakeReadWriteTransaction(opts); + spanner_internal::Visit( + txn, [](spanner_internal::SessionHolder&, + StatusOr& s, + spanner_internal::TransactionContext const&) { + EXPECT_EQ( + s->begin().read_write().read_lock_mode(), + google::spanner::v1::TransactionOptions_ReadWrite_ReadLockMode:: + TransactionOptions_ReadWrite_ReadLockMode_PESSIMISTIC); + return 0; + }); + + // Case 2: Fallback to default options + auto opts_default = Transaction::ReadWriteOptions(); + Transaction txn_default = MakeReadWriteTransaction(opts_default); + spanner_internal::Visit( + txn_default, [](spanner_internal::SessionHolder&, + StatusOr& s, + spanner_internal::TransactionContext const&) { + EXPECT_EQ( + s->begin().read_write().read_lock_mode(), + google::spanner::v1::TransactionOptions_ReadWrite_ReadLockMode:: + TransactionOptions_ReadWrite_ReadLockMode_OPTIMISTIC); + return 0; + }); +} + +TEST(Transaction, ReadLockModeNotSpecified) { + // Case: Read lock mode not specified in transaction options or default + // options + auto opts = Transaction::ReadWriteOptions(); + Transaction txn = MakeReadWriteTransaction(opts); + spanner_internal::Visit(txn, [](spanner_internal::SessionHolder&, + StatusOr< + google::spanner::v1::TransactionSelector>& + s, + spanner_internal::TransactionContext const&) { + EXPECT_EQ( + s->begin().read_write().read_lock_mode(), + google::spanner::v1::TransactionOptions_ReadWrite_ReadLockMode:: + TransactionOptions_ReadWrite_ReadLockMode_READ_LOCK_MODE_UNSPECIFIED); + return 0; + }); +} + TEST(Transaction, ReadWriteOptionsWithTag) { auto opts = Transaction::ReadWriteOptions().WithTag("test-tag"); Transaction txn = MakeReadWriteTransaction(opts); diff --git a/google/cloud/speech/quickstart/.bazelversion b/google/cloud/speech/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/speech/quickstart/.bazelversion +++ b/google/cloud/speech/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/speech/quickstart/WORKSPACE.bazel b/google/cloud/speech/quickstart/WORKSPACE.bazel index 5e5e562567de4..90e7cacd9fada 100644 --- a/google/cloud/speech/quickstart/WORKSPACE.bazel +++ b/google/cloud/speech/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/speech/v2/speech_client.h b/google/cloud/speech/v2/speech_client.h index 9b396ae673479..69c8b45ae008a 100644 --- a/google/cloud/speech/v2/speech_client.h +++ b/google/cloud/speech/v2/speech_client.h @@ -2586,7 +2586,7 @@ class SpeechClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2625,7 +2625,7 @@ class SpeechClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/sql/quickstart/.bazelversion b/google/cloud/sql/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/sql/quickstart/.bazelversion +++ b/google/cloud/sql/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/sql/quickstart/WORKSPACE.bazel b/google/cloud/sql/quickstart/WORKSPACE.bazel index b33bf06b0c048..6ee19e64b6a8a 100644 --- a/google/cloud/sql/quickstart/WORKSPACE.bazel +++ b/google/cloud/sql/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/storage/async/object_descriptor.cc b/google/cloud/storage/async/object_descriptor.cc index 3f1bbabb88a5e..cb66a50f2658c 100644 --- a/google/cloud/storage/async/object_descriptor.cc +++ b/google/cloud/storage/async/object_descriptor.cc @@ -52,6 +52,8 @@ std::pair ObjectDescriptor::ReadLast( return {AsyncReader(std::move(reader)), std::move(token)}; } +bool ObjectDescriptor::IsOpen() const { return impl_->IsOpen(); } + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage } // namespace cloud diff --git a/google/cloud/storage/async/object_descriptor.h b/google/cloud/storage/async/object_descriptor.h index c826859d7a027..545d4ba96aeea 100644 --- a/google/cloud/storage/async/object_descriptor.h +++ b/google/cloud/storage/async/object_descriptor.h @@ -76,6 +76,14 @@ class ObjectDescriptor { */ std::pair ReadLast(std::int64_t limit); + /** + * Returns true if the descriptor is open. + * + * A descriptor is open if it has not been cancelled and has not hit a + * permanent failure. + */ + bool IsOpen() const; + private: std::shared_ptr impl_; }; diff --git a/google/cloud/storage/async/object_descriptor_connection.h b/google/cloud/storage/async/object_descriptor_connection.h index f7ea1898a12bf..6d8115fb7fcd0 100644 --- a/google/cloud/storage/async/object_descriptor_connection.h +++ b/google/cloud/storage/async/object_descriptor_connection.h @@ -61,6 +61,14 @@ class ObjectDescriptorConnection { virtual std::unique_ptr Read(ReadParams p) = 0; virtual void MakeSubsequentStream() = 0; + + /** + * Returns true if the descriptor is open. + * + * A descriptor is open if it has not been cancelled and has not hit a + * permanent failure. + */ + virtual bool IsOpen() const = 0; }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/storage/async/object_descriptor_test.cc b/google/cloud/storage/async/object_descriptor_test.cc index 4fd3dd0724235..5426d194ab2fd 100644 --- a/google/cloud/storage/async/object_descriptor_test.cc +++ b/google/cloud/storage/async/object_descriptor_test.cc @@ -186,6 +186,15 @@ TEST(ObjectDescriptor, ReadExceedsMaxRange) { EXPECT_FALSE(token.valid()); } +TEST(ObjectDescriptor, IsOpen) { + auto mock = std::make_shared(); + EXPECT_CALL(*mock, IsOpen).WillOnce(Return(true)).WillOnce(Return(false)); + + auto tested = ObjectDescriptor(mock); + EXPECT_TRUE(tested.IsOpen()); + EXPECT_FALSE(tested.IsOpen()); +} + } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage diff --git a/google/cloud/storage/bucket_metadata.cc b/google/cloud/storage/bucket_metadata.cc index eb3fd410b9d65..8b55962a9b520 100644 --- a/google/cloud/storage/bucket_metadata.cc +++ b/google/cloud/storage/bucket_metadata.cc @@ -362,16 +362,16 @@ BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::ResetDefaultAcl() { BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetEncryption( BucketEncryption const& v) { internal::PatchBuilder builder; - builder.SetStringField("defaultKmsKeyName", v.default_kms_key_name); + if (v.default_kms_key_name.empty()) { + builder.RemoveField("defaultKmsKeyName"); + } else { + builder.SetStringField("defaultKmsKeyName", v.default_kms_key_name); + } auto add_config_patch = [&](char const* name, auto const& config) { if (config.restriction_mode.empty()) return; - builder.AddSubPatch( - name, internal::PatchBuilder() - .SetStringField("restrictionMode", config.restriction_mode) - .SetStringField("effectiveTime", - google::cloud::internal::FormatRfc3339( - config.effective_time))); + builder.AddSubPatch(name, internal::PatchBuilder().SetStringField( + "restrictionMode", config.restriction_mode)); }; add_config_patch("googleManagedEncryptionEnforcementConfig", v.google_managed_encryption_enforcement_config); diff --git a/google/cloud/storage/bucket_metadata_test.cc b/google/cloud/storage/bucket_metadata_test.cc index 3e8dcdc72a464..ca41bf256f1ce 100644 --- a/google/cloud/storage/bucket_metadata_test.cc +++ b/google/cloud/storage/bucket_metadata_test.cc @@ -526,23 +526,14 @@ TEST(BucketMetadataTest, ToJsonString) { EXPECT_EQ("FullyRestricted", encryption["googleManagedEncryptionEnforcementConfig"].value( "restrictionMode", "")); - EXPECT_EQ("2025-12-18T18:13:15Z", - encryption["googleManagedEncryptionEnforcementConfig"].value( - "effectiveTime", "")); EXPECT_EQ("NotRestricted", encryption["customerManagedEncryptionEnforcementConfig"].value( "restrictionMode", "")); - EXPECT_EQ("2025-12-18T18:13:15Z", - encryption["customerManagedEncryptionEnforcementConfig"].value( - "effectiveTime", "")); EXPECT_EQ("NotRestricted", encryption["customerSuppliedEncryptionEnforcementConfig"].value( "restrictionMode", "")); - EXPECT_EQ("2025-12-18T18:13:15Z", - encryption["customerSuppliedEncryptionEnforcementConfig"].value( - "effectiveTime", "")); // hierarchical_namespace() ASSERT_EQ(1, actual.count("hierarchicalNamespace")); diff --git a/google/cloud/storage/client.cc b/google/cloud/storage/client.cc index 22db63e9346b6..559d2f87fca7c 100644 --- a/google/cloud/storage/client.cc +++ b/google/cloud/storage/client.cc @@ -58,10 +58,6 @@ class WrapRestCredentials { std::shared_ptr impl) : impl_(std::move(impl)) {} - StatusOr AuthorizationHeader() { - return oauth2_internal::AuthenticationHeaderJoined(*impl_); - } - StatusOr> SignBlob( SigningAccount const& signing_account, std::string const& blob) const { return impl_->SignBlob(signing_account.value_or(impl_->AccountEmail()), diff --git a/google/cloud/storage/examples/CMakeLists.txt b/google/cloud/storage/examples/CMakeLists.txt index 38c6caf72c74e..3b69c216cd294 100644 --- a/google/cloud/storage/examples/CMakeLists.txt +++ b/google/cloud/storage/examples/CMakeLists.txt @@ -36,6 +36,7 @@ set(storage_examples storage_bucket_autoclass_samples.cc storage_bucket_cors_samples.cc storage_bucket_default_kms_key_samples.cc + storage_bucket_encryption_enforcement_samples.cc storage_bucket_iam_samples.cc storage_bucket_object_retention_samples.cc storage_bucket_requester_pays_samples.cc diff --git a/google/cloud/storage/examples/storage_bucket_encryption_enforcement_samples.cc b/google/cloud/storage/examples/storage_bucket_encryption_enforcement_samples.cc new file mode 100644 index 0000000000000..e98feb19269ab --- /dev/null +++ b/google/cloud/storage/examples/storage_bucket_encryption_enforcement_samples.cc @@ -0,0 +1,255 @@ +// Copyright 2026 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 "google/cloud/storage/client.h" +#include "google/cloud/storage/examples/storage_examples_common.h" +#include "google/cloud/internal/format_time_point.h" +#include "google/cloud/internal/getenv.h" +#include +#include +#include + +namespace { + +void GetBucketEncryptionEnforcementConfig( + google::cloud::storage::Client client, + std::vector const& argv) { + //! [get bucket encryption enforcement config] [START + //! storage_get_bucket_encryption_enforcement_config] + namespace gcs = ::google::cloud::storage; + using ::google::cloud::StatusOr; + [](gcs::Client client, std::string const& bucket_name) { + StatusOr metadata = + client.GetBucketMetadata(bucket_name); + if (!metadata) throw std::move(metadata).status(); + + std::cout << "Bucket Name: " << metadata->name() << "\n"; + + if (!metadata->has_encryption()) { + std::cout << " GMEK Enforcement: NOT SET (Default)\n" + << " CMEK Enforcement: NOT SET (Default)\n" + << " CSEK Enforcement: NOT SET (Default)\n"; + return; + } + + auto const& encryption = metadata->encryption(); + + auto format_config = [](auto const& config) { + if (config.restriction_mode.empty()) + return std::string("NOT SET (Default)"); + return "Mode: " + config.restriction_mode + ", Effective Time: " + + google::cloud::internal::FormatRfc3339(config.effective_time); + }; + + std::cout << " GMEK Enforcement: " + << format_config( + encryption.google_managed_encryption_enforcement_config) + << "\n" + << " CMEK Enforcement: " + << format_config( + encryption.customer_managed_encryption_enforcement_config) + << "\n" + << " CSEK Enforcement: " + << format_config( + encryption.customer_supplied_encryption_enforcement_config) + << "\n"; + } + //! [get bucket encryption enforcement config] [END + //! storage_get_bucket_encryption_enforcement_config] + (std::move(client), argv.at(0)); +} + +void SetBucketEncryptionEnforcementConfig( + google::cloud::storage::Client client, + std::vector const& argv) { + //! [set bucket encryption enforcement config] [START + //! storage_set_bucket_encryption_enforcement_config] + namespace gcs = ::google::cloud::storage; + using ::google::cloud::StatusOr; + [](gcs::Client client, std::string const& project_id, + std::string const& bucket_name) { + auto create_bucket = [&](std::string const& name, + gcs::BucketEncryption encryption) { + StatusOr bucket = client.CreateBucketForProject( + name, project_id, gcs::BucketMetadata().set_encryption(encryption)); + if (!bucket) throw std::move(bucket).status(); + return bucket; + }; + + // Example 1: Enforce GMEK Only + gcs::BucketEncryption gmek_encryption; + gmek_encryption.google_managed_encryption_enforcement_config + .restriction_mode = "NotRestricted"; + gmek_encryption.customer_managed_encryption_enforcement_config + .restriction_mode = "FullyRestricted"; + gmek_encryption.customer_supplied_encryption_enforcement_config + .restriction_mode = "FullyRestricted"; + std::cout << "Bucket " + << create_bucket("g-" + bucket_name, gmek_encryption)->name() + << " created with GMEK-only enforcement policy.\n"; + + // In GCS, a single project cannot create or delete buckets more often than + // once every two seconds. We pause to avoid rate limiting. + std::this_thread::sleep_for(std::chrono::seconds(2)); + + // Example 2: Enforce CMEK Only + gcs::BucketEncryption cmek_encryption; + cmek_encryption.google_managed_encryption_enforcement_config + .restriction_mode = "FullyRestricted"; + cmek_encryption.customer_managed_encryption_enforcement_config + .restriction_mode = "NotRestricted"; + cmek_encryption.customer_supplied_encryption_enforcement_config + .restriction_mode = "FullyRestricted"; + std::cout << "Bucket " + << create_bucket("c-" + bucket_name, cmek_encryption)->name() + << " created with CMEK-only enforcement policy.\n"; + + // In GCS, a single project cannot create or delete buckets more often than + // once every two seconds. We pause to avoid rate limiting. + std::this_thread::sleep_for(std::chrono::seconds(2)); + + // Example 3: Restrict CSEK (Ransomware Protection) + gcs::BucketEncryption csek_encryption; + csek_encryption.customer_supplied_encryption_enforcement_config + .restriction_mode = "FullyRestricted"; + std::cout << "Bucket " + << create_bucket("rc-" + bucket_name, csek_encryption)->name() + << " created with a policy to restrict CSEK.\n"; + } + //! [set bucket encryption enforcement config] [END + //! storage_set_bucket_encryption_enforcement_config] + (std::move(client), argv.at(0), argv.at(1)); +} + +void UpdateBucketEncryptionEnforcementConfig( + google::cloud::storage::Client client, + std::vector const& argv) { + //! [update bucket encryption enforcement config] [START + //! storage_update_bucket_encryption_enforcement_config] + namespace gcs = ::google::cloud::storage; + using ::google::cloud::StatusOr; + [](gcs::Client client, std::string const& bucket_name) { + StatusOr original = + client.GetBucketMetadata(bucket_name); + + gcs::BucketMetadata updated_metadata = *original; + gcs::BucketEncryption encryption; + if (original->has_encryption()) { + encryption = original->encryption(); + } + + // 1. Update a specific type (e.g., change GMEK to FullyRestricted) + encryption.google_managed_encryption_enforcement_config.restriction_mode = + "FullyRestricted"; + // 2. Remove a specific type (e.g., remove CMEK enforcement) + encryption.customer_managed_encryption_enforcement_config.restriction_mode = + "NotRestricted"; + // For the update, need to specify all three configs, so keeping this same + // as before + encryption.customer_supplied_encryption_enforcement_config + .restriction_mode = "FullyRestricted"; + + updated_metadata.set_encryption(encryption); + + StatusOr updated = + client.PatchBucket(bucket_name, *original, updated_metadata); + if (!updated) throw std::move(updated).status(); + + std::cout << "Encryption enforcement policy updated for bucket " + << updated->name() << "\n" + << "GMEK is now fully restricted, and CMEK enforcement has been " + "removed.\n"; + } + //! [update bucket encryption enforcement config] [END + //! storage_update_bucket_encryption_enforcement_config] + (std::move(client), argv.at(0)); +} + +void RunAll(std::vector const& argv) { + namespace examples = ::google::cloud::storage::examples; + namespace gcs = ::google::cloud::storage; + + if (!argv.empty()) throw examples::Usage{"auto"}; + examples::CheckEnvironmentVariablesAreSet({"GOOGLE_CLOUD_PROJECT"}); + auto const project_id = + google::cloud::internal::GetEnv("GOOGLE_CLOUD_PROJECT").value(); + auto generator = google::cloud::internal::DefaultPRNG(std::random_device{}()); + // Shorten bucket name to allow for prefixes without exceeding max length + auto const bucket_name = + examples::MakeRandomBucketName(generator).substr(0, 50); + auto client = gcs::Client(examples::CreateBucketOptions()); + + auto constexpr kBucketPeriod = std::chrono::seconds(2); + + // Clean up any potentially leaked buckets from a previous run before creating + // them. + (void)examples::RemoveBucketAndContents(client, "g-" + bucket_name); + if (!examples::UsingEmulator()) std::this_thread::sleep_for(kBucketPeriod); + (void)examples::RemoveBucketAndContents(client, "c-" + bucket_name); + if (!examples::UsingEmulator()) std::this_thread::sleep_for(kBucketPeriod); + (void)examples::RemoveBucketAndContents(client, "rc-" + bucket_name); + if (!examples::UsingEmulator()) std::this_thread::sleep_for(kBucketPeriod); + + std::cout << "\nRunning the SetBucketEncryptionEnforcementConfig() example" + << std::endl; + SetBucketEncryptionEnforcementConfig(client, {project_id, bucket_name}); + + std::cout + << "\nRunning the GetBucketEncryptionEnforcementConfig() example [1]" + << std::endl; + GetBucketEncryptionEnforcementConfig(client, {"c-" + bucket_name}); + + std::cout << "\nRunning the UpdateBucketEncryptionEnforcementConfig() example" + << std::endl; + UpdateBucketEncryptionEnforcementConfig(client, {"c-" + bucket_name}); + + std::cout + << "\nRunning the GetBucketEncryptionEnforcementConfig() example [2]" + << std::endl; + GetBucketEncryptionEnforcementConfig(client, {"c-" + bucket_name}); + + // In GCS a single project cannot create or delete buckets more often than + // once every two seconds. We will pause until that time before deleting the + // buckets. + auto pause = std::chrono::steady_clock::now() + kBucketPeriod; + if (!examples::UsingEmulator()) std::this_thread::sleep_until(pause); + + (void)examples::RemoveBucketAndContents(client, "g-" + bucket_name); + if (!examples::UsingEmulator()) std::this_thread::sleep_for(kBucketPeriod); + (void)examples::RemoveBucketAndContents(client, "c-" + bucket_name); + if (!examples::UsingEmulator()) std::this_thread::sleep_for(kBucketPeriod); + (void)examples::RemoveBucketAndContents(client, "rc-" + bucket_name); +} + +} // namespace + +int main(int argc, char* argv[]) { + namespace examples = ::google::cloud::storage::examples; + auto make_entry = [](std::string const& name, + std::vector arg_names, + examples::ClientCommand const& cmd) { + return examples::CreateCommandEntry(name, std::move(arg_names), cmd); + }; + examples::Example example({ + make_entry("get-bucket-encryption-enforcement-config", {""}, + GetBucketEncryptionEnforcementConfig), + make_entry("set-bucket-encryption-enforcement-config", + {"", ""}, + SetBucketEncryptionEnforcementConfig), + make_entry("update-bucket-encryption-enforcement-config", + {""}, UpdateBucketEncryptionEnforcementConfig), + {"auto", RunAll}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/storage/examples/storage_examples.bzl b/google/cloud/storage/examples/storage_examples.bzl index 5bdd0f414b534..a65855c565fdb 100644 --- a/google/cloud/storage/examples/storage_examples.bzl +++ b/google/cloud/storage/examples/storage_examples.bzl @@ -21,6 +21,7 @@ storage_examples = [ "storage_bucket_autoclass_samples.cc", "storage_bucket_cors_samples.cc", "storage_bucket_default_kms_key_samples.cc", + "storage_bucket_encryption_enforcement_samples.cc", "storage_bucket_iam_samples.cc", "storage_bucket_object_retention_samples.cc", "storage_bucket_requester_pays_samples.cc", diff --git a/google/cloud/storage/google_cloud_cpp_storage.bzl b/google/cloud/storage/google_cloud_cpp_storage.bzl index 7f244903705ab..ed40ddb04ab5f 100644 --- a/google/cloud/storage/google_cloud_cpp_storage.bzl +++ b/google/cloud/storage/google_cloud_cpp_storage.bzl @@ -116,6 +116,7 @@ google_cloud_cpp_storage_hdrs = [ "notification_metadata.h", "notification_payload_format.h", "object_access_control.h", + "object_contexts.h", "object_metadata.h", "object_read_stream.h", "object_retention.h", @@ -219,6 +220,7 @@ google_cloud_cpp_storage_srcs = [ "list_objects_reader.cc", "notification_metadata.cc", "object_access_control.cc", + "object_contexts.cc", "object_metadata.cc", "object_read_stream.cc", "object_retention.cc", diff --git a/google/cloud/storage/google_cloud_cpp_storage.cmake b/google/cloud/storage/google_cloud_cpp_storage.cmake index f24107bca2cd9..f3d70b6766817 100644 --- a/google/cloud/storage/google_cloud_cpp_storage.cmake +++ b/google/cloud/storage/google_cloud_cpp_storage.cmake @@ -197,6 +197,8 @@ add_library( notification_payload_format.h object_access_control.cc object_access_control.h + object_contexts.cc + object_contexts.h object_metadata.cc object_metadata.h object_read_stream.cc diff --git a/google/cloud/storage/internal/async/connection_impl.cc b/google/cloud/storage/internal/async/connection_impl.cc index 32ae9a4e9f0e0..409a45fbf1f35 100644 --- a/google/cloud/storage/internal/async/connection_impl.cc +++ b/google/cloud/storage/internal/async/connection_impl.cc @@ -55,6 +55,7 @@ #include "google/cloud/internal/async_streaming_read_rpc_timeout.h" #include "google/cloud/internal/async_streaming_write_rpc_timeout.h" #include "google/cloud/internal/make_status.h" +#include #include #include @@ -231,19 +232,33 @@ AsyncConnectionImpl::Open(OpenParams p) { auto pending = factory(std::move(initial_request)); using ReturnType = std::shared_ptr; - return pending.then( - [rp = std::move(resume_policy), fa = std::move(factory), - rs = std::move(p.read_spec), - options = std::move(p.options)](auto f) mutable -> StatusOr { - auto result = f.get(); - if (!result) return std::move(result).status(); - - auto impl = std::make_shared( - std::move(rp), std::move(fa), std::move(rs), - std::move(result->stream), std::move(options)); - impl->Start(std::move(result->first_response)); - return ReturnType(impl); - }); + return pending.then([rp = std::move(resume_policy), fa = std::move(factory), + rs = std::move(p.read_spec), + options = std::move(p.options), refresh = refresh_]( + auto f) mutable -> StatusOr { + auto result = f.get(); + if (!result) return std::move(result).status(); + + // The descriptor remains open if at least one gRPC channel is in a + // functional state. We consider READY, IDLE, and CONNECTING to be + // functional. TRANSIENT_FAILURE and SHUTDOWN are not included because they + // indicate a definitive loss of connectivity or terminal closure. + auto transport_ok = [refresh] { + if (!refresh) return true; + auto const& channels = refresh->channels(); + return std::any_of( + channels.begin(), channels.end(), [](auto const& channel) { + auto state = channel->GetState(false); + return state == GRPC_CHANNEL_READY || state == GRPC_CHANNEL_IDLE || + state == GRPC_CHANNEL_CONNECTING; + }); + }; + auto impl = std::make_shared( + std::move(rp), std::move(fa), std::move(rs), std::move(result->stream), + std::move(options), std::move(transport_ok)); + impl->Start(std::move(result->first_response)); + return ReturnType(impl); + }); } future>> @@ -319,9 +334,11 @@ AsyncConnectionImpl::AppendableObjectUploadImpl(AppendableUploadParams p) { auto factory = WriteResultFactory( [stub = stub_, cq = cq_, retry = std::move(retry), // NOLINTNEXTLINE(bugprone-lambda-function-name) - backoff = std::move(backoff), current, function_name = __func__]( + backoff = std::move(backoff), current, function_name = __func__, + // Use shared_ptr to propagate RoutingHeaderOptions across retries. + current_routing_options = std::make_shared()]( google::storage::v2::BidiWriteObjectRequest req) { - auto call = [stub, request = std::move(req)]( + auto call = [stub, request = std::move(req), current_routing_options]( CompletionQueue& cq, std::shared_ptr context, google::cloud::internal::ImmutableOptions options, @@ -336,9 +353,11 @@ AsyncConnectionImpl::AppendableObjectUploadImpl(AppendableUploadParams p) { // Apply the routing header if (request.has_write_object_spec()) - ApplyRoutingHeaders(*context, request.write_object_spec()); + ApplyRoutingHeaders(*context, request.write_object_spec(), + *current_routing_options); else - ApplyRoutingHeaders(*context, request.append_object_spec()); + ApplyRoutingHeaders(*context, request.append_object_spec(), + *current_routing_options); auto rpc = stub->AsyncBidiWriteObject(cq, std::move(context), std::move(options)); @@ -347,18 +366,30 @@ AsyncConnectionImpl::AppendableObjectUploadImpl(AppendableUploadParams p) { std::move(rpc)); request.set_state_lookup(true); auto open = std::make_shared(std::move(rpc), request); - return open->Call().then([open, &request](auto f) mutable { - open.reset(); - auto response = f.get(); - if (!response) { - google::rpc::Status grpc_status = - ExtractGrpcStatus(response.status()); - EnsureFirstMessageAppendObjectSpec(request, grpc_status); - ApplyWriteRedirectErrors(*request.mutable_append_object_spec(), - grpc_status); - } - return response; - }); + return open->Call().then( + [open, &request, current_routing_options](auto f) mutable { + open.reset(); + auto response = f.get(); + if (!response) { + google::rpc::Status grpc_status = + ExtractGrpcStatus(response.status()); + // Handle redirect and get info for updating routing options. + BidiWriteRedirectInfo redirect_info = + HandleBidiWriteRedirect(request, grpc_status); + + // Only update the routing token if the new info has a + // non-empty token. + // Otherwise, retain the existing token for subsequent + // retries. + if (!redirect_info.routing_token.empty() && + current_routing_options->routing_token != + redirect_info.routing_token) { + current_routing_options->routing_token = + redirect_info.routing_token; + } + } + return response; + }); }; return google::cloud::internal::AsyncRetryLoop( diff --git a/google/cloud/storage/internal/async/connection_impl_appendable_upload_test.cc b/google/cloud/storage/internal/async/connection_impl_appendable_upload_test.cc index 85ce51a10f31d..bb6833b1526a7 100644 --- a/google/cloud/storage/internal/async/connection_impl_appendable_upload_test.cc +++ b/google/cloud/storage/internal/async/connection_impl_appendable_upload_test.cc @@ -21,6 +21,8 @@ #include "google/cloud/common_options.h" #include "google/cloud/grpc_options.h" #include "google/cloud/internal/background_threads_impl.h" +#include "google/cloud/internal/status_payload_keys.h" +#include "google/cloud/status.h" #include "google/cloud/testing_util/async_sequencer.h" #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/mock_completion_queue_impl.h" @@ -70,35 +72,14 @@ std::shared_ptr MakeTestConnection( TestOptions(std::move(options))); } -// Creates a mock bidirectional stream that simulates a successful append flow. -std::unique_ptr MakeSuccessfulAppendStream( +// Creates a mock bidirectional stream with common expectations for append +// flows. +std::unique_ptr MakeCommonAppendStream( AsyncSequencer& sequencer, std::int64_t persisted_size) { auto stream = std::make_unique(); EXPECT_CALL(*stream, Start).WillOnce([&] { return sequencer.PushBack("Start"); }); - // The first write is a "state lookup" write. It should not contain a payload. - // The server responds with the current persisted size of the object. - EXPECT_CALL(*stream, Write) - .WillOnce([&](google::storage::v2::BidiWriteObjectRequest const& request, - grpc::WriteOptions wopt) { - EXPECT_TRUE(request.state_lookup()); - EXPECT_FALSE(wopt.is_last_message()); - return sequencer.PushBack("Write(StateLookup)"); - }) - // Subsequent writes carry data. - .WillOnce([&](google::storage::v2::BidiWriteObjectRequest const&, - grpc::WriteOptions wopt) { - EXPECT_FALSE(wopt.is_last_message()); - return sequencer.PushBack("Write(data)"); - }) - // The finalize write marks the end of the stream. - .WillOnce([&](google::storage::v2::BidiWriteObjectRequest const& request, - grpc::WriteOptions wopt) { - EXPECT_TRUE(request.finish_write()); - EXPECT_TRUE(wopt.is_last_message()); - return sequencer.PushBack("Write(Finalize)"); - }); // The first `Read()` call after the state lookup confirms the persisted size. EXPECT_CALL(*stream, Read) @@ -129,8 +110,111 @@ std::unique_ptr MakeSuccessfulAppendStream( EXPECT_CALL(*stream, Finish).WillOnce([&] { return sequencer.PushBack("Finish").then([](auto) { return Status{}; }); }); + return stream; +} - return std::unique_ptr(std::move(stream)); +std::unique_ptr MakeRedirectAppendStream( + AsyncSequencer& sequencer, std::int64_t persisted_size, + absl::string_view expected_handle, std::int64_t expected_generation, + absl::string_view expected_routing_token) { + auto stream = MakeCommonAppendStream(sequencer, persisted_size); + // The first write is a "state lookup" write. It should not contain a payload. + // The server responds with the current persisted size of the object. + EXPECT_CALL(*stream, Write) + .WillOnce([&sequencer, expected_handle, expected_generation, + expected_routing_token]( + google::storage::v2::BidiWriteObjectRequest const& request, + grpc::WriteOptions wopt) { + EXPECT_TRUE(request.state_lookup()); + EXPECT_FALSE(wopt.is_last_message()); + EXPECT_TRUE(request.has_append_object_spec()); + EXPECT_EQ(request.append_object_spec().write_handle().handle(), + expected_handle); + EXPECT_EQ(request.append_object_spec().generation(), + expected_generation); + EXPECT_EQ(request.append_object_spec().routing_token(), + expected_routing_token); + return sequencer.PushBack("Write(StateLookup)"); + }) + // Subsequent writes carry data. + .WillOnce([&](google::storage::v2::BidiWriteObjectRequest const&, + grpc::WriteOptions wopt) { + EXPECT_FALSE(wopt.is_last_message()); + return sequencer.PushBack("Write(data)"); + }) + // The finalize write marks the end of the stream. + .WillOnce([&](google::storage::v2::BidiWriteObjectRequest const& request, + grpc::WriteOptions wopt) { + EXPECT_TRUE(request.finish_write()); + EXPECT_TRUE(wopt.is_last_message()); + return sequencer.PushBack("Write(Finalize)"); + }); + return stream; +} + +std::unique_ptr MakeRedirectAppendStreamNoHandle( + AsyncSequencer& sequencer, std::int64_t persisted_size, + absl::string_view expected_bucket, absl::string_view expected_object_name) { + auto stream = MakeCommonAppendStream(sequencer, persisted_size); + // The first write is a "state lookup" write. It should not contain a payload. + // The server responds with the current persisted size of the object. + EXPECT_CALL(*stream, Write) + .WillOnce([&sequencer, expected_bucket, expected_object_name]( + google::storage::v2::BidiWriteObjectRequest const& request, + grpc::WriteOptions wopt) { + EXPECT_TRUE(request.state_lookup()); + EXPECT_FALSE(wopt.is_last_message()); + EXPECT_FALSE(request.has_append_object_spec()); + EXPECT_TRUE(request.has_write_object_spec()); + EXPECT_EQ(request.write_object_spec().resource().name(), + expected_object_name); + EXPECT_EQ(request.write_object_spec().resource().bucket(), + expected_bucket); + return sequencer.PushBack("Write(StateLookup)"); + }) + // Subsequent writes carry data. + .WillOnce([&](google::storage::v2::BidiWriteObjectRequest const&, + grpc::WriteOptions wopt) { + EXPECT_FALSE(wopt.is_last_message()); + return sequencer.PushBack("Write(data)"); + }) + // The finalize write marks the end of the stream. + .WillOnce([&](google::storage::v2::BidiWriteObjectRequest const& request, + grpc::WriteOptions wopt) { + EXPECT_TRUE(request.finish_write()); + EXPECT_TRUE(wopt.is_last_message()); + return sequencer.PushBack("Write(Finalize)"); + }); + return stream; +} + +// Creates a mock bidirectional stream that simulates a successful append flow. +std::unique_ptr MakeSuccessfulAppendStream( + AsyncSequencer& sequencer, std::int64_t persisted_size) { + auto stream = MakeCommonAppendStream(sequencer, persisted_size); + // The first write is a "state lookup" write. It should not contain a payload. + // The server responds with the current persisted size of the object. + EXPECT_CALL(*stream, Write) + .WillOnce([&](google::storage::v2::BidiWriteObjectRequest const& request, + grpc::WriteOptions wopt) { + EXPECT_TRUE(request.state_lookup()); + EXPECT_FALSE(wopt.is_last_message()); + return sequencer.PushBack("Write(StateLookup)"); + }) + // Subsequent writes carry data. + .WillOnce([&](google::storage::v2::BidiWriteObjectRequest const&, + grpc::WriteOptions wopt) { + EXPECT_FALSE(wopt.is_last_message()); + return sequencer.PushBack("Write(data)"); + }) + // The finalize write marks the end of the stream. + .WillOnce([&](google::storage::v2::BidiWriteObjectRequest const& request, + grpc::WriteOptions wopt) { + EXPECT_TRUE(request.finish_write()); + EXPECT_TRUE(wopt.is_last_message()); + return sequencer.PushBack("Write(Finalize)"); + }); + return stream; } // Creates a mock stream that returns an error. @@ -348,6 +432,201 @@ TEST_F(AsyncConnectionImplAppendableTest, AppendableUploadPermanentError) { EXPECT_THAT(r, StatusIs(PermanentError().code())); } +TEST_F(AsyncConnectionImplAppendableTest, AppendableUploadRedirect) { + auto constexpr kRequestText = R"pb( + write_object_spec { + resource { + bucket: "projects/_/buckets/test-bucket" + name: "test-object" + content_type: "text/plain" + } + } + )pb"; + AsyncSequencer sequencer; + auto mock = std::make_shared(); + + google::rpc::Status rpc_status; + rpc_status.set_code(static_cast(StatusCode::kAborted)); + rpc_status.set_message("redirect"); + google::storage::v2::BidiWriteObjectRedirectedError redirect; + redirect.mutable_write_handle()->set_handle("redirect-handle"); + redirect.set_routing_token("redirect-token"); + redirect.set_generation(4321); + rpc_status.add_details()->PackFrom(redirect); + std::string rpc_status_payload; + ASSERT_TRUE(rpc_status.SerializeToString(&rpc_status_payload)); + Status status(StatusCode::kAborted, "redirect"); + internal::SetPayload(status, internal::StatusPayloadGrpcProto(), + rpc_status_payload); + + // Simulate one redirect failure, followed by a success. + EXPECT_CALL(*mock, AsyncBidiWriteObject) + .WillOnce([&] { return MakeErrorBidiWriteStream(sequencer, status); }) + .WillOnce([&] { + return MakeRedirectAppendStream(sequencer, 1024, "redirect-handle", + 4321, "redirect-token"); + }); + + internal::AutomaticallyCreatedBackgroundThreads pool(1); + auto connection = MakeTestConnection(pool.cq(), mock); + + auto request = google::storage::v2::BidiWriteObjectRequest{}; + ASSERT_TRUE(TextFormat::ParseFromString(kRequestText, &request)); + auto pending = connection->StartAppendableObjectUpload( + {std::move(request), connection->options()}); + + // First attempt fails with redirect. + auto next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Start"); + next.first.set_value(false); // The stream fails to start. + + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Finish"); + next.first.set_value(true); + + // Retry attempt succeeds. + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Start"); + next.first.set_value(true); + + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Write(StateLookup)"); + next.first.set_value(true); + + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Read(PersistedSize)"); + next.first.set_value(true); + + auto r = pending.get(); + ASSERT_STATUS_OK(r); + auto writer = *std::move(r); + EXPECT_EQ(absl::get(writer->PersistedState()), 1024); + + // Write some data. + auto w1 = writer->Write(storage::WritePayload("some data")); + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Write(data)"); + next.first.set_value(true); + EXPECT_STATUS_OK(w1.get()); + + // Finalize the upload. + auto w2 = writer->Finalize({}); + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Write(Finalize)"); + next.first.set_value(true); + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Read(FinalObject)"); + next.first.set_value(true); + + auto response = w2.get(); + ASSERT_STATUS_OK(response); + EXPECT_EQ(response->bucket(), "projects/_/buckets/test-bucket"); + EXPECT_EQ(response->name(), "test-object"); + EXPECT_EQ(response->size(), 1024 + 1024); + + writer.reset(); + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Finish"); + next.first.set_value(true); +} + +TEST_F(AsyncConnectionImplAppendableTest, AppendableUploadRedirectNoHandle) { + auto constexpr kRequestText = R"pb( + write_object_spec { + resource { + bucket: "projects/_/buckets/test-bucket" + name: "test-object" + content_type: "text/plain" + } + } + )pb"; + AsyncSequencer sequencer; + auto mock = std::make_shared(); + + google::rpc::Status rpc_status; + rpc_status.set_code(static_cast(StatusCode::kAborted)); + rpc_status.set_message("redirect"); + google::storage::v2::BidiWriteObjectRedirectedError redirect; + redirect.set_routing_token("redirect-token"); + redirect.set_generation(4321); + rpc_status.add_details()->PackFrom(redirect); + std::string rpc_status_payload; + ASSERT_TRUE(rpc_status.SerializeToString(&rpc_status_payload)); + Status status(StatusCode::kAborted, "redirect"); + internal::SetPayload(status, internal::StatusPayloadGrpcProto(), + rpc_status_payload); + + // Simulate one redirect failure, followed by a success. + EXPECT_CALL(*mock, AsyncBidiWriteObject) + .WillOnce([&] { return MakeErrorBidiWriteStream(sequencer, status); }) + .WillOnce([&] { + return MakeRedirectAppendStreamNoHandle( + sequencer, 1024, "projects/_/buckets/test-bucket", "test-object"); + }); + + internal::AutomaticallyCreatedBackgroundThreads pool(1); + auto connection = MakeTestConnection(pool.cq(), mock); + + auto request = google::storage::v2::BidiWriteObjectRequest{}; + ASSERT_TRUE(TextFormat::ParseFromString(kRequestText, &request)); + auto pending = connection->StartAppendableObjectUpload( + {std::move(request), connection->options()}); + + // First attempt fails with redirect. + auto next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Start"); + next.first.set_value(false); // The stream fails to start. + + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Finish"); + next.first.set_value(true); + + // Retry attempt succeeds. + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Start"); + next.first.set_value(true); + + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Write(StateLookup)"); + next.first.set_value(true); + + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Read(PersistedSize)"); + next.first.set_value(true); + + auto r = pending.get(); + ASSERT_STATUS_OK(r); + auto writer = *std::move(r); + EXPECT_EQ(absl::get(writer->PersistedState()), 1024); + + // Write some data. + auto w1 = writer->Write(storage::WritePayload("some data")); + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Write(data)"); + next.first.set_value(true); + EXPECT_STATUS_OK(w1.get()); + + // Finalize the upload. + auto w2 = writer->Finalize({}); + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Write(Finalize)"); + next.first.set_value(true); + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Read(FinalObject)"); + next.first.set_value(true); + + auto response = w2.get(); + ASSERT_STATUS_OK(response); + EXPECT_EQ(response->bucket(), "projects/_/buckets/test-bucket"); + EXPECT_EQ(response->name(), "test-object"); + EXPECT_EQ(response->size(), 1024 + 1024); + + writer.reset(); + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Finish"); + next.first.set_value(true); +} + } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal diff --git a/google/cloud/storage/internal/async/handle_redirect_error.cc b/google/cloud/storage/internal/async/handle_redirect_error.cc index 1444a8bda6f19..d8fe1ad0684c4 100644 --- a/google/cloud/storage/internal/async/handle_redirect_error.cc +++ b/google/cloud/storage/internal/async/handle_redirect_error.cc @@ -20,27 +20,6 @@ namespace cloud { namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -void EnsureFirstMessageAppendObjectSpec( - google::storage::v2::BidiWriteObjectRequest& request, - google::rpc::Status const& rpc_status) { - for (auto const& rpc_status_detail : rpc_status.details()) { - google::storage::v2::BidiWriteObjectRedirectedError error = - google::storage::v2::BidiWriteObjectRedirectedError{}; - if (!rpc_status_detail.UnpackTo(&error)) continue; - if (!error.has_write_handle()) continue; - if (request.has_write_object_spec()) { - auto spec = request.write_object_spec(); - auto& append_object_spec = *request.mutable_append_object_spec(); - append_object_spec.set_bucket(spec.resource().bucket()); - append_object_spec.set_object(spec.resource().name()); - append_object_spec.set_if_metageneration_match( - spec.if_metageneration_match()); - append_object_spec.set_if_metageneration_not_match( - spec.if_metageneration_not_match()); - } - } -} - google::rpc::Status ExtractGrpcStatus(Status const& status) { google::rpc::Status proto_status = google::rpc::Status{}; auto payload = google::cloud::internal::GetPayload( @@ -72,6 +51,59 @@ void ApplyWriteRedirectErrors(google::storage::v2::AppendObjectSpec& spec, } } +BidiWriteRedirectInfo HandleBidiWriteRedirect( + google::storage::v2::BidiWriteObjectRequest& request, + google::rpc::Status const& rpc_status) { + BidiWriteRedirectInfo info; + std::optional + redirect_error; + for (auto const& rpc_status_detail : rpc_status.details()) { + google::storage::v2::BidiWriteObjectRedirectedError error_proto; + if (rpc_status_detail.UnpackTo(&error_proto)) { + redirect_error = std::move(error_proto); + break; // Found the redirect error, no need to look further. + } + } + if (!redirect_error) { + return info; + } + + // We always extract the routing token if it's provided, as it's needed for + // the x-goog-request-params header in the next retry attempt. + if (!redirect_error->routing_token().empty()) { + info.routing_token = redirect_error->routing_token(); + } + if (!redirect_error->has_write_handle()) { + return info; + } + + // If we get back a write handle, we should use it. We can only use it + // on an append object spec. If we have a write object spec, we copy the + // relevant fields from write object spec to append object spec. + // If we have an append object spec, we copy the relevant fields from the + // error to the spec. + if (request.has_write_object_spec()) { + auto write_object_spec = request.write_object_spec(); + auto& append_object_spec = *request.mutable_append_object_spec(); + append_object_spec.set_bucket(write_object_spec.resource().bucket()); + append_object_spec.set_object(write_object_spec.resource().name()); + append_object_spec.set_if_metageneration_match( + write_object_spec.if_metageneration_match()); + append_object_spec.set_if_metageneration_not_match( + write_object_spec.if_metageneration_not_match()); + } + if (request.has_append_object_spec()) { + auto& append_object_spec = *request.mutable_append_object_spec(); + *append_object_spec.mutable_write_handle() = + std::move(*redirect_error->mutable_write_handle()); + *append_object_spec.mutable_routing_token() = + std::move(*redirect_error->mutable_routing_token()); + if (redirect_error->has_generation()) + append_object_spec.set_generation(redirect_error->generation()); + } + return info; +} + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud diff --git a/google/cloud/storage/internal/async/handle_redirect_error.h b/google/cloud/storage/internal/async/handle_redirect_error.h index 5cdf3b1b3d181..29d2a6025c3ec 100644 --- a/google/cloud/storage/internal/async/handle_redirect_error.h +++ b/google/cloud/storage/internal/async/handle_redirect_error.h @@ -25,9 +25,10 @@ namespace cloud { namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -void EnsureFirstMessageAppendObjectSpec( - google::storage::v2::BidiWriteObjectRequest& request, - google::rpc::Status const& rpc_status); +struct BidiWriteRedirectInfo { + // The routing token extracted from the redirect error, if available. + std::string routing_token; +}; google::rpc::Status ExtractGrpcStatus(Status const& status); @@ -37,6 +38,12 @@ void ApplyRedirectErrors(google::storage::v2::BidiReadObjectSpec& spec, void ApplyWriteRedirectErrors(google::storage::v2::AppendObjectSpec& spec, google::rpc::Status const& rpc_status); +// Handles BidiWriteObjectRedirectedError and modifies the request accordingly. +// Returns information needed for the next retry attempt. +BidiWriteRedirectInfo HandleBidiWriteRedirect( + google::storage::v2::BidiWriteObjectRequest& request, + google::rpc::Status const& rpc_status); + GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal } // namespace cloud diff --git a/google/cloud/storage/internal/async/handle_redirect_error_test.cc b/google/cloud/storage/internal/async/handle_redirect_error_test.cc index d681cdf1e790c..b3ecca5bb5073 100644 --- a/google/cloud/storage/internal/async/handle_redirect_error_test.cc +++ b/google/cloud/storage/internal/async/handle_redirect_error_test.cc @@ -70,58 +70,150 @@ TEST(ApplyRedirectErrors, NoRedirect) { EXPECT_TRUE(spec.routing_token().empty()); } -TEST(EnsureFirstMessageAppendObjectSpec, Success) { +TEST(ApplyWriteRedirectErrors, NoRedirect) { + google::storage::v2::AppendObjectSpec spec; + spec.set_bucket("projects/_/buckets/test-bucket"); + spec.set_object("test-object"); + google::rpc::Status rpc_status; + rpc_status.set_code(static_cast(StatusCode::kNotFound)); + rpc_status.set_message("test-message"); + + ApplyWriteRedirectErrors(spec, rpc_status); + EXPECT_EQ(spec.bucket(), "projects/_/buckets/test-bucket"); + EXPECT_EQ(spec.object(), "test-object"); + EXPECT_FALSE(spec.has_write_handle()); + EXPECT_TRUE(spec.routing_token().empty()); + EXPECT_EQ(spec.generation(), 0); +} + +TEST(ApplyWriteRedirectErrors, Success) { + google::storage::v2::AppendObjectSpec spec; + spec.set_bucket("projects/_/buckets/test-bucket"); + spec.set_object("test-object"); + google::rpc::Status rpc_status; + google::storage::v2::BidiWriteObjectRedirectedError redirect; + redirect.mutable_write_handle()->set_handle("test-handle"); + redirect.set_routing_token("test-token"); + redirect.set_generation(1234); + rpc_status.add_details()->PackFrom(redirect); + + ApplyWriteRedirectErrors(spec, rpc_status); + EXPECT_EQ(spec.bucket(), "projects/_/buckets/test-bucket"); + EXPECT_EQ(spec.object(), "test-object"); + EXPECT_EQ(spec.write_handle().handle(), "test-handle"); + EXPECT_EQ(spec.routing_token(), "test-token"); + EXPECT_EQ(spec.generation(), 1234); +} + +TEST(HandleBidiWriteRedirect, NoRedirect) { + google::storage::v2::BidiWriteObjectRequest request; + ASSERT_TRUE(google::protobuf::TextFormat::ParseFromString( + R"pb( + write_object_spec { + resource { bucket: "projects/_/buckets/b", name: "o" } + } + )pb", + &request)); + + google::rpc::Status rpc_status; + rpc_status.set_code(static_cast(StatusCode::kNotFound)); + rpc_status.set_message("test-message"); + + auto info = HandleBidiWriteRedirect(request, rpc_status); + EXPECT_TRUE(info.routing_token.empty()); + EXPECT_TRUE(request.has_write_object_spec()); + EXPECT_FALSE(request.has_append_object_spec()); +} + +TEST(HandleBidiWriteRedirect, NoWriteHandle) { google::storage::v2::BidiWriteObjectRequest request; ASSERT_TRUE(google::protobuf::TextFormat::ParseFromString( R"pb( write_object_spec { resource { bucket: "projects/_/buckets/b", name: "o" } - if_metageneration_match: 1 - if_metageneration_not_match: 1 } )pb", &request)); google::rpc::Status rpc_status; google::storage::v2::BidiWriteObjectRedirectedError redirect; - redirect.mutable_write_handle(); + redirect.set_routing_token("test-token"); rpc_status.add_details()->PackFrom(redirect); - EnsureFirstMessageAppendObjectSpec(request, rpc_status); + auto info = HandleBidiWriteRedirect(request, rpc_status); + EXPECT_EQ(info.routing_token, "test-token"); + EXPECT_TRUE(request.has_write_object_spec()); + EXPECT_FALSE(request.has_append_object_spec()); +} +TEST(HandleBidiWriteRedirect, WithWriteHandleForWriteObjectSpec) { + google::storage::v2::BidiWriteObjectRequest request; + ASSERT_TRUE(google::protobuf::TextFormat::ParseFromString( + R"pb( + write_object_spec { + resource { bucket: "projects/_/buckets/b", name: "o" } + if_metageneration_match: 1 + if_metageneration_not_match: 2 + } + )pb", + &request)); + + google::rpc::Status rpc_status; + google::storage::v2::BidiWriteObjectRedirectedError redirect; + redirect.mutable_write_handle()->set_handle("test-handle"); + redirect.set_routing_token("test-token"); + redirect.set_generation(1234); + rpc_status.add_details()->PackFrom(redirect); + + auto info = HandleBidiWriteRedirect(request, rpc_status); + EXPECT_EQ(info.routing_token, "test-token"); EXPECT_FALSE(request.has_write_object_spec()); EXPECT_TRUE(request.has_append_object_spec()); - auto const& append_spec = request.append_object_spec(); - EXPECT_EQ(append_spec.bucket(), "projects/_/buckets/b"); - EXPECT_EQ(append_spec.object(), "o"); - - EXPECT_FALSE(append_spec.has_write_handle()); - EXPECT_TRUE(append_spec.routing_token().empty()); - EXPECT_EQ(append_spec.if_metageneration_match(), 1); - EXPECT_EQ(append_spec.if_metageneration_not_match(), 1); - EXPECT_EQ(append_spec.generation(), 0); + auto const& spec = request.append_object_spec(); + EXPECT_EQ(spec.bucket(), "projects/_/buckets/b"); + EXPECT_EQ(spec.object(), "o"); + EXPECT_EQ(spec.if_metageneration_match(), 1); + EXPECT_EQ(spec.if_metageneration_not_match(), 2); + EXPECT_EQ(spec.write_handle().handle(), "test-handle"); + EXPECT_EQ(spec.routing_token(), "test-token"); + EXPECT_EQ(spec.generation(), 1234); } -TEST(EnsureFirstMessageAppendObjectSpec, WriteHandleIsNotSet) { +TEST(HandleBidiWriteRedirect, WithWriteHandleForAppendObjectSpec) { google::storage::v2::BidiWriteObjectRequest request; ASSERT_TRUE(google::protobuf::TextFormat::ParseFromString( R"pb( - write_object_spec { - resource { bucket: "projects/_/buckets/b", name: "o" } + append_object_spec { + bucket: "projects/_/buckets/b" + object: "o" + generation: 123 + if_metageneration_match: 1 + if_metageneration_not_match: 2 } )pb", &request)); google::rpc::Status rpc_status; google::storage::v2::BidiWriteObjectRedirectedError redirect; + redirect.mutable_write_handle()->set_handle("test-handle"); + redirect.set_routing_token("test-token"); redirect.set_generation(1234); rpc_status.add_details()->PackFrom(redirect); - EnsureFirstMessageAppendObjectSpec(request, rpc_status); + auto info = HandleBidiWriteRedirect(request, rpc_status); + EXPECT_EQ(info.routing_token, "test-token"); + EXPECT_FALSE(request.has_write_object_spec()); + EXPECT_TRUE(request.has_append_object_spec()); - EXPECT_TRUE(request.has_write_object_spec()); - EXPECT_FALSE(request.has_append_object_spec()); + auto const& spec = request.append_object_spec(); + EXPECT_EQ(spec.bucket(), "projects/_/buckets/b"); + EXPECT_EQ(spec.object(), "o"); + EXPECT_EQ(spec.if_metageneration_match(), 1); + EXPECT_EQ(spec.if_metageneration_not_match(), 2); + EXPECT_EQ(spec.write_handle().handle(), "test-handle"); + EXPECT_EQ(spec.routing_token(), "test-token"); + EXPECT_EQ(spec.generation(), 1234); } } // namespace diff --git a/google/cloud/storage/internal/async/object_descriptor_connection_tracing.cc b/google/cloud/storage/internal/async/object_descriptor_connection_tracing.cc index 64cf5bde9d4ed..58adf2e2c6c5f 100644 --- a/google/cloud/storage/internal/async/object_descriptor_connection_tracing.cc +++ b/google/cloud/storage/internal/async/object_descriptor_connection_tracing.cc @@ -46,6 +46,7 @@ class AsyncObjectDescriptorConnectionTracing absl::optional metadata() const override { return impl_->metadata(); } + bool IsOpen() const override { return impl_->IsOpen(); } std::unique_ptr Read(ReadParams p) override { internal::OTelScope scope(span_); diff --git a/google/cloud/storage/internal/async/object_descriptor_impl.cc b/google/cloud/storage/internal/async/object_descriptor_impl.cc index c4ab3e28c9a43..f1a1906c65018 100644 --- a/google/cloud/storage/internal/async/object_descriptor_impl.cc +++ b/google/cloud/storage/internal/async/object_descriptor_impl.cc @@ -34,11 +34,13 @@ ObjectDescriptorImpl::ObjectDescriptorImpl( std::unique_ptr resume_policy, OpenStreamFactory make_stream, google::storage::v2::BidiReadObjectSpec read_object_spec, - std::shared_ptr stream, Options options) + std::shared_ptr stream, Options options, + std::function transport_ok) : resume_policy_prototype_(std::move(resume_policy)), make_stream_(std::move(make_stream)), read_object_spec_(std::move(read_object_spec)), - options_(std::move(options)) { + options_(std::move(options)), + transport_ok_(std::move(transport_ok)) { stream_manager_ = std::make_unique( []() -> std::shared_ptr { return nullptr; }, // NOLINT std::make_shared(std::move(stream), @@ -62,8 +64,18 @@ void ObjectDescriptorImpl::Start( } } +bool ObjectDescriptorImpl::IsOpen() const { + { + std::scoped_lock lk(mu_); + if (cancelled_) return false; + if (stream_manager_->Empty()) return false; + } + return !transport_ok_ || transport_ok_(); +} + void ObjectDescriptorImpl::Cancel() { std::unique_lock lk(mu_); + if (cancelled_) return; cancelled_ = true; if (stream_manager_) stream_manager_->CancelAll(); if (pending_stream_.valid()) pending_stream_.cancel(); diff --git a/google/cloud/storage/internal/async/object_descriptor_impl.h b/google/cloud/storage/internal/async/object_descriptor_impl.h index f7f8a0d55a285..e45ce7caf6cfb 100644 --- a/google/cloud/storage/internal/async/object_descriptor_impl.h +++ b/google/cloud/storage/internal/async/object_descriptor_impl.h @@ -27,6 +27,7 @@ #include "absl/types/optional.h" #include "google/storage/v2/storage.pb.h" #include +#include #include #include #include @@ -59,8 +60,8 @@ class ObjectDescriptorImpl ObjectDescriptorImpl(std::unique_ptr resume_policy, OpenStreamFactory make_stream, google::storage::v2::BidiReadObjectSpec read_object_spec, - std::shared_ptr stream, - Options options = {}); + std::shared_ptr stream, Options options = {}, + std::function transport_ok = {}); ~ObjectDescriptorImpl() override; // Start the read loop. @@ -82,6 +83,8 @@ class ObjectDescriptorImpl std::size_t StreamSize() const; + bool IsOpen() const override; + private: using StreamManager = MultiStreamManager; using StreamIterator = @@ -123,6 +126,7 @@ class ObjectDescriptorImpl google::cloud::StatusOr> pending_stream_; bool cancelled_ = false; + std::function transport_ok_; }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/storage/internal/async/object_descriptor_impl_test.cc b/google/cloud/storage/internal/async/object_descriptor_impl_test.cc index 96c998b51c1eb..f87f8b3c1a939 100644 --- a/google/cloud/storage/internal/async/object_descriptor_impl_test.cc +++ b/google/cloud/storage/internal/async/object_descriptor_impl_test.cc @@ -67,15 +67,18 @@ auto constexpr kMetadataText = R"pb( auto NoResume() { return storage::LimitedErrorCountResumePolicy(0)(); } -auto MakeTested(std::unique_ptr resume_policy, - OpenStreamFactory make_stream, - google::storage::v2::BidiReadObjectSpec read_object_spec, - std::shared_ptr stream) { +auto MakeTested( + std::unique_ptr resume_policy, + OpenStreamFactory make_stream, + google::storage::v2::BidiReadObjectSpec read_object_spec, + std::shared_ptr stream, + std::function transport_ok = [] { return true; }) { Options options; options.set(true); return std::make_shared( std::move(resume_policy), std::move(make_stream), - std::move(read_object_spec), std::move(stream), std::move(options)); + std::move(read_object_spec), std::move(stream), std::move(options), + std::move(transport_ok)); } MATCHER_P(IsProtoEqualModuloRepeatedFieldOrdering, value, @@ -1784,6 +1787,83 @@ TEST(ObjectDescriptorImpl, MultiStreamOptimizationDisabled) { tested.reset(); } +/// @test Verify that IsOpen() is true by default. +TEST(ObjectDescriptorImpl, IsOpenTrueByDefault) { + MockFactory factory; + auto stream = std::make_unique(); + EXPECT_CALL(*stream, Finish).WillOnce(Return(make_ready_future(Status{}))); + EXPECT_CALL(*stream, Cancel).Times(AtMost(1)); + auto tested = MakeTested(NoResume(), factory.AsStdFunction(), + google::storage::v2::BidiReadObjectSpec{}, + std::make_shared(std::move(stream))); + EXPECT_TRUE(tested->IsOpen()); +} + +/// @test Verify that IsOpen() is false after Cancel(). +TEST(ObjectDescriptorImpl, IsOpenFalseOnCancel) { + MockFactory factory; + auto stream = std::make_unique(); + EXPECT_CALL(*stream, Finish).WillOnce(Return(make_ready_future(Status{}))); + EXPECT_CALL(*stream, Cancel).Times(AtMost(2)); + auto tested = MakeTested(NoResume(), factory.AsStdFunction(), + google::storage::v2::BidiReadObjectSpec{}, + std::make_shared(std::move(stream))); + EXPECT_TRUE(tested->IsOpen()); + tested->Cancel(); + EXPECT_FALSE(tested->IsOpen()); +} + +/// @test Verify that IsOpen() is false if transport health check fails. +TEST(ObjectDescriptorImpl, IsOpenFalseOnPermanentError) { + MockFactory factory; + auto stream = std::make_unique(); + EXPECT_CALL(*stream, Finish).WillOnce(Return(make_ready_future(Status{}))); + EXPECT_CALL(*stream, Cancel).Times(AtMost(1)); + bool transport_ok = true; + auto transport_ok_callback = [&transport_ok] { return transport_ok; }; + + auto tested = MakeTested(NoResume(), factory.AsStdFunction(), + google::storage::v2::BidiReadObjectSpec{}, + std::make_shared(std::move(stream)), + transport_ok_callback); + + EXPECT_TRUE(tested->IsOpen()); + transport_ok = false; + EXPECT_FALSE(tested->IsOpen()); +} + +TEST(ObjectDescriptorImpl, IsOpenFalseOnTransportFailure) { + auto stream = std::make_unique(); + EXPECT_CALL(*stream, Cancel).Times(1); + EXPECT_CALL(*stream, Finish).WillOnce([] { + return make_ready_future(Status{}); + }); + MockFactory factory; + auto transport_ok = [] { return false; }; + auto tested = std::make_shared( + NoResume(), factory.AsStdFunction(), + google::storage::v2::BidiReadObjectSpec{}, + std::make_shared(std::move(stream)), Options{}, + std::move(transport_ok)); + EXPECT_FALSE(tested->IsOpen()); +} + +TEST(ObjectDescriptorImpl, IsOpenTrueOnTransportSuccess) { + auto stream = std::make_unique(); + EXPECT_CALL(*stream, Cancel).Times(1); + EXPECT_CALL(*stream, Finish).WillOnce([] { + return make_ready_future(Status{}); + }); + MockFactory factory; + auto transport_ok = [] { return true; }; + auto tested = std::make_shared( + NoResume(), factory.AsStdFunction(), + google::storage::v2::BidiReadObjectSpec{}, + std::make_shared(std::move(stream)), Options{}, + std::move(transport_ok)); + EXPECT_TRUE(tested->IsOpen()); +} + } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal diff --git a/google/cloud/storage/internal/async/writer_connection_buffered.cc b/google/cloud/storage/internal/async/writer_connection_buffered.cc index 786a33b3b89cd..ec179e207b516 100644 --- a/google/cloud/storage/internal/async/writer_connection_buffered.cc +++ b/google/cloud/storage/internal/async/writer_connection_buffered.cc @@ -281,7 +281,8 @@ class AsyncWriterConnectionBufferedState return tmp; } - void OnQuery(std::unique_lock lk, std::int64_t persisted_size) { + void OnQuery(std::unique_lock lk, std::int64_t persisted_size, + bool is_resume = false) { if (persisted_size < buffer_offset_) { auto id = UploadId(lk); return SetError(std::move(lk), @@ -297,7 +298,22 @@ class AsyncWriterConnectionBufferedState } resend_buffer_.RemovePrefix(static_cast(n)); buffer_offset_ = persisted_size; - write_offset_ -= static_cast(n); + if (is_resume) { + // Since the buffer has been modified to start exactly at the point of the + // resume, the next write on this new stream should start from the + // beginning of this truncated buffer. + write_offset_ = 0; + } else { + // While rare, it is possible that n >= write_offset_ (i.e. the server has + // persisted more than we have sent) if, for example, multiple clients + // resume the same upload. If that is the case, all the bytes covered by + // write_offset_ have been flushed and we can reset it to 0. + if (static_cast(n) >= write_offset_) { + write_offset_ = 0; + } else { + write_offset_ -= static_cast(n); + } + } // If the buffer is small enough, collect all the handlers to notify them. auto const handlers = ClearHandlersIfEmpty(lk); // SetFlushed will release the lock before returning. @@ -382,7 +398,7 @@ class AsyncWriterConnectionBufferedState std::move(state))); } // Regular resume succeeded, object not finalized. Continue writing. - OnQuery(std::move(lk), absl::get(state)); + OnQuery(std::move(lk), absl::get(state), /*is_resume=*/true); } void SetFinalized(std::unique_lock lk, diff --git a/google/cloud/storage/internal/async/writer_connection_buffered_test.cc b/google/cloud/storage/internal/async/writer_connection_buffered_test.cc index 40758de3c17e6..ed01b4581a3f0 100644 --- a/google/cloud/storage/internal/async/writer_connection_buffered_test.cc +++ b/google/cloud/storage/internal/async/writer_connection_buffered_test.cc @@ -1266,6 +1266,67 @@ TEST(WriteConnectionBuffered, SetFinalizedIsIdempotent) { next.first.set_value(true); } +TEST(WriteConnectionBuffered, ResetWriteOffsetOnResume) { + AsyncSequencer sequencer; + auto mock = std::make_unique(); + auto* mock_ptr = mock.get(); + + EXPECT_CALL(*mock_ptr, UploadId).WillRepeatedly(Return("test-upload-id")); + EXPECT_CALL(*mock_ptr, PersistedState) + .WillOnce( + Return(MakePersistedState(0))); // Initial state: 0 bytes persisted. + + EXPECT_CALL(*mock_ptr, Write).WillOnce([&](auto) { + return sequencer.PushBack("Write").then([](auto f) { + if (!f.get()) return TransientError(); // This write will fail. + return Status{}; + }); + }); + + MockFactory mock_factory; + auto resumed_mock = std::make_unique(); + auto* resumed_mock_ptr = resumed_mock.get(); + + EXPECT_CALL(mock_factory, Call).WillOnce([&]() { + return sequencer.PushBack("Resume").then([&](auto) { + // The resumed connection reports that 1024 bytes have been persisted. + EXPECT_CALL(*resumed_mock_ptr, PersistedState) + .WillRepeatedly(Return(MakePersistedState(1024))); + // We expect the next write on the resumed stream to send the remaining + // 1024 bytes. If the write offset was not reset to 0, this size would be + // incorrect. + EXPECT_CALL(*resumed_mock_ptr, Write).WillOnce([&](auto payload) { + EXPECT_EQ(payload.size(), 1024); + return sequencer.PushBack("ResumedWrite").then([](auto) { + return Status{}; + }); + }); + return make_status_or(std::unique_ptr( + std::move(resumed_mock))); + }); + }); + + auto connection = MakeWriterConnectionBuffered( + mock_factory.AsStdFunction(), std::move(mock), TestOptions()); + + // Write a total of 2048 bytes. + auto write = connection->Write(TestPayload(2048)); + + auto next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Write"); + next.first.set_value(false); + + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Resume"); + next.first.set_value(true); + + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "ResumedWrite"); + next.first.set_value(true); + + EXPECT_STATUS_OK(write.get()); +} + } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal diff --git a/google/cloud/storage/internal/async/writer_connection_impl.cc b/google/cloud/storage/internal/async/writer_connection_impl.cc index cbc4087169fbb..8e579cfe64cd7 100644 --- a/google/cloud/storage/internal/async/writer_connection_impl.cc +++ b/google/cloud/storage/internal/async/writer_connection_impl.cc @@ -237,9 +237,7 @@ future> AsyncWriterConnectionImpl::OnQuery( .then([this](auto g) { auto result = g.get(); google::rpc::Status grpc_status = ExtractGrpcStatus(result); - EnsureFirstMessageAppendObjectSpec(request_, grpc_status); - ApplyWriteRedirectErrors(*request_.mutable_append_object_spec(), - grpc_status); + HandleBidiWriteRedirect(request_, grpc_status); return StatusOr(std::move(result)); }); } diff --git a/google/cloud/storage/internal/async/writer_connection_impl_test.cc b/google/cloud/storage/internal/async/writer_connection_impl_test.cc index 037954d4a153a..caaa3d4ae8d1c 100644 --- a/google/cloud/storage/internal/async/writer_connection_impl_test.cc +++ b/google/cloud/storage/internal/async/writer_connection_impl_test.cc @@ -21,6 +21,8 @@ #include "google/cloud/storage/options.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/mock_hash_function.h" +#include "google/cloud/internal/status_payload_keys.h" +#include "google/cloud/status.h" #include "google/cloud/testing_util/async_sequencer.h" #include "google/cloud/testing_util/is_proto_equal.h" #include "google/cloud/testing_util/status_matchers.h" @@ -649,6 +651,49 @@ TEST(AsyncWriterConnectionTest, UnexpectedQueryFailsWithoutError) { EXPECT_THAT(query.get(), StatusIs(StatusCode::kInternal)); } +TEST(AsyncWriterConnectionTest, QueryFailsWithRedirect) { + AsyncSequencer sequencer; + auto mock = std::make_unique(); + EXPECT_CALL(*mock, Cancel).Times(1); + EXPECT_CALL(*mock, Read).WillOnce([&]() { + return sequencer.PushBack("Read").then( + [](auto) { return absl::optional(); }); + }); + + google::rpc::Status rpc_status; + rpc_status.set_code(static_cast(StatusCode::kAborted)); + rpc_status.set_message("redirect"); + google::storage::v2::BidiWriteObjectRedirectedError redirect; + redirect.mutable_write_handle()->set_handle("redirect-handle"); + redirect.set_routing_token("redirect-token"); + redirect.set_generation(4321); + rpc_status.add_details()->PackFrom(redirect); + std::string rpc_status_payload; + ASSERT_TRUE(rpc_status.SerializeToString(&rpc_status_payload)); + Status status(StatusCode::kAborted, "redirect"); + internal::SetPayload(status, internal::StatusPayloadGrpcProto(), + rpc_status_payload); + + EXPECT_CALL(*mock, Finish).WillOnce([&, status] { + return sequencer.PushBack("Finish").then([s = status](auto f) -> Status { + if (f.get()) return Status{}; + return s; + }); + }); + auto hash = std::make_shared(); + + auto tested = std::make_unique( + TestOptions(), MakeRequest(), std::move(mock), hash, 1024); + auto query = tested->Query(); + auto next = sequencer.PopFrontWithName(); + ASSERT_THAT(next.second, "Read"); + next.first.set_value(false); // Detect error from Read() + next = sequencer.PopFrontWithName(); + ASSERT_THAT(next.second, "Finish"); + next.first.set_value(false); // Return error from Finish() + EXPECT_THAT(query.get(), StatusIs(StatusCode::kAborted)); +} + TEST(AsyncWriterConnectionTest, FinalizeAppendableNoChecksum) { AsyncSequencer sequencer; auto mock = std::make_unique(); diff --git a/google/cloud/storage/internal/async/writer_connection_resumed.cc b/google/cloud/storage/internal/async/writer_connection_resumed.cc index 3b860bef02a6e..5ae78d307bd59 100644 --- a/google/cloud/storage/internal/async/writer_connection_resumed.cc +++ b/google/cloud/storage/internal/async/writer_connection_resumed.cc @@ -317,7 +317,22 @@ class AsyncWriterConnectionResumedState } resend_buffer_.RemovePrefix(static_cast(n)); buffer_offset_ = persisted_size; - write_offset_ -= static_cast(n); + if (state_ == State::kResuming) { + // Since the buffer has been modified to start exactly at the point of the + // resume, the next write on this new stream should start from the + // beginning of this truncated buffer. + write_offset_ = 0; + } else { + // While rare, it is possible that n >= write_offset_ (i.e. the server has + // persisted more than we have sent) if, for example, multiple clients + // resume the same upload. If that is the case, all the bytes covered by + // write_offset_ have been flushed and we can reset it to 0. + if (static_cast(n) >= write_offset_) { + write_offset_ = 0; + } else { + write_offset_ -= static_cast(n); + } + } // If the buffer is small enough, collect all the handlers to notify them. auto const handlers = ClearHandlersIfEmpty(lk); state_ = State::kIdle; diff --git a/google/cloud/storage/internal/async/writer_connection_resumed_test.cc b/google/cloud/storage/internal/async/writer_connection_resumed_test.cc index c274b683c4287..dcebb80ac8c63 100644 --- a/google/cloud/storage/internal/async/writer_connection_resumed_test.cc +++ b/google/cloud/storage/internal/async/writer_connection_resumed_test.cc @@ -11,9 +11,10 @@ // 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 "google/cloud/storage/internal/async/writer_connection_resumed.h" +#include "google/cloud/mocks/mock_async_streaming_read_write_rpc.h" #include "google/cloud/storage/async/connection.h" +#include "google/cloud/storage/internal/grpc/ctype_cord_workaround.h" #include "google/cloud/storage/mocks/mock_async_writer_connection.h" #include "google/cloud/storage/testing/canonical_errors.h" #include "google/cloud/storage/testing/mock_hash_function.h" @@ -615,6 +616,123 @@ TEST(WriterConnectionResumed, OnQueryUpdatesWriteHandle) { EXPECT_EQ(current_handle->handle(), "updated-handle"); } +TEST(WriterConnectionResumed, ResetWriteOffsetOnResume) { + AsyncSequencer sequencer; + auto mock = std::make_unique(); + auto* mock_ptr = mock.get(); + + auto initial_request = google::storage::v2::BidiWriteObjectRequest{}; + google::storage::v2::BidiWriteObjectResponse first_response; + first_response.mutable_write_handle()->set_handle("initial-handle"); + + auto mock_hash = + std::make_shared(); + EXPECT_CALL(*mock_hash, Update(::testing::An(), + ::testing::An(), + ::testing::An())) + .WillRepeatedly(Return(Status())); + + EXPECT_CALL(*mock_ptr, PersistedState) + .WillOnce(Return(MakePersistedState(0))) + .WillOnce(Return(MakePersistedState(1024))); + + auto const payload = TestPayload(2048); + + EXPECT_CALL(*mock_ptr, Flush(_)).WillOnce([&](auto) { + return sequencer.PushBack("Flush").then([](auto f) { + if (f.get()) return Status{}; + return TransientError(); + }); + }); + + MockFactory mock_factory; + auto mock_stream = + std::make_unique>(); + auto* mock_stream_ptr = mock_stream.get(); + + EXPECT_CALL(mock_factory, Call(_)) + .WillOnce([&](google::storage::v2::BidiWriteObjectRequest const&) { + WriteObject::WriteResult result; + result.stream = std::move(mock_stream); + result.first_response.mutable_write_handle()->set_handle("new-handle"); + return sequencer.PushBack("Factory").then( + [r = std::move(result)](auto) mutable { + return StatusOr(std::move(r)); + }); + }); + + EXPECT_CALL(*mock_stream_ptr, Write(_, _)) + .WillOnce([&](google::storage::v2::BidiWriteObjectRequest const& request, + grpc::WriteOptions) { + EXPECT_EQ(GetContent(request.checksummed_data()).size(), 1024); + EXPECT_EQ(GetContent(request.checksummed_data()), + std::string(1024, 'A')); + return sequencer.PushBack("StreamWrite").then([](auto) { + return true; + }); + }) + .WillOnce([&](google::storage::v2::BidiWriteObjectRequest const& request, + grpc::WriteOptions) { + EXPECT_TRUE(GetContent(request.checksummed_data()).empty()); + EXPECT_TRUE(request.flush()); + return sequencer.PushBack("GhostWrite").then([](auto) { return true; }); + }); + + google::storage::v2::BidiWriteObjectResponse read_response1; + read_response1.set_persisted_size(2048); + google::storage::v2::BidiWriteObjectResponse read_response2; + read_response2.set_persisted_size(2048); + EXPECT_CALL(*mock_stream_ptr, Read) + .WillOnce([&, read_response1]() { + return sequencer.PushBack("StreamRead1").then([read_response1](auto) { + return absl::make_optional(read_response1); + }); + }) + .WillOnce([&, read_response2]() { + return sequencer.PushBack("StreamRead2").then([read_response2](auto) { + return absl::make_optional(read_response2); + }); + }); + + EXPECT_CALL(*mock_stream_ptr, Finish) + .WillOnce(Return(make_ready_future(Status{}))); + EXPECT_CALL(*mock_stream_ptr, Cancel).WillRepeatedly(Return()); + + auto connection = MakeWriterConnectionResumed( + mock_factory.AsStdFunction(), std::move(mock), initial_request, mock_hash, + first_response, Options{}); + + auto write = connection->Write(payload); + + auto next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Flush"); + next.first.set_value(false); + + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "Factory"); + next.first.set_value(true); + + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "StreamWrite"); + next.first.set_value(true); + + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "StreamRead1"); + next.first.set_value(true); + + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "GhostWrite"); + next.first.set_value(true); + + next = sequencer.PopFrontWithName(); + EXPECT_EQ(next.second, "StreamRead2"); + next.first.set_value(true); + + EXPECT_THAT(write.get(), StatusIs(StatusCode::kOk)); +} + } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal diff --git a/google/cloud/storage/internal/bucket_metadata_parser.cc b/google/cloud/storage/internal/bucket_metadata_parser.cc index 1c138bb0c3d45..806561c5b7097 100644 --- a/google/cloud/storage/internal/bucket_metadata_parser.cc +++ b/google/cloud/storage/internal/bucket_metadata_parser.cc @@ -412,8 +412,6 @@ void ToJsonEncryption(nlohmann::json& json, BucketMetadata const& meta) { if (config_source.restriction_mode.empty()) return; nlohmann::json config; config["restrictionMode"] = config_source.restriction_mode; - config["effectiveTime"] = - google::cloud::internal::FormatRfc3339(config_source.effective_time); e[name] = std::move(config); }; to_json_config( diff --git a/google/cloud/storage/internal/grpc/bucket_request_parser.cc b/google/cloud/storage/internal/grpc/bucket_request_parser.cc index 703125edd9c02..67e334e49c0ea 100644 --- a/google/cloud/storage/internal/grpc/bucket_request_parser.cc +++ b/google/cloud/storage/internal/grpc/bucket_request_parser.cc @@ -163,18 +163,6 @@ Status PatchLogging(Bucket& b, nlohmann::json const& l) { return Status{}; } -google::protobuf::Timestamp ToProtoTimestamp( - std::chrono::system_clock::time_point tp) { - auto duration = tp.time_since_epoch(); - auto seconds = std::chrono::duration_cast(duration); - auto nanos = - std::chrono::duration_cast(duration - seconds); - google::protobuf::Timestamp ts; - ts.set_seconds(seconds.count()); - ts.set_nanos(static_cast(nanos.count())); - return ts; -} - Status PatchEncryption(Bucket& b, nlohmann::json const& e) { if (e.is_null()) { b.clear_encryption(); @@ -190,13 +178,6 @@ Status PatchEncryption(Bucket& b, nlohmann::json const& e) { if (c.contains("restrictionMode")) { mutable_config->set_restriction_mode(c.value("restrictionMode", "")); } - if (c.contains("effectiveTime")) { - auto ts = - google::cloud::internal::ParseRfc3339(c.value("effectiveTime", "")); - if (ts) { - *mutable_config->mutable_effective_time() = ToProtoTimestamp(*ts); - } - } } }; @@ -336,7 +317,6 @@ void UpdateEncryption(Bucket& bucket, storage::BucketMetadata const& metadata) { auto update_config = [&](auto const& source, auto* dest) { if (source.restriction_mode.empty()) return; dest->set_restriction_mode(source.restriction_mode); - *dest->mutable_effective_time() = ToProtoTimestamp(source.effective_time); }; update_config( diff --git a/google/cloud/storage/internal/grpc/bucket_request_parser_test.cc b/google/cloud/storage/internal/grpc/bucket_request_parser_test.cc index 68054410cfc1f..329f6c3f47358 100644 --- a/google/cloud/storage/internal/grpc/bucket_request_parser_test.cc +++ b/google/cloud/storage/internal/grpc/bucket_request_parser_test.cc @@ -461,15 +461,12 @@ TEST(GrpcBucketRequestParser, PatchBucketRequestAllOptions) { default_kms_key: "test-only-kms-key" google_managed_encryption_enforcement_config { restriction_mode: "FullyRestricted" - effective_time { seconds: 1766175572 } } customer_managed_encryption_enforcement_config { restriction_mode: "NotRestricted" - effective_time { seconds: 1766175695 } } customer_supplied_encryption_enforcement_config { restriction_mode: "FullyRestricted" - effective_time { seconds: 1766175739 } } } autoclass { enabled: true } @@ -745,15 +742,12 @@ TEST(GrpcBucketRequestParser, UpdateBucketRequestAllOptions) { default_kms_key: "test-only-kms-key" google_managed_encryption_enforcement_config { restriction_mode: "FullyRestricted" - effective_time { seconds: 1766176065 } } customer_managed_encryption_enforcement_config { restriction_mode: "NotRestricted" - effective_time { seconds: 1766176105 } } customer_supplied_encryption_enforcement_config { restriction_mode: "FullyRestricted" - effective_time { seconds: 1766176151 } } } autoclass { enabled: true } diff --git a/google/cloud/storage/internal/grpc/configure_client_context.cc b/google/cloud/storage/internal/grpc/configure_client_context.cc index 4507f6d2af721..2d77f99dced76 100644 --- a/google/cloud/storage/internal/grpc/configure_client_context.cc +++ b/google/cloud/storage/internal/grpc/configure_client_context.cc @@ -20,6 +20,19 @@ namespace google { namespace cloud { namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { +void ApplyRoutingHeadersImpl(grpc::ClientContext& context, + std::string const& bucket_name, + RoutingHeaderOptions const& options) { + std::string params = + "bucket=" + google::cloud::internal::UrlEncode(bucket_name); + if (!options.routing_token.empty()) { + params += "&routing_token=" + + google::cloud::internal::UrlEncode(options.routing_token); + } + context.AddMetadata("x-goog-request-params", std::move(params)); +} +} // namespace auto constexpr kIdempotencyTokenHeader = "x-goog-gcs-idempotency-token"; @@ -28,7 +41,7 @@ void AddIdempotencyToken(grpc::ClientContext& ctx, auto const& headers = context.headers(); auto const l = headers.find(kIdempotencyTokenHeader); if (l != headers.end()) { - for (auto const& v : l->second) { + for (auto const& v : l->second.values()) { ctx.AddMetadata(kIdempotencyTokenHeader, v); } } @@ -44,17 +57,15 @@ void ApplyRoutingHeaders( } void ApplyRoutingHeaders(grpc::ClientContext& context, - google::storage::v2::WriteObjectSpec const& spec) { - context.AddMetadata( - "x-goog-request-params", - "bucket=" + google::cloud::internal::UrlEncode(spec.resource().bucket())); + google::storage::v2::WriteObjectSpec const& spec, + RoutingHeaderOptions const& options) { + ApplyRoutingHeadersImpl(context, spec.resource().bucket(), options); } void ApplyRoutingHeaders(grpc::ClientContext& context, - google::storage::v2::AppendObjectSpec const& spec) { - context.AddMetadata( - "x-goog-request-params", - "bucket=" + google::cloud::internal::UrlEncode(spec.bucket())); + google::storage::v2::AppendObjectSpec const& spec, + RoutingHeaderOptions const& options) { + ApplyRoutingHeadersImpl(context, spec.bucket(), options); } void ApplyRoutingHeaders(grpc::ClientContext& context, diff --git a/google/cloud/storage/internal/grpc/configure_client_context.h b/google/cloud/storage/internal/grpc/configure_client_context.h index 7c898fbe9bbd6..bbc4a4c80d226 100644 --- a/google/cloud/storage/internal/grpc/configure_client_context.h +++ b/google/cloud/storage/internal/grpc/configure_client_context.h @@ -28,6 +28,11 @@ namespace cloud { namespace storage_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +struct RoutingHeaderOptions { + // The routing token to be included in x-goog-request-params. + std::string routing_token; +}; + /// Configures @p ctx using @p context. void AddIdempotencyToken(grpc::ClientContext& ctx, rest_internal::RestContext const& context); @@ -77,11 +82,13 @@ void ApplyRoutingHeaders( /// @copydoc ApplyRoutingHeaders(grpc::ClientContext&,) void ApplyRoutingHeaders(grpc::ClientContext& context, - google::storage::v2::WriteObjectSpec const& spec); + google::storage::v2::WriteObjectSpec const& spec, + RoutingHeaderOptions const& options = {}); /// @copydoc ApplyRoutingHeaders(grpc::ClientContext&,) void ApplyRoutingHeaders(grpc::ClientContext& context, - google::storage::v2::AppendObjectSpec const& spec); + google::storage::v2::AppendObjectSpec const& spec, + RoutingHeaderOptions const& options = {}); /** * The generated `StorageMetadata` stub can not handle dynamic routing headers diff --git a/google/cloud/storage/internal/grpc/configure_client_context_test.cc b/google/cloud/storage/internal/grpc/configure_client_context_test.cc index 550f956372e69..7e18790de74d3 100644 --- a/google/cloud/storage/internal/grpc/configure_client_context_test.cc +++ b/google/cloud/storage/internal/grpc/configure_client_context_test.cc @@ -156,6 +156,20 @@ TEST_F(GrpcConfigureClientContext, ApplyRoutingHeadersInsertObject) { "bucket=projects%2F_%2Fbuckets%2Ftest-bucket"))); } +TEST_F(GrpcConfigureClientContext, + ApplyRoutingHeadersInsertObjectWithRoutingToken) { + auto spec = google::storage::v2::WriteObjectSpec{}; + spec.mutable_resource()->set_bucket("projects/_/buckets/test-bucket"); + + grpc::ClientContext context; + ApplyRoutingHeaders(context, spec, {"test-token"}); + auto metadata = GetMetadata(context); + EXPECT_THAT(metadata, + Contains(Pair("x-goog-request-params", + "bucket=projects%2F_%2Fbuckets%2Ftest-bucket&" + "routing_token=test-token"))); +} + TEST_F(GrpcConfigureClientContext, ApplyRoutingHeadersUploadChunkMatchSlash) { storage::internal::UploadChunkRequest req( "projects/_/buckets/test-bucket/blah/blah", 0, {}, @@ -222,6 +236,20 @@ TEST_F(GrpcConfigureClientContext, ApplyRoutingHeadersAppendObject) { "bucket=projects%2F_%2Fbuckets%2Ftest-bucket"))); } +TEST_F(GrpcConfigureClientContext, + ApplyRoutingHeadersAppendObjectWithRoutingToken) { + auto spec = google::storage::v2::AppendObjectSpec{}; + spec.set_bucket("projects/_/buckets/test-bucket"); + + grpc::ClientContext context; + ApplyRoutingHeaders(context, spec, {"test-token"}); + auto metadata = GetMetadata(context); + EXPECT_THAT(metadata, + Contains(Pair("x-goog-request-params", + "bucket=projects%2F_%2Fbuckets%2Ftest-bucket&" + "routing_token=test-token"))); +} + } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage_internal diff --git a/google/cloud/storage/internal/grpc/object_metadata_parser.cc b/google/cloud/storage/internal/grpc/object_metadata_parser.cc index 230cbfdcbde8b..9228c20c5983e 100644 --- a/google/cloud/storage/internal/grpc/object_metadata_parser.cc +++ b/google/cloud/storage/internal/grpc/object_metadata_parser.cc @@ -171,6 +171,19 @@ storage::ObjectMetadata FromProto(google::storage::v2::Object object, metadata.set_hard_delete_time( google::cloud::internal::ToChronoTimePoint(object.hard_delete_time())); } + if (object.has_contexts()) { + storage::ObjectContexts contexts; + for (auto& kv : *object.mutable_contexts()->mutable_custom()) { + storage::ObjectCustomContextPayload payload; + payload.value = std::move(*kv.second.mutable_value()); + payload.create_time = + google::cloud::internal::ToChronoTimePoint(kv.second.create_time()); + payload.update_time = + google::cloud::internal::ToChronoTimePoint(kv.second.update_time()); + contexts.upsert(std::move(kv.first), std::move(payload)); + } + metadata.set_contexts(std::move(contexts)); + } return metadata; } diff --git a/google/cloud/storage/internal/grpc/object_metadata_parser_test.cc b/google/cloud/storage/internal/grpc/object_metadata_parser_test.cc index a497a5b0ef7cc..b52f28122e4eb 100644 --- a/google/cloud/storage/internal/grpc/object_metadata_parser_test.cc +++ b/google/cloud/storage/internal/grpc/object_metadata_parser_test.cc @@ -79,6 +79,32 @@ TEST(GrpcClientFromProto, ObjectSimple) { } metadata: { key: "test-key-1" value: "test-value-1" } metadata: { key: "test-key-2" value: "test-value-2" } + contexts: { + custom: { + key: "custom-key-1" value: { + value: "custom-value-1" + create_time: { + seconds: 1565194924 + nanos: 456789012 + } + update_time: { + seconds: 1565194924 + nanos: 456789012 + } + }} + custom: { + key: "custom-key-2" value: { + value: "custom-value-2" + create_time: { + seconds: 1565194924 + nanos: 456789012 + } + update_time: { + seconds: 1709555696 + nanos: 987654321 + } + }} + } event_based_hold: true name: "test-object-name" bucket: "test-bucket" @@ -141,6 +167,20 @@ TEST(GrpcClientFromProto, ObjectSimple) { "test-key-1": "test-value-1", "test-key-2": "test-value-2" }, + "contexts": { + "custom": { + "custom-key-1": { + "value": "custom-value-1", + "createTime": "2019-08-07T16:22:04.456789012Z", + "updateTime": "2019-08-07T16:22:04.456789012Z" + }, + "custom-key-2": { + "value": "custom-value-2", + "createTime": "2019-08-07T16:22:04.456789012Z", + "updateTime": "2024-03-04T12:34:56.987654321Z" + } + } + }, "eventBasedHold": true, "name": "test-object-name", "id": "test-bucket/test-object-name/2345", diff --git a/google/cloud/storage/internal/grpc/object_request_parser.cc b/google/cloud/storage/internal/grpc/object_request_parser.cc index 934dded5ce5b5..5c6e1027a2d72 100644 --- a/google/cloud/storage/internal/grpc/object_request_parser.cc +++ b/google/cloud/storage/internal/grpc/object_request_parser.cc @@ -23,6 +23,7 @@ #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/time_utils.h" #include "absl/strings/str_cat.h" +#include #include namespace google { @@ -155,6 +156,15 @@ Status SetObjectMetadata(google::storage::v2::Object& resource, *resource.mutable_custom_time() = google::cloud::internal::ToProtoTimestamp(metadata.custom_time()); } + if (metadata.has_contexts()) { + auto& custom_map = *resource.mutable_contexts()->mutable_custom(); + for (auto const& kv : metadata.contexts().custom()) { + // In request, the create_time and update_time are ignored by the server, + // hence there is no need to parse them. + custom_map[kv.first].set_value(kv.second.value); + } + } + return Status{}; } @@ -257,6 +267,48 @@ Status FinalizeChecksums(google::storage::v2::ObjectChecksums& checksums, return {}; } +void PatchGrpcMetadata(storage::ObjectMetadataPatchBuilder const& patch_builder, + google::storage::v2::UpdateObjectRequest& result, + google::storage::v2::Object& object) { + auto const& subpatch = + storage::internal::PatchBuilderDetails::GetMetadataSubPatch( + patch_builder); + if (subpatch.is_null()) { + object.clear_metadata(); + result.mutable_update_mask()->add_paths("metadata"); + } else { + for (auto const& kv : subpatch.items()) { + result.mutable_update_mask()->add_paths("metadata." + kv.key()); + auto const& v = kv.value(); + if (!v.is_string()) continue; + (*object.mutable_metadata())[kv.key()] = v.get(); + } + } +} + +void PatchGrpcContexts(storage::ObjectMetadataPatchBuilder const& patch_builder, + google::storage::v2::UpdateObjectRequest& result, + google::storage::v2::Object& object) { + auto const& contexts_subpatch = + storage::internal::PatchBuilderDetails::GetCustomContextsSubPatch( + patch_builder); + if (contexts_subpatch.is_null()) { + object.clear_contexts(); + result.mutable_update_mask()->add_paths("contexts.custom"); + } else { + for (auto const& kv : contexts_subpatch.items()) { + result.mutable_update_mask()->add_paths("contexts.custom." + kv.key()); + auto const& v = kv.value(); + if (v.is_object() && v.contains("value")) { + std::string value_str = v["value"].get(); + auto& payload = + (*object.mutable_contexts()->mutable_custom())[kv.key()]; + payload.set_value(std::move(value_str)); + } + } + } +} + } // namespace StatusOr ToProto( @@ -276,6 +328,13 @@ StatusOr ToProto( for (auto const& kv : metadata.metadata()) { (*destination.mutable_metadata())[kv.first] = kv.second; } + if (metadata.has_contexts()) { + for (auto const& kv : metadata.contexts().custom()) { + auto& payload = + (*destination.mutable_contexts()->mutable_custom())[kv.first]; + payload.set_value(kv.second.value); + } + } destination.set_content_encoding(metadata.content_encoding()); destination.set_content_disposition(metadata.content_disposition()); destination.set_cache_control(metadata.cache_control()); @@ -441,20 +500,8 @@ StatusOr ToProto( result.mutable_update_mask()->add_paths(field.grpc_name); } - auto const& subpatch = - storage::internal::PatchBuilderDetails::GetMetadataSubPatch( - request.patch()); - if (subpatch.is_null()) { - object.clear_metadata(); - result.mutable_update_mask()->add_paths("metadata"); - } else { - for (auto const& kv : subpatch.items()) { - result.mutable_update_mask()->add_paths("metadata." + kv.key()); - auto const& v = kv.value(); - if (!v.is_string()) continue; - (*object.mutable_metadata())[kv.key()] = v.get(); - } - } + PatchGrpcMetadata(request.patch(), result, object); + PatchGrpcContexts(request.patch(), result, object); // We need to check each modifiable field. struct StringField { @@ -510,6 +557,19 @@ StatusOr ToProto( (*object.mutable_metadata())[kv.first] = kv.second; } + if (request.metadata().has_contexts()) { + result.mutable_update_mask()->add_paths("contexts"); + auto& custom_map = *object.mutable_contexts()->mutable_custom(); + + for (auto const& kv : request.metadata().contexts().custom()) { + google::storage::v2::ObjectCustomContextPayload& payload_ref = + custom_map[kv.first]; + // In request, the create_time and update_time are ignored by + // the server, hence there is no need to parse them. + payload_ref.set_value(kv.second.value); + } + } + if (request.metadata().has_custom_time()) { result.mutable_update_mask()->add_paths("custom_time"); *object.mutable_custom_time() = google::cloud::internal::ToProtoTimestamp( diff --git a/google/cloud/storage/internal/grpc/object_request_parser_test.cc b/google/cloud/storage/internal/grpc/object_request_parser_test.cc index 8b91d9b8018f9..a429dd70f2718 100644 --- a/google/cloud/storage/internal/grpc/object_request_parser_test.cc +++ b/google/cloud/storage/internal/grpc/object_request_parser_test.cc @@ -88,6 +88,12 @@ google::storage::v2::Object ExpectedFullObjectMetadata() { temporary_hold: true metadata: { key: "test-metadata-key1" value: "test-value1" } metadata: { key: "test-metadata-key2" value: "test-value2" } + contexts: { + custom: { + key: "custom-key-1" + value: { value: "custom-value-1" } + } + } event_based_hold: true custom_time { seconds: 1643126687 nanos: 123000000 } )pb"; @@ -113,6 +119,8 @@ storage::ObjectMetadata FullObjectMetadata() { .set_temporary_hold(true) .upsert_metadata("test-metadata-key1", "test-value1") .upsert_metadata("test-metadata-key2", "test-value2") + .set_contexts(storage::ObjectContexts().upsert( + "custom-key-1", {"custom-value-1", {}, {}})) .set_event_based_hold(true) .set_custom_time(std::chrono::system_clock::time_point{} + std::chrono::seconds(1643126687) + @@ -479,6 +487,7 @@ TEST(GrpcObjectRequestParser, PatchObjectRequestAllOptions) { .SetContentType("test-content-type") .SetMetadata("test-metadata-key1", "test-value1") .SetMetadata("test-metadata-key2", "test-value2") + .SetContext("custom-key-1", "custom-value-1") .SetTemporaryHold(true) .SetAcl({ storage::ObjectAccessControl{} @@ -505,12 +514,13 @@ TEST(GrpcObjectRequestParser, PatchObjectRequestAllOptions) { ASSERT_STATUS_OK(actual); // First check the paths. We do not care about their order, so checking them // with IsProtoEqual does not work. - EXPECT_THAT(actual->update_mask().paths(), - UnorderedElementsAre( - "acl", "content_encoding", "content_disposition", - "cache_control", "content_language", "content_type", - "metadata.test-metadata-key1", "metadata.test-metadata-key2", - "temporary_hold", "event_based_hold", "custom_time")); + EXPECT_THAT( + actual->update_mask().paths(), + UnorderedElementsAre( + "acl", "content_encoding", "content_disposition", "cache_control", + "content_language", "content_type", "metadata.test-metadata-key1", + "metadata.test-metadata-key2", "temporary_hold", "event_based_hold", + "custom_time", "contexts.custom.custom-key-1")); // Clear the paths, which we already compared, and compare the proto. actual->mutable_update_mask()->clear_paths(); EXPECT_THAT(*actual, IsProtoEqual(expected)); @@ -535,6 +545,7 @@ TEST(GrpcObjectRequestParser, PatchObjectRequestAllResets) { .ResetContentType() .ResetEventBasedHold() .ResetMetadata() + .ResetContexts() .ResetTemporaryHold() .ResetCustomTime()); @@ -547,7 +558,7 @@ TEST(GrpcObjectRequestParser, PatchObjectRequestAllResets) { UnorderedElementsAre("acl", "content_encoding", "content_disposition", "cache_control", "content_language", "content_type", "metadata", "temporary_hold", "event_based_hold", - "custom_time")); + "custom_time", "contexts.custom")); // Clear the paths, which we already compared, and compare the proto. actual->mutable_update_mask()->clear_paths(); EXPECT_THAT(*actual, IsProtoEqual(expected)); @@ -604,6 +615,64 @@ TEST(GrpcObjectRequestParser, PatchObjectRequestResetMetadata) { EXPECT_THAT(*actual, IsProtoEqual(expected)); } +TEST(GrpcObjectRequestParser, PatchObjectRequestContexts) { + auto constexpr kTextProto = R"pb( + object { + bucket: "projects/_/buckets/bucket-name" + name: "object-name" + contexts: { + custom: { + key: "custom-key-1" + value: { value: "custom-value-1" } + } + } + } + update_mask {} + )pb"; + google::storage::v2::UpdateObjectRequest expected; + ASSERT_TRUE(TextFormat::ParseFromString(kTextProto, &expected)); + + storage::internal::PatchObjectRequest req( + "bucket-name", "object-name", + storage::ObjectMetadataPatchBuilder{} + .SetContext("custom-key-1", "custom-value-1") + .ResetContext("custom-key-2")); + + auto actual = ToProto(req); + ASSERT_STATUS_OK(actual); + // First check the paths. We do not care about their order, so checking them + // with IsProtoEqual does not work. + EXPECT_THAT(actual->update_mask().paths(), + UnorderedElementsAre("contexts.custom.custom-key-1", + "contexts.custom.custom-key-2")); + // Clear the paths, which we already compared, and compare the proto. + actual->mutable_update_mask()->clear_paths(); + EXPECT_THAT(*actual, IsProtoEqual(expected)); +} + +TEST(GrpcObjectRequestParser, PatchObjectRequestResetContexts) { + auto constexpr kTextProto = R"pb( + object { bucket: "projects/_/buckets/bucket-name" name: "object-name" } + update_mask {} + )pb"; + google::storage::v2::UpdateObjectRequest expected; + ASSERT_TRUE(TextFormat::ParseFromString(kTextProto, &expected)); + + storage::internal::PatchObjectRequest req( + "bucket-name", "object-name", + storage::ObjectMetadataPatchBuilder{}.ResetContexts()); + + auto actual = ToProto(req); + ASSERT_STATUS_OK(actual); + // First check the paths. We do not care about their order, so checking them + // with IsProtoEqual does not work. + EXPECT_THAT(actual->update_mask().paths(), + UnorderedElementsAre("contexts.custom")); + // Clear the paths, which we already compared, and compare the proto. + actual->mutable_update_mask()->clear_paths(); + EXPECT_THAT(*actual, IsProtoEqual(expected)); +} + TEST(GrpcObjectRequestParser, UpdateObjectRequestAllOptions) { auto constexpr kTextProto = R"pb( predefined_acl: "projectPrivate" @@ -643,7 +712,7 @@ TEST(GrpcObjectRequestParser, UpdateObjectRequestAllOptions) { UnorderedElementsAre("acl", "content_encoding", "content_disposition", "cache_control", "content_language", "content_type", "metadata", "temporary_hold", "event_based_hold", - "custom_time")); + "custom_time", "contexts")); // Clear the paths, which we already compared, and test the rest actual->mutable_update_mask()->clear_paths(); EXPECT_THAT(*actual, IsProtoEqual(expected)); diff --git a/google/cloud/storage/internal/object_metadata_parser.cc b/google/cloud/storage/internal/object_metadata_parser.cc index 4f5e7efa20795..c5fd977e43337 100644 --- a/google/cloud/storage/internal/object_metadata_parser.cc +++ b/google/cloud/storage/internal/object_metadata_parser.cc @@ -36,14 +36,32 @@ namespace { * This simplifies the implementation of ToJsonString() because we repeat this * check for many attributes. */ -void SetIfNotEmpty(nlohmann::json& json, char const* key, - std::string const& value) { - if (value.empty()) { - return; - } +void SetIfNotEmpty(char const* key, std::string const& value, + nlohmann::json& json) { + if (value.empty()) return; json[key] = value; } +/** + * Populates the "contexts" field in the JSON object from the given metadata. + */ +void SetJsonContextsIfNotEmpty(ObjectMetadata const& meta, + nlohmann::json& json) { + if (!meta.has_contexts()) return; + + nlohmann::json custom_json; + for (auto const& kv : meta.contexts().custom()) { + nlohmann::json item; + item["value"] = kv.second.value; + item["createTime"] = + google::cloud::internal::FormatRfc3339(kv.second.create_time); + item["updateTime"] = + google::cloud::internal::FormatRfc3339(kv.second.update_time); + custom_json[kv.first] = std::move(item); + } + json["contexts"] = nlohmann::json{{"custom", std::move(custom_json)}}; +} + Status ParseAcl(ObjectMetadata& meta, nlohmann::json const& json) { auto i = json.find("acl"); if (i == json.end()) return Status{}; @@ -160,6 +178,36 @@ Status ParseRetention(ObjectMetadata& meta, nlohmann::json const& json) { return Status{}; } +Status ParseContexts(ObjectMetadata& meta, nlohmann::json const& json) { + auto f_contexts = json.find("contexts"); + if (f_contexts == json.end()) return Status{}; + + auto f_custom = f_contexts->find("custom"); + if (f_custom == f_contexts->end()) return Status{}; + + ObjectContexts contexts; + for (auto const& kv : f_custom->items()) { + auto const& payload_json = kv.value(); + ObjectCustomContextPayload payload; + + payload.value = payload_json.value("value", ""); + + auto create_time = + internal::ParseTimestampField(payload_json, "createTime"); + if (!create_time) return std::move(create_time).status(); + payload.create_time = *create_time; + + auto update_time = + internal::ParseTimestampField(payload_json, "updateTime"); + if (!update_time) return std::move(update_time).status(); + payload.update_time = *update_time; + + contexts.upsert(kv.key(), std::move(payload)); + } + meta.set_contexts(std::move(contexts)); + return Status{}; +} + Status ParseSize(ObjectMetadata& meta, nlohmann::json const& json) { auto v = internal::ParseUnsignedLongField(json, "size"); if (!v) return std::move(v).status(); @@ -296,6 +344,7 @@ StatusOr ObjectMetadataParser::FromJson( ParseOwner, ParseRetentionExpirationTime, ParseRetention, + ParseContexts, [](ObjectMetadata& meta, nlohmann::json const& json) { return SetStringField(meta, json, "selfLink", &ObjectMetadata::set_self_link); @@ -332,25 +381,25 @@ nlohmann::json ObjectMetadataJsonForCompose(ObjectMetadata const& meta) { if (!meta.acl().empty()) { for (ObjectAccessControl const& a : meta.acl()) { nlohmann::json entry; - SetIfNotEmpty(entry, "entity", a.entity()); - SetIfNotEmpty(entry, "role", a.role()); + SetIfNotEmpty("entity", a.entity(), entry); + SetIfNotEmpty("role", a.role(), entry); metadata_as_json["acl"].emplace_back(std::move(entry)); } } - SetIfNotEmpty(metadata_as_json, "cacheControl", meta.cache_control()); - SetIfNotEmpty(metadata_as_json, "contentDisposition", - meta.content_disposition()); - SetIfNotEmpty(metadata_as_json, "contentEncoding", meta.content_encoding()); - SetIfNotEmpty(metadata_as_json, "contentLanguage", meta.content_language()); - SetIfNotEmpty(metadata_as_json, "contentType", meta.content_type()); + SetIfNotEmpty("cacheControl", meta.cache_control(), metadata_as_json); + SetIfNotEmpty("contentDisposition", meta.content_disposition(), + metadata_as_json); + SetIfNotEmpty("contentEncoding", meta.content_encoding(), metadata_as_json); + SetIfNotEmpty("contentLanguage", meta.content_language(), metadata_as_json); + SetIfNotEmpty("contentType", meta.content_type(), metadata_as_json); if (meta.event_based_hold()) { metadata_as_json["eventBasedHold"] = true; } - SetIfNotEmpty(metadata_as_json, "name", meta.name()); - SetIfNotEmpty(metadata_as_json, "storageClass", meta.storage_class()); + SetIfNotEmpty("name", meta.name(), metadata_as_json); + SetIfNotEmpty("storageClass", meta.storage_class(), metadata_as_json); if (!meta.metadata().empty()) { nlohmann::json meta_as_json; @@ -372,6 +421,8 @@ nlohmann::json ObjectMetadataJsonForCompose(ObjectMetadata const& meta) { meta.retention().retain_until_time)}}; } + SetJsonContextsIfNotEmpty(meta, metadata_as_json); + return metadata_as_json; } @@ -381,8 +432,8 @@ nlohmann::json ObjectMetadataJsonForCopy(ObjectMetadata const& meta) { nlohmann::json ObjectMetadataJsonForInsert(ObjectMetadata const& meta) { auto json = ObjectMetadataJsonForCompose(meta); - SetIfNotEmpty(json, "crc32c", meta.crc32c()); - SetIfNotEmpty(json, "md5Hash", meta.md5_hash()); + SetIfNotEmpty("crc32c", meta.crc32c(), json); + SetIfNotEmpty("md5Hash", meta.md5_hash(), json); return json; } @@ -395,18 +446,18 @@ nlohmann::json ObjectMetadataJsonForUpdate(ObjectMetadata const& meta) { if (!meta.acl().empty()) { for (ObjectAccessControl const& a : meta.acl()) { nlohmann::json entry; - SetIfNotEmpty(entry, "entity", a.entity()); - SetIfNotEmpty(entry, "role", a.role()); + SetIfNotEmpty("entity", a.entity(), entry); + SetIfNotEmpty("role", a.role(), entry); metadata_as_json["acl"].emplace_back(std::move(entry)); } } - SetIfNotEmpty(metadata_as_json, "cacheControl", meta.cache_control()); - SetIfNotEmpty(metadata_as_json, "contentDisposition", - meta.content_disposition()); - SetIfNotEmpty(metadata_as_json, "contentEncoding", meta.content_encoding()); - SetIfNotEmpty(metadata_as_json, "contentLanguage", meta.content_language()); - SetIfNotEmpty(metadata_as_json, "contentType", meta.content_type()); + SetIfNotEmpty("cacheControl", meta.cache_control(), metadata_as_json); + SetIfNotEmpty("contentDisposition", meta.content_disposition(), + metadata_as_json); + SetIfNotEmpty("contentEncoding", meta.content_encoding(), metadata_as_json); + SetIfNotEmpty("contentLanguage", meta.content_language(), metadata_as_json); + SetIfNotEmpty("contentType", meta.content_type(), metadata_as_json); metadata_as_json["eventBasedHold"] = meta.event_based_hold(); @@ -430,6 +481,8 @@ nlohmann::json ObjectMetadataJsonForUpdate(ObjectMetadata const& meta) { meta.retention().retain_until_time)}}; } + SetJsonContextsIfNotEmpty(meta, metadata_as_json); + return metadata_as_json; } diff --git a/google/cloud/storage/internal/object_requests.cc b/google/cloud/storage/internal/object_requests.cc index 37857aff7bfdc..39d2c968cf271 100644 --- a/google/cloud/storage/internal/object_requests.cc +++ b/google/cloud/storage/internal/object_requests.cc @@ -37,6 +37,73 @@ namespace storage { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace internal { namespace { +void DiffMetadata(ObjectMetadata const& original, ObjectMetadata const& updated, + ObjectMetadataPatchBuilder& builder) { + if (original.metadata() == updated.metadata()) return; + + if (updated.metadata().empty()) { + builder.ResetMetadata(); + return; + } + + std::map difference; + std::set_difference(original.metadata().begin(), original.metadata().end(), + updated.metadata().begin(), updated.metadata().end(), + std::inserter(difference, difference.end()), + original.metadata().value_comp()); + for (auto& d : difference) { + builder.ResetMetadata(std::move(d.first)); + } + + difference.clear(); + std::set_difference(updated.metadata().begin(), updated.metadata().end(), + original.metadata().begin(), original.metadata().end(), + std::inserter(difference, difference.end())); + for (auto& d : difference) { + builder.SetMetadata(std::move(d.first), std::move(d.second)); + } +} + +void DiffContexts(ObjectMetadata const& original, ObjectMetadata const& updated, + ObjectMetadataPatchBuilder& builder) { + bool is_original_empty = + !original.has_contexts() || original.contexts().custom().empty(); + bool is_updated_empty = + !updated.has_contexts() || updated.contexts().custom().empty(); + + if (!is_original_empty && is_updated_empty) { + builder.ResetContexts(); + } else if (is_original_empty && !is_updated_empty) { + for (auto const& c : updated.contexts().custom()) { + builder.SetContext(c.first, c.second.value); + } + } else if (!is_original_empty && !is_updated_empty) { + if (original.contexts() != updated.contexts()) { + std::map deleted_entries; + std::set_difference( + original.contexts().custom().begin(), + original.contexts().custom().end(), + updated.contexts().custom().begin(), + updated.contexts().custom().end(), + std::inserter(deleted_entries, deleted_entries.end()), + [](auto const& a, auto const& b) { return a.first < b.first; }); + for (auto& d : deleted_entries) { + builder.ResetContext(std::move(d.first)); + } + + std::map changed_entries; + std::set_difference( + updated.contexts().custom().begin(), + updated.contexts().custom().end(), + original.contexts().custom().begin(), + original.contexts().custom().end(), + std::inserter(changed_entries, changed_entries.end())); + for (auto& d : changed_entries) { + builder.SetContext(std::move(d.first), std::move(d.second.value)); + } + } + } +} ObjectMetadataPatchBuilder DiffObjectMetadata(ObjectMetadata const& original, ObjectMetadata const& updated) { @@ -65,37 +132,8 @@ ObjectMetadataPatchBuilder DiffObjectMetadata(ObjectMetadata const& original, builder.SetEventBasedHold(updated.event_based_hold()); } - if (original.metadata() != updated.metadata()) { - if (updated.metadata().empty()) { - builder.ResetMetadata(); - } else { - std::map difference; - // Find the keys in the original map that are not in the new map. Using - // `std::set_difference()` works because, unlike `std::unordered_map` the - // `std::map` iterators return elements ordered by key: - std::set_difference(original.metadata().begin(), - original.metadata().end(), updated.metadata().begin(), - updated.metadata().end(), - std::inserter(difference, difference.end()), - // We want to compare just keys and ignore values, the - // map class provides such a function, so use it: - original.metadata().value_comp()); - for (auto&& d : difference) { - builder.ResetMetadata(d.first); - } - - // Find the elements (comparing key and value) in the updated map that - // are not in the original map: - difference.clear(); - std::set_difference(updated.metadata().begin(), updated.metadata().end(), - original.metadata().begin(), - original.metadata().end(), - std::inserter(difference, difference.end())); - for (auto&& d : difference) { - builder.SetMetadata(d.first, d.second); - } - } - } + DiffMetadata(original, updated, builder); + DiffContexts(original, updated, builder); if (original.temporary_hold() != updated.temporary_hold()) { builder.SetTemporaryHold(updated.temporary_hold()); diff --git a/google/cloud/storage/internal/object_requests_test.cc b/google/cloud/storage/internal/object_requests_test.cc index 4e25fc2d11036..cf4e893d8293d 100644 --- a/google/cloud/storage/internal/object_requests_test.cc +++ b/google/cloud/storage/internal/object_requests_test.cc @@ -749,6 +749,20 @@ ObjectMetadata CreateObjectMetadataForTest() { "foo": "bar", "baz": "qux" }, + "contexts": { + "custom": { + "environment": { + "value": "prod", + "createTime": "2024-07-18T00:00:00Z", + "updateTime": "2024-07-18T00:00:00Z" + }, + "department": { + "value": "human resource", + "createTime": "2024-07-18T00:00:00Z", + "updateTime": "2024-07-18T00:00:00Z" + } + } + }, "metageneration": "4", "name": "baz", "owner": { @@ -964,6 +978,65 @@ TEST(PatchObjectRequestTest, DiffResetMetadata) { EXPECT_EQ(expected, patch); } +TEST(PatchObjectRequestTest, DiffSetContexts) { + ObjectMetadata original = CreateObjectMetadataForTest(); + + ObjectMetadata updated = original; + ObjectContexts contexts; + contexts.upsert("department", {"engineering", {}, {}}) + .upsert("environment", {"preprod", {}, {}}); + updated.set_contexts(contexts); + + PatchObjectRequest request("test-bucket", "test-object", original, updated); + + auto patch = nlohmann::json::parse(request.payload()); + auto expected = nlohmann::json::parse(R"""({ + "contexts": { + "custom": { + "environment": { + "value": "preprod" + }, + "department": { + "value": "engineering" + } + } + } + })"""); + EXPECT_EQ(expected, patch); +} + +TEST(PatchObjectRequestTest, DiffResetOneContext) { + ObjectMetadata original = CreateObjectMetadataForTest(); + ObjectMetadata updated = original; + ObjectContexts contexts = updated.contexts(); + contexts.delete_key("environment"); + updated.set_contexts(contexts); + + PatchObjectRequest request("test-bucket", "test-object", original, updated); + + auto patch = nlohmann::json::parse(request.payload()); + auto expected = nlohmann::json::parse(R"""({ + "contexts": { + "custom": { + "environment": null + } + } + })"""); + EXPECT_EQ(expected, patch); +} + +TEST(PatchObjectRequestTest, DiffResetContexts) { + ObjectMetadata original = CreateObjectMetadataForTest(); + ObjectMetadata updated = original; + updated.reset_contexts(); + PatchObjectRequest request("test-bucket", "test-object", original, updated); + + auto patch = nlohmann::json::parse(request.payload()); + auto expected = + nlohmann::json::parse(R"""({"contexts": {"custom": null}})"""); + EXPECT_EQ(expected, patch); +} + TEST(PatchObjectRequestTest, DiffSetTemporaryHold) { ObjectMetadata original = CreateObjectMetadataForTest(); original.set_temporary_hold(false); diff --git a/google/cloud/storage/internal/patch_builder_details.cc b/google/cloud/storage/internal/patch_builder_details.cc index 9a4ab7c8db5a9..fe634a54b717d 100644 --- a/google/cloud/storage/internal/patch_builder_details.cc +++ b/google/cloud/storage/internal/patch_builder_details.cc @@ -62,6 +62,15 @@ nlohmann::json const& PatchBuilderDetails::GetMetadataSubPatch( return GetPatch(patch.metadata_subpatch_); } +nlohmann::json const& PatchBuilderDetails::GetCustomContextsSubPatch( + storage::ObjectMetadataPatchBuilder const& patch) { + static auto const* const kEmpty = [] { + return new nlohmann::json(nlohmann::json::object()); + }(); + if (!patch.contexts_subpatch_dirty_) return *kEmpty; + return GetPatch(patch.contexts_custom_subpatch_); +} + } // namespace internal GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace storage diff --git a/google/cloud/storage/internal/patch_builder_details.h b/google/cloud/storage/internal/patch_builder_details.h index 4231b156f5560..681cc8e92ba58 100644 --- a/google/cloud/storage/internal/patch_builder_details.h +++ b/google/cloud/storage/internal/patch_builder_details.h @@ -53,6 +53,8 @@ struct PatchBuilderDetails { storage::ObjectMetadataPatchBuilder const& patch); static nlohmann::json const& GetMetadataSubPatch( storage::ObjectMetadataPatchBuilder const& patch); + static nlohmann::json const& GetCustomContextsSubPatch( + storage::ObjectMetadataPatchBuilder const& patch); static nlohmann::json const& GetPatch(PatchBuilder const& patch); }; diff --git a/google/cloud/storage/internal/rest/stub_test.cc b/google/cloud/storage/internal/rest/stub_test.cc index 05202648577d2..51540b8824f6e 100644 --- a/google/cloud/storage/internal/rest/stub_test.cc +++ b/google/cloud/storage/internal/rest/stub_test.cc @@ -178,12 +178,9 @@ TEST(RestStubTest, GlobalCustomHeadersAppearInRequestTest) { google::cloud::rest_internal::RestRequest const& request) { auto const& headers = request.headers(); EXPECT_THAT(headers, - Contains(Pair("custom-header-1", - std::vector{"value1"}))); + Contains(Pair("custom-header-1", ElementsAre("value1")))); EXPECT_THAT(headers, - Contains(Pair("custom-header-2", - std::vector{"value2"}))); - + Contains(Pair("custom-header-2", ElementsAre("value2")))); return PermanentError(); }); auto stub = std::make_unique(global_opts, mock_client, mock_client); diff --git a/google/cloud/storage/mocks/mock_async_object_descriptor_connection.h b/google/cloud/storage/mocks/mock_async_object_descriptor_connection.h index f0e089ac4dada..ad4f2aa94783b 100644 --- a/google/cloud/storage/mocks/mock_async_object_descriptor_connection.h +++ b/google/cloud/storage/mocks/mock_async_object_descriptor_connection.h @@ -33,6 +33,7 @@ class MockAsyncObjectDescriptorConnection (ReadParams), (override)); MOCK_METHOD(void, MakeSubsequentStream, (), (override)); MOCK_METHOD(Options, options, (), (const, override)); + MOCK_METHOD(bool, IsOpen, (), (const, override)); }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END diff --git a/google/cloud/storage/object_contexts.cc b/google/cloud/storage/object_contexts.cc new file mode 100644 index 0000000000000..58538eb6a0d13 --- /dev/null +++ b/google/cloud/storage/object_contexts.cc @@ -0,0 +1,49 @@ +// Copyright 2026 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 "google/cloud/storage/object_contexts.h" +#include "google/cloud/internal/format_time_point.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace storage { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::ostream& operator<<(std::ostream& os, + ObjectCustomContextPayload const& rhs) { + return os << "ObjectCustomContextPayload{value=" << rhs.value + << ", createTime=" + << google::cloud::internal::FormatRfc3339(rhs.create_time) + << ", updateTime=" + << google::cloud::internal::FormatRfc3339(rhs.update_time) << "}"; +} + +std::ostream& operator<<(std::ostream& os, ObjectContexts const& rhs) { + os << "ObjectContexts{custom={"; + char const* sep = ""; + for (auto const& kv : rhs.custom()) { + os << sep << kv.first << "=" << kv.second; + sep = ", "; + } + + return os << "}}"; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace storage +} // namespace cloud +} // namespace google diff --git a/google/cloud/storage/object_contexts.h b/google/cloud/storage/object_contexts.h new file mode 100644 index 0000000000000..fbe6dd7991210 --- /dev/null +++ b/google/cloud/storage/object_contexts.h @@ -0,0 +1,105 @@ +// Copyright 2026 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. + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OBJECT_CONTEXTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OBJECT_CONTEXTS_H + +#include "google/cloud/storage/version.h" +#include "google/cloud/status.h" +#include "absl/types/optional.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace storage { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Represents the payload of a user-defined object context. + */ +struct ObjectCustomContextPayload { + // The value of the object context. + std::string value; + + // The time at which the object context was created. Output only. + std::chrono::system_clock::time_point create_time; + + // The time at which the object context was last updated. Output only. + std::chrono::system_clock::time_point update_time; +}; + +inline bool operator==(ObjectCustomContextPayload const& lhs, + ObjectCustomContextPayload const& rhs) { + return lhs.value == rhs.value; +}; + +inline bool operator!=(ObjectCustomContextPayload const& lhs, + ObjectCustomContextPayload const& rhs) { + return !(lhs == rhs); +} + +inline bool operator<(ObjectCustomContextPayload const& lhs, + ObjectCustomContextPayload const& rhs) { + return lhs.value < rhs.value; +} + +std::ostream& operator<<(std::ostream& os, + ObjectCustomContextPayload const& rhs); + +/** + * Specifies the custom contexts of an object. + */ +class ObjectContexts { + public: + bool has_key(std::string const& key) const { + return custom_.find(key) != custom_.end(); + } + + ObjectContexts& upsert(std::string const& key, + ObjectCustomContextPayload const& value) { + custom_[key] = value; + return *this; + } + + bool delete_key(std::string const& key) { return custom_.erase(key) > 0; } + + std::map const& custom() const { + return custom_; + } + + friend bool operator==(ObjectContexts const& lhs, ObjectContexts const& rhs) { + return lhs.custom_ == rhs.custom_; + } + + friend bool operator!=(ObjectContexts const& lhs, ObjectContexts const& rhs) { + return !(lhs == rhs); + } + + private: + /** + * Represents the map of user-defined object contexts. + */ + std::map custom_; +}; + +std::ostream& operator<<(std::ostream& os, ObjectContexts const& rhs); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace storage +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OBJECT_CONTEXTS_H diff --git a/google/cloud/storage/object_metadata.cc b/google/cloud/storage/object_metadata.cc index 68e18262ce9d9..82590845179ea 100644 --- a/google/cloud/storage/object_metadata.cc +++ b/google/cloud/storage/object_metadata.cc @@ -73,6 +73,7 @@ bool operator==(ObjectMetadata const& lhs, ObjectMetadata const& rhs) { && lhs.updated_ == rhs.updated_ // && lhs.soft_delete_time_ == rhs.soft_delete_time_ // && lhs.hard_delete_time_ == rhs.hard_delete_time_ // + && lhs.contexts_ == rhs.contexts_ // ; } @@ -133,6 +134,9 @@ std::ostream& operator<<(std::ostream& os, ObjectMetadata const& rhs) { if (rhs.has_hard_delete_time()) { os << ", hard_delete_time=" << FormatRfc3339(rhs.hard_delete_time()); } + if (rhs.has_contexts()) { + os << ", contexts=" << rhs.contexts(); + } return os << "}"; } @@ -145,6 +149,15 @@ std::string ObjectMetadataPatchBuilder::BuildPatch() const { tmp.AddSubPatch("metadata", metadata_subpatch_); } } + if (contexts_subpatch_dirty_) { + if (contexts_custom_subpatch_.empty()) { + tmp.AddSubPatch("contexts", + internal::PatchBuilder().RemoveField("custom")); + } else { + tmp.AddSubPatch("contexts", internal::PatchBuilder().AddSubPatch( + "custom", contexts_custom_subpatch_)); + } + } return tmp.ToString(); } @@ -271,6 +284,27 @@ ObjectMetadataPatchBuilder& ObjectMetadataPatchBuilder::ResetMetadata() { return *this; } +ObjectMetadataPatchBuilder& ObjectMetadataPatchBuilder::SetContext( + std::string const& key, std::string const& value) { + contexts_custom_subpatch_.AddSubPatch( + key.c_str(), internal::PatchBuilder().SetStringField("value", value)); + contexts_subpatch_dirty_ = true; + return *this; +} + +ObjectMetadataPatchBuilder& ObjectMetadataPatchBuilder::ResetContext( + std::string const& key) { + contexts_custom_subpatch_.RemoveField(key.c_str()); + contexts_subpatch_dirty_ = true; + return *this; +} + +ObjectMetadataPatchBuilder& ObjectMetadataPatchBuilder::ResetContexts() { + contexts_custom_subpatch_.clear(); + contexts_subpatch_dirty_ = true; + return *this; +} + ObjectMetadataPatchBuilder& ObjectMetadataPatchBuilder::SetTemporaryHold( bool v) { impl_.SetBoolField("temporaryHold", v); diff --git a/google/cloud/storage/object_metadata.h b/google/cloud/storage/object_metadata.h index bc40bb6706899..c5e367fd46962 100644 --- a/google/cloud/storage/object_metadata.h +++ b/google/cloud/storage/object_metadata.h @@ -17,6 +17,7 @@ #include "google/cloud/storage/internal/complex_option.h" #include "google/cloud/storage/object_access_control.h" +#include "google/cloud/storage/object_contexts.h" #include "google/cloud/storage/object_retention.h" #include "google/cloud/storage/owner.h" #include "google/cloud/storage/version.h" @@ -450,6 +451,29 @@ class ObjectMetadata { return *this; } + /// Returns `true` if the object has custom contexts. + bool has_contexts() const { return contexts_.has_value(); } + + /** + * The object's user custom contexts. + * + * It is undefined behavior to call this member function if + * `has_contexts() == false`. + */ + ObjectContexts const& contexts() const { return *contexts_; } + + /// Change or set the object's custom contexts. + ObjectMetadata& set_contexts(ObjectContexts v) { + contexts_ = std::move(v); + return *this; + } + + /// Reset the object contexts. + ObjectMetadata& reset_contexts() { + contexts_.reset(); + return *this; + } + /// An HTTPS link to the object metadata. std::string const& self_link() const { return self_link_; } @@ -612,6 +636,7 @@ class ObjectMetadata { std::string md5_hash_; std::string media_link_; std::map metadata_; + absl::optional contexts_; std::string name_; absl::optional owner_; std::chrono::system_clock::time_point retention_expiration_time_; @@ -675,6 +700,11 @@ class ObjectMetadataPatchBuilder { ObjectMetadataPatchBuilder& ResetMetadata(std::string const& key); ObjectMetadataPatchBuilder& ResetMetadata(); + ObjectMetadataPatchBuilder& SetContext(std::string const& key, + std::string const& value); + ObjectMetadataPatchBuilder& ResetContext(std::string const& key); + ObjectMetadataPatchBuilder& ResetContexts(); + ObjectMetadataPatchBuilder& SetTemporaryHold(bool v); ObjectMetadataPatchBuilder& ResetTemporaryHold(); @@ -703,6 +733,8 @@ class ObjectMetadataPatchBuilder { internal::PatchBuilder impl_; bool metadata_subpatch_dirty_{false}; internal::PatchBuilder metadata_subpatch_; + bool contexts_subpatch_dirty_{false}; + internal::PatchBuilder contexts_custom_subpatch_; }; /** diff --git a/google/cloud/storage/object_metadata_test.cc b/google/cloud/storage/object_metadata_test.cc index 1cc291cb4cc90..89171a42bcaf2 100644 --- a/google/cloud/storage/object_metadata_test.cc +++ b/google/cloud/storage/object_metadata_test.cc @@ -120,6 +120,15 @@ ObjectMetadata CreateObjectMetadataForTest() { "mode": "Unlocked", "retainUntilTime": "2024-07-18T00:00:00Z" }, + "contexts": { + "custom": { + "environment": { + "value": "prod", + "createTime": "2024-07-18T00:00:00Z", + "updateTime": "2024-07-18T00:00:00Z" + } + } + }, "selfLink": "https://storage.googleapis.com/storage/v1/b/foo-bar/o/baz", "size": 102400, "storageClass": "STANDARD", @@ -207,6 +216,13 @@ TEST(ObjectMetadataTest, Parse) { EXPECT_EQ(actual.hard_delete_time(), std::chrono::system_clock::from_time_t(1710160496L) + std::chrono::milliseconds(789)); + EXPECT_EQ( + actual.contexts().custom().at("environment"), + (ObjectCustomContextPayload{ + "prod", + google::cloud::internal::ParseRfc3339("2024-07-18T00:00:00Z").value(), + google::cloud::internal::ParseRfc3339("2024-07-18T00:00:00Z") + .value()})); } /// @test Verify that the IOStream operator works as expected. @@ -267,6 +283,11 @@ TEST(ObjectMetadataTest, JsonForCompose) { {"customTime", "2020-08-10T12:34:56Z"}, {"retention", {{"mode", "Unlocked"}, {"retainUntilTime", "2024-07-18T00:00:00Z"}}}, + {"contexts", + {{"custom", nlohmann::json{{"environment", + {{"createTime", "2024-07-18T00:00:00Z"}, + {"updateTime", "2024-07-18T00:00:00Z"}, + {"value", "prod"}}}}}}}, }; EXPECT_EQ(expected, actual) << "diff=" << nlohmann::json::diff(expected, actual); @@ -306,7 +327,13 @@ TEST(ObjectMetadataTest, JsonForCopy) { {"customTime", "2020-08-10T12:34:56Z"}, {"retention", {{"mode", "Unlocked"}, {"retainUntilTime", "2024-07-18T00:00:00Z"}}}, + {"contexts", + {{"custom", nlohmann::json{{"environment", + {{"createTime", "2024-07-18T00:00:00Z"}, + {"updateTime", "2024-07-18T00:00:00Z"}, + {"value", "prod"}}}}}}}, }; + EXPECT_EQ(expected, actual) << "diff=" << nlohmann::json::diff(expected, actual); } @@ -348,6 +375,11 @@ TEST(ObjectMetadataTest, JsonForInsert) { {"customTime", "2020-08-10T12:34:56Z"}, {"retention", {{"mode", "Unlocked"}, {"retainUntilTime", "2024-07-18T00:00:00Z"}}}, + {"contexts", + {{"custom", nlohmann::json{{"environment", + {{"createTime", "2024-07-18T00:00:00Z"}, + {"updateTime", "2024-07-18T00:00:00Z"}, + {"value", "prod"}}}}}}}, }; EXPECT_EQ(expected, actual) << "diff=" << nlohmann::json::diff(expected, actual); @@ -388,6 +420,11 @@ TEST(ObjectMetadataTest, JsonForRewrite) { {"customTime", "2020-08-10T12:34:56Z"}, {"retention", {{"mode", "Unlocked"}, {"retainUntilTime", "2024-07-18T00:00:00Z"}}}, + {"contexts", + {{"custom", nlohmann::json{{"environment", + {{"createTime", "2024-07-18T00:00:00Z"}, + {"updateTime", "2024-07-18T00:00:00Z"}, + {"value", "prod"}}}}}}}, }; EXPECT_EQ(expected, actual) << "diff=" << nlohmann::json::diff(expected, actual); @@ -429,6 +466,11 @@ TEST(ObjectMetadataTest, JsonForUpdate) { {"customTime", "2020-08-10T12:34:56Z"}, {"retention", {{"mode", "Unlocked"}, {"retainUntilTime", "2024-07-18T00:00:00Z"}}}, + {"contexts", + {{"custom", nlohmann::json{{"environment", + {{"createTime", "2024-07-18T00:00:00Z"}, + {"updateTime", "2024-07-18T00:00:00Z"}, + {"value", "prod"}}}}}}}, }; EXPECT_EQ(expected, actual) << "diff=" << nlohmann::json::diff(expected, actual); @@ -645,6 +687,29 @@ TEST(ObjectMetadataTest, ResetRetention) { EXPECT_NE(expected, copy); } +/// @test Verify we can change the `contexts` field. +TEST(ObjectMetadataTest, SetContexts) { + auto const expected = CreateObjectMetadataForTest(); + auto copy = expected; + auto const context_payload = + ObjectCustomContextPayload{"engineering", {}, {}}; + ObjectContexts contexts; + contexts.upsert("department", context_payload); + copy.set_contexts(contexts); + EXPECT_TRUE(copy.has_contexts()); + EXPECT_EQ(contexts, copy.contexts()); + EXPECT_NE(expected, copy); +} + +/// @test Verify we can reset the `contexts` field. +TEST(ObjectMetadataTest, DeleteContexts) { + auto const expected = CreateObjectMetadataForTest(); + auto copy = expected; + copy.reset_contexts(); + EXPECT_FALSE(copy.has_contexts()); + EXPECT_NE(expected, copy); +} + TEST(ObjectMetadataPatchBuilder, SetAcl) { ObjectMetadataPatchBuilder builder; builder.SetAcl({internal::ObjectAccessControlParser::FromString( diff --git a/google/cloud/storage/quickstart/.bazelversion b/google/cloud/storage/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/storage/quickstart/.bazelversion +++ b/google/cloud/storage/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/storage/quickstart/MODULE.bazel b/google/cloud/storage/quickstart/MODULE.bazel index 769db68723a0d..e47bfb6fa8af0 100644 --- a/google/cloud/storage/quickstart/MODULE.bazel +++ b/google/cloud/storage/quickstart/MODULE.bazel @@ -17,4 +17,4 @@ module( version = "0.0.0", ) -bazel_dep(name = "google_cloud_cpp", version = "3.1.0") +bazel_dep(name = "google_cloud_cpp", version = "3.2.0") diff --git a/google/cloud/storage/quickstart/WORKSPACE.bazel b/google/cloud/storage/quickstart/WORKSPACE.bazel index 15000fc266ec5..048fc047eb5d1 100644 --- a/google/cloud/storage/quickstart/WORKSPACE.bazel +++ b/google/cloud/storage/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/storage/testing/retry_tests.cc b/google/cloud/storage/testing/retry_tests.cc index b635d67fbcbcf..509925bafef6d 100644 --- a/google/cloud/storage/testing/retry_tests.cc +++ b/google/cloud/storage/testing/retry_tests.cc @@ -121,7 +121,8 @@ void CaptureIdempotencyToken(std::vector& tokens, auto const& headers = context.headers(); auto l = headers.find(kIdempotencyTokenHeader); if (l == headers.end()) return; - tokens.insert(tokens.end(), l->second.begin(), l->second.end()); + auto values = l->second.values(); + tokens.insert(tokens.end(), values.begin(), values.end()); } void CaptureAuthorityOption(std::vector& authority, diff --git a/google/cloud/storage/tests/object_basic_crud_integration_test.cc b/google/cloud/storage/tests/object_basic_crud_integration_test.cc index a1c6e454f47c3..01d26169403a1 100644 --- a/google/cloud/storage/tests/object_basic_crud_integration_test.cc +++ b/google/cloud/storage/tests/object_basic_crud_integration_test.cc @@ -31,6 +31,34 @@ #include #include +namespace { +// Helper function to check if a time point is set (i.e. not the default value). +bool IsSet(std::chrono::system_clock::time_point tp) { + return tp != std::chrono::system_clock::time_point{}; +} + +void AssertHasCustomContext(google::cloud::storage::ObjectMetadata const& meta, + std::string const& key, + std::string const& expected_value) { + EXPECT_TRUE(meta.has_contexts()) + << "Missing contexts entirely in metadata: " << meta; + EXPECT_TRUE(meta.contexts().has_key(key)) + << "Missing expected context key '" << key << "' in metadata: " << meta; + if (meta.contexts().has_key(key)) { + EXPECT_EQ(expected_value, meta.contexts().custom().at(key).value) + << "Mismatch in context value for key '" << key << "'\n" + << "Expecting value '" << expected_value << "'\n" + << "Actual metadata: " << meta; + EXPECT_TRUE(IsSet(meta.contexts().custom().at(key).create_time)) + << "The create_time of key '" << key << "' is not set.\n" + << "Actual metadata: " << meta; + EXPECT_TRUE(IsSet(meta.contexts().custom().at(key).update_time)) + << "The update_time of key '" << key << "' is not set.\n" + << "Actual metadata: " << meta; + } +} +} // namespace + namespace google { namespace cloud { namespace storage { @@ -93,6 +121,7 @@ TEST_F(ObjectBasicCRUDIntegrationTest, BasicCRUD) { Projection("full")); ASSERT_STATUS_OK(get_meta); EXPECT_EQ(*get_meta, *insert_meta); + EXPECT_FALSE(insert_meta->has_contexts()) << *insert_meta; ObjectMetadata update = *get_meta; update.mutable_acl().emplace_back( @@ -156,6 +185,86 @@ TEST_F(ObjectBasicCRUDIntegrationTest, BasicCRUD) { EXPECT_THAT(list_object_names(), Not(Contains(object_name))); } +/// @test Verify the Object CRUD operations with object contexts. +TEST_F(ObjectBasicCRUDIntegrationTest, BasicCRUDWithObjectContexts) { + auto client = MakeIntegrationTestClient(); + + auto list_object_names = [&client, this] { + std::vector names; + for (auto o : client.ListObjects(bucket_name_)) { + EXPECT_STATUS_OK(o); + if (!o) break; + names.push_back(o->name()); + } + return names; + }; + + auto object_name = MakeRandomObjectName(); + ASSERT_THAT(list_object_names(), Not(Contains(object_name))) + << "Test aborted. The object <" << object_name << "> already exists." + << "This is unexpected as the test generates a random object name."; + + // 1. Insert Object with custom contexts. + StatusOr insert_meta = client.InsertObject( + bucket_name_, object_name, LoremIpsum(), IfGenerationMatch(0), + Projection("full"), + WithObjectMetadata(ObjectMetadata().set_contexts( + ObjectContexts().upsert("department", {"engineering", {}, {}})))); + ASSERT_STATUS_OK(insert_meta); + EXPECT_THAT(list_object_names(), Contains(object_name).Times(1)); + StatusOr get_meta = client.GetObjectMetadata( + bucket_name_, object_name, Generation(insert_meta->generation()), + Projection("full")); + ASSERT_STATUS_OK(get_meta); + AssertHasCustomContext(*get_meta, "department", "engineering"); + + // 2. Update object with two keys. + ObjectMetadata update = *get_meta; + update.set_contexts( + ObjectContexts() + .upsert("department", {"engineering and research", {}, {}}) + .upsert("region", {"Asia Pacific", {}, {}})); + StatusOr updated_meta = client.UpdateObject( + bucket_name_, object_name, update, Generation(get_meta->generation()), + Projection("full")); + ASSERT_STATUS_OK(updated_meta); + AssertHasCustomContext(*updated_meta, "department", + "engineering and research"); + AssertHasCustomContext(*updated_meta, "region", "Asia Pacific"); + + // 3. Patch the object contexts by updating one key's value. + StatusOr patched_meta = + client.PatchObject(bucket_name_, object_name, + ObjectMetadataPatchBuilder().SetContext( + "region", {"Asia Pacific - Singapore"}), + Projection("full")); + ASSERT_STATUS_OK(patched_meta); + AssertHasCustomContext(*patched_meta, "department", + "engineering and research"); + AssertHasCustomContext(*patched_meta, "region", "Asia Pacific - Singapore"); + + // 4. Patch object contexts by deleting one existing key. + StatusOr reset_key_meta = client.PatchObject( + bucket_name_, object_name, + ObjectMetadataPatchBuilder().ResetContext("region"), Projection("full")); + ASSERT_STATUS_OK(reset_key_meta); + AssertHasCustomContext(*reset_key_meta, "department", + "engineering and research"); + EXPECT_FALSE(reset_key_meta->contexts().has_key("region")); + + // 5. Patch object with reset of all contexts. + StatusOr reset_meta = client.PatchObject( + bucket_name_, object_name, ObjectMetadataPatchBuilder().ResetContexts(), + Projection("full")); + ASSERT_STATUS_OK(reset_meta); + EXPECT_FALSE(reset_meta->has_contexts()) << *reset_meta; + + // 6. Delete the object away to clean up. + auto status = client.DeleteObject(bucket_name_, object_name); + ASSERT_STATUS_OK(status); + EXPECT_THAT(list_object_names(), Not(Contains(object_name))); +} + /// @test Verify that the client works with non-default endpoints. TEST_F(ObjectBasicCRUDIntegrationTest, NonDefaultEndpointInsert) { auto client = MakeNonDefaultClient(); diff --git a/google/cloud/storage/tests/service_account_credentials_integration_test.cc b/google/cloud/storage/tests/service_account_credentials_integration_test.cc index 08fc4c0d3670b..13ffc19d34626 100644 --- a/google/cloud/storage/tests/service_account_credentials_integration_test.cc +++ b/google/cloud/storage/tests/service_account_credentials_integration_test.cc @@ -56,8 +56,8 @@ TEST_F(ServiceAccountCredentialsTest, UserInfoOAuth2) { auto factory = [c = sa_creds]() { auto authorization = c->GetToken(std::chrono::system_clock::now()); if (!authorization) return rest_internal::RestRequest(); - return rest_internal::RestRequest().AddHeader( - std::make_pair("Authorization", "Bearer " + authorization->token)); + return rest_internal::RestRequest().AddHeader(rest_internal::HttpHeader( + "Authorization", "Bearer " + authorization->token)); }; auto response = RetryHttpGet(kUrl, factory); diff --git a/google/cloud/storage/tests/unified_credentials_integration_test.cc b/google/cloud/storage/tests/unified_credentials_integration_test.cc index 58ad784cc953f..2d5407f17f567 100644 --- a/google/cloud/storage/tests/unified_credentials_integration_test.cc +++ b/google/cloud/storage/tests/unified_credentials_integration_test.cc @@ -21,6 +21,7 @@ #include "google/cloud/internal/unified_rest_credentials.h" #include "google/cloud/testing_util/scoped_environment.h" #include "google/cloud/testing_util/status_matchers.h" +#include "absl/strings/match.h" #include #ifndef _WIN32 #include @@ -43,9 +44,9 @@ using ::google::cloud::UnifiedCredentialsOption; using ::google::cloud::internal::GetEnv; using ::google::cloud::storage::testing::TempFile; using ::google::cloud::testing_util::IsOk; +using ::testing::Contains; using ::testing::IsEmpty; using ::testing::Not; -using ::testing::StartsWith; // This is a properly formatted, but invalid, CA Certificate. We will use this // as the *only* root of trust and try to contact *.google.com. This will @@ -88,6 +89,10 @@ KlXA1yQW/ClmnHVg57SN1g1rvOJCcnHBnSbT7kGFqUol constexpr int kCurleAbortedByCallback = 42; constexpr int kCurleOk = 0; +MATCHER_P(HeaderStartsWith, prefix, "header start with") { + return absl::StartsWith(std::string{arg}, prefix); +} + class UnifiedCredentialsIntegrationTest : public ::google::cloud::storage::testing::StorageIntegrationTest { protected: @@ -375,13 +380,18 @@ TEST_F(UnifiedCredentialsIntegrationTest, AccessToken) { auto default_credentials = rest_internal::MapCredentials((*MakeGoogleDefaultCredentials())); auto expiration = std::chrono::system_clock::now() + std::chrono::hours(1); - auto header = - oauth2_internal::AuthenticationHeaderJoined(*default_credentials); - ASSERT_THAT(header, IsOk()); - - auto constexpr kPrefix = "Authorization: Bearer "; - ASSERT_THAT(*header, StartsWith(kPrefix)); - auto token = header->substr(std::strlen(kPrefix)); + auto headers = default_credentials->AuthenticationHeaders( + std::chrono::system_clock::now(), ""); + ASSERT_THAT(headers, IsOk()); + + auto constexpr kPrefix = "authorization: Bearer "; + ASSERT_THAT(*headers, Contains(HeaderStartsWith(kPrefix))); + std::string authorization; + for (auto const& h : *headers) { + authorization = std::string{h}; + if (absl::StartsWith(authorization, kPrefix)) break; + } + auto token = authorization.substr(std::strlen(kPrefix)); auto client = MakeTestClient(Options{}.set( MakeAccessTokenCredentials(token, expiration))); @@ -401,13 +411,18 @@ TEST_F(UnifiedCredentialsIntegrationTest, AccessTokenCustomTrustStore) { auto default_credentials = rest_internal::MapCredentials((*MakeGoogleDefaultCredentials())); auto expiration = std::chrono::system_clock::now() + std::chrono::hours(1); - auto header = - oauth2_internal::AuthenticationHeaderJoined(*default_credentials); - ASSERT_THAT(header, IsOk()); - - auto constexpr kPrefix = "Authorization: Bearer "; - ASSERT_THAT(*header, StartsWith(kPrefix)); - auto token = header->substr(std::strlen(kPrefix)); + auto headers = default_credentials->AuthenticationHeaders( + std::chrono::system_clock::now(), ""); + ASSERT_THAT(headers, IsOk()); + + auto constexpr kPrefix = "authorization: Bearer "; + ASSERT_THAT(*headers, Contains(HeaderStartsWith(kPrefix))); + std::string authorization; + for (auto const& h : *headers) { + authorization = std::string{h}; + if (absl::StartsWith(authorization, kPrefix)) break; + } + auto token = authorization.substr(std::strlen(kPrefix)); testing_util::ScopedEnvironment grpc_roots_pem( "GRPC_DEFAULT_SSL_ROOTS_FILE_PATH", absl::nullopt); @@ -430,13 +445,18 @@ TEST_F(UnifiedCredentialsIntegrationTest, AccessTokenEmptyTrustStore) { auto default_credentials = rest_internal::MapCredentials((*MakeGoogleDefaultCredentials())); auto expiration = std::chrono::system_clock::now() + std::chrono::hours(1); - auto header = - oauth2_internal::AuthenticationHeaderJoined(*default_credentials); - ASSERT_THAT(header, IsOk()); - - auto constexpr kPrefix = "Authorization: Bearer "; - ASSERT_THAT(*header, StartsWith(kPrefix)); - auto token = header->substr(std::strlen(kPrefix)); + auto headers = default_credentials->AuthenticationHeaders( + std::chrono::system_clock::now(), ""); + ASSERT_THAT(headers, IsOk()); + + auto constexpr kPrefix = "authorization: Bearer "; + ASSERT_THAT(*headers, Contains(HeaderStartsWith(kPrefix))); + std::string authorization; + for (auto const& h : *headers) { + authorization = std::string{h}; + if (absl::StartsWith(authorization, kPrefix)) break; + } + auto token = authorization.substr(std::strlen(kPrefix)); auto client = MakeTestClient( EmptyTrustStoreOptions() diff --git a/google/cloud/storagebatchoperations/quickstart/WORKSPACE.bazel b/google/cloud/storagebatchoperations/quickstart/WORKSPACE.bazel index aeded96e36f2d..35de0fe95fc60 100644 --- a/google/cloud/storagebatchoperations/quickstart/WORKSPACE.bazel +++ b/google/cloud/storagebatchoperations/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/storagebatchoperations/v1/storage_batch_operations_client.h b/google/cloud/storagebatchoperations/v1/storage_batch_operations_client.h index 9fd16a9079eab..f27d60e9d8734 100644 --- a/google/cloud/storagebatchoperations/v1/storage_batch_operations_client.h +++ b/google/cloud/storagebatchoperations/v1/storage_batch_operations_client.h @@ -484,7 +484,7 @@ class StorageBatchOperationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.storagebatchoperations.v1.BucketOperation]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L136} + /// [google.cloud.storagebatchoperations.v1.BucketOperation]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L139} /// [google.cloud.storagebatchoperations.v1.ListBucketOperationsRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L241} /// // clang-format on @@ -523,7 +523,7 @@ class StorageBatchOperationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.storagebatchoperations.v1.BucketOperation]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L136} + /// [google.cloud.storagebatchoperations.v1.BucketOperation]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L139} /// [google.cloud.storagebatchoperations.v1.ListBucketOperationsRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L241} /// // clang-format on @@ -553,7 +553,7 @@ class StorageBatchOperationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.storagebatchoperations.v1.BucketOperation]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L136} + /// [google.cloud.storagebatchoperations.v1.BucketOperation]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L139} /// [google.cloud.storagebatchoperations.v1.GetBucketOperationRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L276} /// // clang-format on @@ -583,7 +583,7 @@ class StorageBatchOperationsClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.storagebatchoperations.v1.BucketOperation]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L136} + /// [google.cloud.storagebatchoperations.v1.BucketOperation]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto#L139} /// [google.cloud.storagebatchoperations.v1.GetBucketOperationRequest]: @googleapis_reference_link{google/cloud/storagebatchoperations/v1/storage_batch_operations.proto#L276} /// // clang-format on @@ -882,7 +882,7 @@ class StorageBatchOperationsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -921,7 +921,7 @@ class StorageBatchOperationsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/storagecontrol/quickstart/.bazelversion b/google/cloud/storagecontrol/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/storagecontrol/quickstart/.bazelversion +++ b/google/cloud/storagecontrol/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/storagecontrol/quickstart/WORKSPACE.bazel b/google/cloud/storagecontrol/quickstart/WORKSPACE.bazel index 69f2f08b11126..0fee02af2ecd9 100644 --- a/google/cloud/storagecontrol/quickstart/WORKSPACE.bazel +++ b/google/cloud/storagecontrol/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/storagecontrol/v2/samples/storage_control_anywhere_cache_samples.cc b/google/cloud/storagecontrol/v2/samples/storage_control_anywhere_cache_samples.cc index 62f2f8b52ec08..6abcd8c1cee81 100644 --- a/google/cloud/storagecontrol/v2/samples/storage_control_anywhere_cache_samples.cc +++ b/google/cloud/storagecontrol/v2/samples/storage_control_anywhere_cache_samples.cc @@ -86,13 +86,13 @@ void UpdateAnywhereCache( std::vector const& argv) { // [START storage_control_update_anywhere_cache] namespace storagecontrol = google::cloud::storagecontrol_v2; - [](storagecontrol::StorageControlClient client, std::string const& cache_name, - std::string const& admission_policy) { + [](storagecontrol::StorageControlClient client, + std::string const& cache_name) { google::storage::control::v2::AnywhereCache cache; google::protobuf::FieldMask field_mask; - field_mask.add_paths("admission_policy"); + field_mask.add_paths("ttl"); cache.set_name(cache_name); - cache.set_admission_policy(admission_policy); + cache.mutable_ttl()->set_seconds(86400); // Start an update operation and block until it completes. Real applications // may want to setup a callback, wait on a coroutine, or poll until it // completes. @@ -101,7 +101,7 @@ void UpdateAnywhereCache( std::cout << "Updated anywhere cache: " << anywhere_cache->name() << "\n"; } // [END storage_control_update_anywhere_cache] - (std::move(client), argv.at(0), argv.at(1)); + (std::move(client), argv.at(0)); } void PauseAnywhereCache( @@ -221,8 +221,7 @@ int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) CreateAnywhereCache), make_entry("get-anywhere-cache", {"cache-name"}, GetAnywhereCache), make_entry("list-anywhere-caches", {"bucket-name"}, ListAnywhereCaches), - make_entry("update-anywhere-cache", {"cache-name", "admission-policy"}, - UpdateAnywhereCache), + make_entry("update-anywhere-cache", {"cache-name"}, UpdateAnywhereCache), make_entry("pause-anywhere-cache", {"cache-name"}, PauseAnywhereCache), make_entry("resume-anywhere-cache", {"cache-name"}, ResumeAnywhereCache), make_entry("disable-anywhere-cache", {"cache-name"}, diff --git a/google/cloud/storageinsights/quickstart/.bazelversion b/google/cloud/storageinsights/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/storageinsights/quickstart/.bazelversion +++ b/google/cloud/storageinsights/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/storageinsights/quickstart/WORKSPACE.bazel b/google/cloud/storageinsights/quickstart/WORKSPACE.bazel index f2a01afc34a9d..7ef4203dd4a45 100644 --- a/google/cloud/storageinsights/quickstart/WORKSPACE.bazel +++ b/google/cloud/storageinsights/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/storageinsights/v1/storage_insights_client.h b/google/cloud/storageinsights/v1/storage_insights_client.h index 272b5abb1485e..c7ac98f5c75e8 100644 --- a/google/cloud/storageinsights/v1/storage_insights_client.h +++ b/google/cloud/storageinsights/v1/storage_insights_client.h @@ -1543,7 +1543,7 @@ class StorageInsightsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1582,7 +1582,7 @@ class StorageInsightsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/storagetransfer/quickstart/.bazelversion b/google/cloud/storagetransfer/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/storagetransfer/quickstart/.bazelversion +++ b/google/cloud/storagetransfer/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/storagetransfer/quickstart/WORKSPACE.bazel b/google/cloud/storagetransfer/quickstart/WORKSPACE.bazel index cf9771cf05839..45a70bfa0a36f 100644 --- a/google/cloud/storagetransfer/quickstart/WORKSPACE.bazel +++ b/google/cloud/storagetransfer/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/storagetransfer/v1/storage_transfer_client.h b/google/cloud/storagetransfer/v1/storage_transfer_client.h index 6a24cdc15d670..aae79dd731add 100644 --- a/google/cloud/storagetransfer/v1/storage_transfer_client.h +++ b/google/cloud/storagetransfer/v1/storage_transfer_client.h @@ -929,7 +929,7 @@ class StorageTransferServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -968,7 +968,7 @@ class StorageTransferServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/support/quickstart/.bazelversion b/google/cloud/support/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/support/quickstart/.bazelversion +++ b/google/cloud/support/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/support/quickstart/WORKSPACE.bazel b/google/cloud/support/quickstart/WORKSPACE.bazel index 02ea9b6e9e855..cc2b38440aa51 100644 --- a/google/cloud/support/quickstart/WORKSPACE.bazel +++ b/google/cloud/support/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/talent/quickstart/.bazelversion b/google/cloud/talent/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/talent/quickstart/.bazelversion +++ b/google/cloud/talent/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/talent/quickstart/WORKSPACE.bazel b/google/cloud/talent/quickstart/WORKSPACE.bazel index 90e3f2ffd852a..5df367d2eb7c4 100644 --- a/google/cloud/talent/quickstart/WORKSPACE.bazel +++ b/google/cloud/talent/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/tasks/quickstart/.bazelversion b/google/cloud/tasks/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/tasks/quickstart/.bazelversion +++ b/google/cloud/tasks/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/tasks/quickstart/WORKSPACE.bazel b/google/cloud/tasks/quickstart/WORKSPACE.bazel index 012fc54abaaa4..fa66cbdfa7fef 100644 --- a/google/cloud/tasks/quickstart/WORKSPACE.bazel +++ b/google/cloud/tasks/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/telcoautomation/quickstart/.bazelversion b/google/cloud/telcoautomation/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/telcoautomation/quickstart/.bazelversion +++ b/google/cloud/telcoautomation/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/telcoautomation/quickstart/WORKSPACE.bazel b/google/cloud/telcoautomation/quickstart/WORKSPACE.bazel index 5df797bac4e88..aa45f60578065 100644 --- a/google/cloud/telcoautomation/quickstart/WORKSPACE.bazel +++ b/google/cloud/telcoautomation/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/telcoautomation/v1/telco_automation_client.h b/google/cloud/telcoautomation/v1/telco_automation_client.h index 25ef61dcc34fe..dc6f073631a3b 100644 --- a/google/cloud/telcoautomation/v1/telco_automation_client.h +++ b/google/cloud/telcoautomation/v1/telco_automation_client.h @@ -2930,7 +2930,7 @@ class TelcoAutomationClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2969,7 +2969,7 @@ class TelcoAutomationClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/testing_util/command_line_parsing.cc b/google/cloud/testing_util/command_line_parsing.cc index 330d6d402b04b..92d90842a6a91 100644 --- a/google/cloud/testing_util/command_line_parsing.cc +++ b/google/cloud/testing_util/command_line_parsing.cc @@ -16,6 +16,7 @@ #include "google/cloud/internal/throw_delegate.h" #include "absl/strings/match.h" #include "absl/time/time.h" +#include #include #include #include diff --git a/google/cloud/texttospeech/quickstart/.bazelversion b/google/cloud/texttospeech/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/texttospeech/quickstart/.bazelversion +++ b/google/cloud/texttospeech/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/texttospeech/quickstart/WORKSPACE.bazel b/google/cloud/texttospeech/quickstart/WORKSPACE.bazel index 399027be66a49..1a121faf1004c 100644 --- a/google/cloud/texttospeech/quickstart/WORKSPACE.bazel +++ b/google/cloud/texttospeech/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/texttospeech/v1/text_to_speech_client.h b/google/cloud/texttospeech/v1/text_to_speech_client.h index 58f5d08bdca2e..ac7d96213a837 100644 --- a/google/cloud/texttospeech/v1/text_to_speech_client.h +++ b/google/cloud/texttospeech/v1/text_to_speech_client.h @@ -169,8 +169,8 @@ class TextToSpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.texttospeech.v1.SynthesizeSpeechRequest]: @googleapis_reference_link{google/cloud/texttospeech/v1/cloud_tts.proto#L179} - /// [google.cloud.texttospeech.v1.SynthesizeSpeechResponse]: @googleapis_reference_link{google/cloud/texttospeech/v1/cloud_tts.proto#L475} + /// [google.cloud.texttospeech.v1.SynthesizeSpeechRequest]: @googleapis_reference_link{google/cloud/texttospeech/v1/cloud_tts.proto#L246} + /// [google.cloud.texttospeech.v1.SynthesizeSpeechResponse]: @googleapis_reference_link{google/cloud/texttospeech/v1/cloud_tts.proto#L543} /// // clang-format on StatusOr @@ -204,8 +204,8 @@ class TextToSpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.texttospeech.v1.SynthesizeSpeechRequest]: @googleapis_reference_link{google/cloud/texttospeech/v1/cloud_tts.proto#L179} - /// [google.cloud.texttospeech.v1.SynthesizeSpeechResponse]: @googleapis_reference_link{google/cloud/texttospeech/v1/cloud_tts.proto#L475} + /// [google.cloud.texttospeech.v1.SynthesizeSpeechRequest]: @googleapis_reference_link{google/cloud/texttospeech/v1/cloud_tts.proto#L246} + /// [google.cloud.texttospeech.v1.SynthesizeSpeechResponse]: @googleapis_reference_link{google/cloud/texttospeech/v1/cloud_tts.proto#L543} /// // clang-format on StatusOr @@ -235,8 +235,8 @@ class TextToSpeechClient { /// [`future`]: @ref google::cloud::future /// [`StatusOr`]: @ref google::cloud::StatusOr /// [`Status`]: @ref google::cloud::Status - /// [google.cloud.texttospeech.v1.StreamingSynthesizeRequest]: @googleapis_reference_link{google/cloud/texttospeech/v1/cloud_tts.proto#L553} - /// [google.cloud.texttospeech.v1.StreamingSynthesizeResponse]: @googleapis_reference_link{google/cloud/texttospeech/v1/cloud_tts.proto#L570} + /// [google.cloud.texttospeech.v1.StreamingSynthesizeRequest]: @googleapis_reference_link{google/cloud/texttospeech/v1/cloud_tts.proto#L625} + /// [google.cloud.texttospeech.v1.StreamingSynthesizeResponse]: @googleapis_reference_link{google/cloud/texttospeech/v1/cloud_tts.proto#L642} /// // clang-format on std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< diff --git a/google/cloud/timeseriesinsights/quickstart/.bazelversion b/google/cloud/timeseriesinsights/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/timeseriesinsights/quickstart/.bazelversion +++ b/google/cloud/timeseriesinsights/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/timeseriesinsights/quickstart/WORKSPACE.bazel b/google/cloud/timeseriesinsights/quickstart/WORKSPACE.bazel index cbbd97569001b..06244789f231f 100644 --- a/google/cloud/timeseriesinsights/quickstart/WORKSPACE.bazel +++ b/google/cloud/timeseriesinsights/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/tpu/quickstart/.bazelversion b/google/cloud/tpu/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/tpu/quickstart/.bazelversion +++ b/google/cloud/tpu/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/tpu/quickstart/WORKSPACE.bazel b/google/cloud/tpu/quickstart/WORKSPACE.bazel index 3154ef45017de..2fa1fb5826673 100644 --- a/google/cloud/tpu/quickstart/WORKSPACE.bazel +++ b/google/cloud/tpu/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/tpu/v1/tpu_client.h b/google/cloud/tpu/v1/tpu_client.h index 54793b5c94794..09c88a79e2b0b 100644 --- a/google/cloud/tpu/v1/tpu_client.h +++ b/google/cloud/tpu/v1/tpu_client.h @@ -1189,7 +1189,7 @@ class TpuClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1228,7 +1228,7 @@ class TpuClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/tpu/v2/tpu_client.h b/google/cloud/tpu/v2/tpu_client.h index 0dbbb4ac68a5a..9ecc91ffd24c8 100644 --- a/google/cloud/tpu/v2/tpu_client.h +++ b/google/cloud/tpu/v2/tpu_client.h @@ -1779,7 +1779,7 @@ class TpuClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -1818,7 +1818,7 @@ class TpuClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/trace/quickstart/.bazelversion b/google/cloud/trace/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/trace/quickstart/.bazelversion +++ b/google/cloud/trace/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/trace/quickstart/WORKSPACE.bazel b/google/cloud/trace/quickstart/WORKSPACE.bazel index 94bc77ab0642a..02fd35c6f2887 100644 --- a/google/cloud/trace/quickstart/WORKSPACE.bazel +++ b/google/cloud/trace/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/translate/quickstart/.bazelversion b/google/cloud/translate/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/translate/quickstart/.bazelversion +++ b/google/cloud/translate/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/translate/quickstart/WORKSPACE.bazel b/google/cloud/translate/quickstart/WORKSPACE.bazel index 1e8873d87e592..eb9f55f3aa779 100644 --- a/google/cloud/translate/quickstart/WORKSPACE.bazel +++ b/google/cloud/translate/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/translate/v3/translation_client.h b/google/cloud/translate/v3/translation_client.h index d210d93696be1..cb2afc0c57afa 100644 --- a/google/cloud/translate/v3/translation_client.h +++ b/google/cloud/translate/v3/translation_client.h @@ -3500,7 +3500,7 @@ class TranslationServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -3539,7 +3539,7 @@ class TranslationServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/universe_domain/demo/WORKSPACE.bazel b/google/cloud/universe_domain/demo/WORKSPACE.bazel index d63111ab6c8dd..d3e48d839d250 100644 --- a/google/cloud/universe_domain/demo/WORKSPACE.bazel +++ b/google/cloud/universe_domain/demo/WORKSPACE.bazel @@ -21,9 +21,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Fetch the Google Cloud C++ libraries. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/vectorsearch/BUILD.bazel b/google/cloud/vectorsearch/BUILD.bazel new file mode 100644 index 0000000000000..2c1c398a1ab79 --- /dev/null +++ b/google/cloud/vectorsearch/BUILD.bazel @@ -0,0 +1,31 @@ +# Copyright 2026 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 = [ + "@googleapis//google/cloud/vectorsearch/v1:vectorsearch_cc_grpc", +] + +cc_gapic_library( + name = "vectorsearch", + googleapis_deps = googleapis_deps, + service_dirs = service_dirs, +) diff --git a/google/cloud/vectorsearch/CMakeLists.txt b/google/cloud/vectorsearch/CMakeLists.txt new file mode 100644 index 0000000000000..f507b35b3d953 --- /dev/null +++ b/google/cloud/vectorsearch/CMakeLists.txt @@ -0,0 +1,35 @@ +# ~~~ +# Copyright 2026 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(vectorsearch "Vector Search API" + SERVICE_DIRS "v1/") + +if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) + add_executable(vectorsearch_quickstart "quickstart/quickstart.cc") + target_link_libraries(vectorsearch_quickstart + PRIVATE google-cloud-cpp::vectorsearch) + google_cloud_cpp_add_common_options(vectorsearch_quickstart) + add_test( + NAME vectorsearch_quickstart + COMMAND + cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" + $ GOOGLE_CLOUD_PROJECT + GOOGLE_CLOUD_CPP_TEST_REGION) + set_tests_properties(vectorsearch_quickstart + PROPERTIES LABELS "integration-test;quickstart") +endif () diff --git a/google/cloud/vectorsearch/README.md b/google/cloud/vectorsearch/README.md new file mode 100644 index 0000000000000..3fe37e653f393 --- /dev/null +++ b/google/cloud/vectorsearch/README.md @@ -0,0 +1,68 @@ +# Vector Search API C++ Client Library + +This directory contains an idiomatic C++ client library for the +[Vector Search API][cloud-service-docs]. + +The Vector Search API provides a fully-managed, highly performant, and scalable +vector database designed to power next-generation search, recommendation, and +generative AI applications. It allows you to store, index, and query your data +and its corresponding vector embeddings through a simple, intuitive interface. +With Vector Search, you can define custom schemas for your data, insert objects +with associated metadata, automatically generate embeddings from your data, and +perform fast approximate nearest neighbor (ANN) searches to find semantically +similar items at scale. + +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/vectorsearch/v1/vector_search_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 vectorsearch = ::google::cloud::vectorsearch_v1; + auto client = vectorsearch::VectorSearchServiceClient( + vectorsearch::MakeVectorSearchServiceConnection()); + + for (auto r : client.ListCollections(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 [Vector Search 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://docs.cloud.google.com/vertex-ai/docs/vector-search-2/overview +[doxygen-link]: https://cloud.google.com/cpp/docs/reference/vectorsearch/latest/ +[source-link]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/vectorsearch diff --git a/google/cloud/vectorsearch/doc/environment-variables.dox b/google/cloud/vectorsearch/doc/environment-variables.dox new file mode 100644 index 0000000000000..6f055899cd773 --- /dev/null +++ b/google/cloud/vectorsearch/doc/environment-variables.dox @@ -0,0 +1,57 @@ +/*! +@page vectorsearch-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 vectorsearch-env-endpoint Endpoint Overrides + + + +- `GOOGLE_CLOUD_CPP_DATA_OBJECT_SEARCH_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "vectorsearch.googleapis.com") + used by `MakeDataObjectSearchServiceConnection()`. + +- `GOOGLE_CLOUD_CPP_DATA_OBJECT_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "vectorsearch.googleapis.com") + used by `MakeDataObjectServiceConnection()`. + +- `GOOGLE_CLOUD_CPP_VECTOR_SEARCH_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "vectorsearch.googleapis.com") + used by `MakeVectorSearchServiceConnection()`. + + + +@see google::cloud::EndpointOption + +@section vectorsearch-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 vectorsearch-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/vectorsearch/doc/main.dox b/google/cloud/vectorsearch/doc/main.dox new file mode 100644 index 0000000000000..720879a12c781 --- /dev/null +++ b/google/cloud/vectorsearch/doc/main.dox @@ -0,0 +1,63 @@ +/*! + +@mainpage Vector Search API C++ Client Library + +An idiomatic C++ client library for the [Vector Search API][cloud-service-docs]. + +The Vector Search API provides a fully-managed, highly performant, and +scalable vector database designed to power next-generation search, +recommendation, and generative AI applications. It allows you to store, +index, and query your data and its corresponding vector embeddings through +a simple, intuitive interface. With Vector Search, you can define custom +schemas for your data, insert objects with associated metadata, +automatically generate embeddings from your data, and perform fast +approximate nearest neighbor (ANN) searches to find semantically similar +items at scale. + +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/vectorsearch/quickstart/` directory, +which should give you a taste of the Vector Search API C++ client library API. + +@snippet quickstart.cc all + +## Main classes + + +This library offers multiple `*Client` classes, which are listed below. Each one +of these classes exposes all the RPCs for a service as member functions of the +class. This library groups multiple services because they are part of the same +product or are often used together. A typical example may be the administrative +and data plane operations for a single product. + +The library also has other classes that provide helpers, configuration +parameters, and infrastructure to mock the `*Client` classes when testing your +application. + +- [\c vectorsearch_v1::DataObjectServiceClient](@ref google::cloud::vectorsearch_v1::DataObjectServiceClient) +- [\c vectorsearch_v1::DataObjectSearchServiceClient](@ref google::cloud::vectorsearch_v1::DataObjectSearchServiceClient) +- [\c vectorsearch_v1::VectorSearchServiceClient](@ref google::cloud::vectorsearch_v1::VectorSearchServiceClient) + + +## More Information + +- @ref common-error-handling - describes how the library reports errors. +- @ref vectorsearch-override-endpoint - describes how to override the default + endpoint. +- @ref vectorsearch-override-authentication - describes how to change the + authentication credentials used by the library. +- @ref vectorsearch-override-retry - describes how to change the default retry + policies. +- @ref vectorsearch-env - describes environment variables that can configure the + behavior of the library. +- @ref vectorsearch-override-universe-domain - describes how to override the default universe domain. + +[cloud-service-docs]: https://docs.cloud.google.com/vertex-ai/docs/vector-search-2/overview + +*/ diff --git a/google/cloud/vectorsearch/doc/options.dox b/google/cloud/vectorsearch/doc/options.dox new file mode 100644 index 0000000000000..08cbecf25afc6 --- /dev/null +++ b/google/cloud/vectorsearch/doc/options.dox @@ -0,0 +1,10 @@ +/*! +@defgroup google-cloud-vectorsearch-options Vector Search 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/vectorsearch/doc/override-authentication.dox b/google/cloud/vectorsearch/doc/override-authentication.dox new file mode 100644 index 0000000000000..93fe87dcab1e1 --- /dev/null +++ b/google/cloud/vectorsearch/doc/override-authentication.dox @@ -0,0 +1,53 @@ +/*! +@page vectorsearch-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 data_object_client_samples.cc with-service-account + +Follow these links to find examples for other \c *Client classes: + +- [\c vectorsearch_v1::DataObjectServiceClient](@ref vectorsearch_v1::DataObjectServiceClient-service-account-snippet) +- [\c vectorsearch_v1::DataObjectSearchServiceClient](@ref vectorsearch_v1::DataObjectSearchServiceClient-service-account-snippet) +- [\c vectorsearch_v1::VectorSearchServiceClient](@ref vectorsearch_v1::VectorSearchServiceClient-service-account-snippet) + + + +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 vectorsearch_v1::DataObjectServiceClient-service-account-snippet Override vectorsearch_v1::DataObjectServiceClient Authentication Defaults + +@snippet google/cloud/vectorsearch/v1/samples/data_object_client_samples.cc with-service-account + +*/ + +/*! @page vectorsearch_v1::DataObjectSearchServiceClient-service-account-snippet Override vectorsearch_v1::DataObjectSearchServiceClient Authentication Defaults + +@snippet google/cloud/vectorsearch/v1/samples/data_object_search_client_samples.cc with-service-account + +*/ + +/*! @page vectorsearch_v1::VectorSearchServiceClient-service-account-snippet Override vectorsearch_v1::VectorSearchServiceClient Authentication Defaults + +@snippet google/cloud/vectorsearch/v1/samples/vector_search_client_samples.cc with-service-account + +*/ +// diff --git a/google/cloud/vectorsearch/doc/override-endpoint.dox b/google/cloud/vectorsearch/doc/override-endpoint.dox new file mode 100644 index 0000000000000..257056cb46a8a --- /dev/null +++ b/google/cloud/vectorsearch/doc/override-endpoint.dox @@ -0,0 +1,43 @@ +/*! +@page vectorsearch-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 `vectorsearch_v1::DataObjectServiceClient`: + +@snippet data_object_client_samples.cc set-client-endpoint + +Follow these links to find examples for other \c *Client classes: + +- [\c vectorsearch_v1::DataObjectServiceClient](@ref vectorsearch_v1::DataObjectServiceClient-endpoint-snippet) +- [\c vectorsearch_v1::DataObjectSearchServiceClient](@ref vectorsearch_v1::DataObjectSearchServiceClient-endpoint-snippet) +- [\c vectorsearch_v1::VectorSearchServiceClient](@ref vectorsearch_v1::VectorSearchServiceClient-endpoint-snippet) + + + +*/ + +// + +/*! @page vectorsearch_v1::DataObjectServiceClient-endpoint-snippet Override vectorsearch_v1::DataObjectServiceClient Endpoint Configuration + +@snippet google/cloud/vectorsearch/v1/samples/data_object_client_samples.cc set-client-endpoint + +*/ + +/*! @page vectorsearch_v1::DataObjectSearchServiceClient-endpoint-snippet Override vectorsearch_v1::DataObjectSearchServiceClient Endpoint Configuration + +@snippet google/cloud/vectorsearch/v1/samples/data_object_search_client_samples.cc set-client-endpoint + +*/ + +/*! @page vectorsearch_v1::VectorSearchServiceClient-endpoint-snippet Override vectorsearch_v1::VectorSearchServiceClient Endpoint Configuration + +@snippet google/cloud/vectorsearch/v1/samples/vector_search_client_samples.cc set-client-endpoint + +*/ +// diff --git a/google/cloud/vectorsearch/doc/override-retry-policies.dox b/google/cloud/vectorsearch/doc/override-retry-policies.dox new file mode 100644 index 0000000000000..30b41fd07abf7 --- /dev/null +++ b/google/cloud/vectorsearch/doc/override-retry-policies.dox @@ -0,0 +1,134 @@ +/*! +@page vectorsearch-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 vectorsearch-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 vectorsearch-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 vectorsearch-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 vectorsearch-override-retry-example Example + + +For example, this will override the retry policies for `vectorsearch_v1::DataObjectServiceClient`: + +@snippet data_object_client_samples.cc set-retry-policy + +This assumes you have created a custom idempotency policy. Such as: + +@snippet data_object_client_samples.cc custom-idempotency-policy + + +Follow these links to find examples for other \c *Client classes: + +- [\c vectorsearch_v1::DataObjectServiceClient](@ref vectorsearch_v1::DataObjectServiceClient-retry-snippet) +- [\c vectorsearch_v1::DataObjectSearchServiceClient](@ref vectorsearch_v1::DataObjectSearchServiceClient-retry-snippet) +- [\c vectorsearch_v1::VectorSearchServiceClient](@ref vectorsearch_v1::VectorSearchServiceClient-retry-snippet) + + + +@section vectorsearch-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 vectorsearch_v1::DataObjectServiceClient-retry-snippet Override vectorsearch_v1::DataObjectServiceClient Retry Policies + +This shows how to override the retry policies for vectorsearch_v1::DataObjectServiceClient: + +@snippet google/cloud/vectorsearch/v1/samples/data_object_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/vectorsearch/v1/samples/data_object_client_samples.cc custom-idempotency-policy + +*/ + +/*! @page vectorsearch_v1::DataObjectSearchServiceClient-retry-snippet Override vectorsearch_v1::DataObjectSearchServiceClient Retry Policies + +This shows how to override the retry policies for vectorsearch_v1::DataObjectSearchServiceClient: + +@snippet google/cloud/vectorsearch/v1/samples/data_object_search_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/vectorsearch/v1/samples/data_object_search_client_samples.cc custom-idempotency-policy + +*/ + +/*! @page vectorsearch_v1::VectorSearchServiceClient-retry-snippet Override vectorsearch_v1::VectorSearchServiceClient Retry Policies + +This shows how to override the retry policies for vectorsearch_v1::VectorSearchServiceClient: + +@snippet google/cloud/vectorsearch/v1/samples/vector_search_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/vectorsearch/v1/samples/vector_search_client_samples.cc custom-idempotency-policy + +*/ +// diff --git a/google/cloud/vectorsearch/doc/override-universe-domain.dox b/google/cloud/vectorsearch/doc/override-universe-domain.dox new file mode 100644 index 0000000000000..b6c032a1cc314 --- /dev/null +++ b/google/cloud/vectorsearch/doc/override-universe-domain.dox @@ -0,0 +1,42 @@ +/*! +@page vectorsearch-override-universe-domain How to Override the Default Universe Domain + +In some cases, you may need to override the default universe domain used by the +client library. Use `AddUniverseDomainOption` when initializing the client +library to change this default. + + +For example, this will override the default universe domain for `vectorsearch_v1::DataObjectServiceClient`: + +@snippet data_object_client_samples.cc set-client-universe-domain + +Follow these links to find examples for other \c *Client classes: + +- [\c vectorsearch_v1::DataObjectServiceClient](@ref vectorsearch_v1::DataObjectServiceClient-universe-domain-snippet) +- [\c vectorsearch_v1::DataObjectSearchServiceClient](@ref vectorsearch_v1::DataObjectSearchServiceClient-universe-domain-snippet) +- [\c vectorsearch_v1::VectorSearchServiceClient](@ref vectorsearch_v1::VectorSearchServiceClient-universe-domain-snippet) + + + +*/ + +// + +/*! @page vectorsearch_v1::DataObjectServiceClient-universe-domain-snippet Override vectorsearch_v1::DataObjectServiceClient Universe Domain + +@snippet google/cloud/vectorsearch/v1/samples/data_object_client_samples.cc set-client-universe-domain + +*/ + +/*! @page vectorsearch_v1::DataObjectSearchServiceClient-universe-domain-snippet Override vectorsearch_v1::DataObjectSearchServiceClient Universe Domain + +@snippet google/cloud/vectorsearch/v1/samples/data_object_search_client_samples.cc set-client-universe-domain + +*/ + +/*! @page vectorsearch_v1::VectorSearchServiceClient-universe-domain-snippet Override vectorsearch_v1::VectorSearchServiceClient Universe Domain + +@snippet google/cloud/vectorsearch/v1/samples/vector_search_client_samples.cc set-client-universe-domain + +*/ +// diff --git a/google/cloud/vectorsearch/quickstart/.bazelrc b/google/cloud/vectorsearch/quickstart/.bazelrc new file mode 100644 index 0000000000000..c884db46c2b4d --- /dev/null +++ b/google/cloud/vectorsearch/quickstart/.bazelrc @@ -0,0 +1,30 @@ +# Copyright 2026 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/vectorsearch/quickstart/BUILD.bazel b/google/cloud/vectorsearch/quickstart/BUILD.bazel new file mode 100644 index 0000000000000..6ed87c84b25c6 --- /dev/null +++ b/google/cloud/vectorsearch/quickstart/BUILD.bazel @@ -0,0 +1,25 @@ +# Copyright 2026 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//:vectorsearch", + ], +) diff --git a/google/cloud/vectorsearch/quickstart/CMakeLists.txt b/google/cloud/vectorsearch/quickstart/CMakeLists.txt new file mode 100644 index 0000000000000..ec54e5bef567b --- /dev/null +++ b/google/cloud/vectorsearch/quickstart/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright 2026 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 Vector Search API C++ client library from a +# larger CMake project. + +cmake_minimum_required(VERSION 3.22...3.31) +project(google-cloud-cpp-vectorsearch-quickstart CXX) + +find_package(google_cloud_cpp_vectorsearch 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::vectorsearch) diff --git a/google/cloud/vectorsearch/quickstart/Makefile b/google/cloud/vectorsearch/quickstart/Makefile new file mode 100644 index 0000000000000..f5e6e5e5594eb --- /dev/null +++ b/google/cloud/vectorsearch/quickstart/Makefile @@ -0,0 +1,35 @@ +# Copyright 2026 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 Vector Search 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 Vector Search API C++ +# client library. +CLIENT_MODULE := google_cloud_cpp_vectorsearch +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/vectorsearch/quickstart/README.md b/google/cloud/vectorsearch/quickstart/README.md new file mode 100644 index 0000000000000..0b9f3d3b5507b --- /dev/null +++ b/google/cloud/vectorsearch/quickstart/README.md @@ -0,0 +1,135 @@ +# HOWTO: using the Vector Search API C++ client in your project + +This directory contains small examples showing how to use the Vector Search 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, Vector Search 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/vectorsearch/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,vectorsearch] + ``` + + 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/vectorsearch/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/vectorsearch/quickstart/WORKSPACE.bazel b/google/cloud/vectorsearch/quickstart/WORKSPACE.bazel new file mode 100644 index 0000000000000..e8e5681784bfe --- /dev/null +++ b/google/cloud/vectorsearch/quickstart/WORKSPACE.bazel @@ -0,0 +1,53 @@ +# Copyright 2026 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 Vector Search 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 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.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/vectorsearch/quickstart/quickstart.cc b/google/cloud/vectorsearch/quickstart/quickstart.cc new file mode 100644 index 0000000000000..5f73af5280f99 --- /dev/null +++ b/google/cloud/vectorsearch/quickstart/quickstart.cc @@ -0,0 +1,42 @@ +// Copyright 2026 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/vectorsearch/v1/vector_search_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 vectorsearch = ::google::cloud::vectorsearch_v1; + auto client = vectorsearch::VectorSearchServiceClient( + vectorsearch::MakeVectorSearchServiceConnection()); + + for (auto r : client.ListCollections(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/vectorsearch/v1/.repo-metadata.json b/google/cloud/vectorsearch/v1/.repo-metadata.json new file mode 100644 index 0000000000000..33e5d0489695b --- /dev/null +++ b/google/cloud/vectorsearch/v1/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "api_id": "vectorsearch.googleapis.com", + "api_shortname": "vectorsearch", + "client_documentation": "https://cloud.google.com/cpp/docs/reference/vectorsearch/latest", + "distribution_name": "google-cloud-cpp", + "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:1899904%20status=open", + "language": "cpp", + "library_type": "GAPIC_AUTO", + "name_pretty": "Vector Search API", + "product_documentation": "https://docs.cloud.google.com/vertex-ai/docs/vector-search-2/overview", + "release_level": "stable", + "repo": "googleapis/google-cloud-cpp", + "requires_billing": true +} diff --git a/google/cloud/vectorsearch/v1/data_object_client.cc b/google/cloud/vectorsearch/v1/data_object_client.cc new file mode 100644 index 0000000000000..67f6b57d09ab7 --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_client.cc @@ -0,0 +1,234 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#include "google/cloud/vectorsearch/v1/data_object_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectServiceClient::DataObjectServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +DataObjectServiceClient::~DataObjectServiceClient() = default; + +StatusOr +DataObjectServiceClient::CreateDataObject( + std::string const& parent, + google::cloud::vectorsearch::v1::DataObject const& data_object, + std::string const& data_object_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::CreateDataObjectRequest request; + request.set_parent(parent); + *request.mutable_data_object() = data_object; + request.set_data_object_id(data_object_id); + return connection_->CreateDataObject(request); +} + +StatusOr +DataObjectServiceClient::CreateDataObject( + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDataObject(request); +} + +StatusOr +DataObjectServiceClient::BatchCreateDataObjects( + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->BatchCreateDataObjects(request); +} + +StatusOr +DataObjectServiceClient::GetDataObject(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::GetDataObjectRequest request; + request.set_name(name); + return connection_->GetDataObject(request); +} + +StatusOr +DataObjectServiceClient::GetDataObject( + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetDataObject(request); +} + +StatusOr +DataObjectServiceClient::UpdateDataObject( + google::cloud::vectorsearch::v1::DataObject const& data_object, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::UpdateDataObjectRequest request; + *request.mutable_data_object() = data_object; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateDataObject(request); +} + +StatusOr +DataObjectServiceClient::UpdateDataObject( + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDataObject(request); +} + +StatusOr +DataObjectServiceClient::BatchUpdateDataObjects( + std::string const& parent, + std::vector const& + requests, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest request; + request.set_parent(parent); + *request.mutable_requests() = {requests.begin(), requests.end()}; + return connection_->BatchUpdateDataObjects(request); +} + +StatusOr +DataObjectServiceClient::BatchUpdateDataObjects( + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->BatchUpdateDataObjects(request); +} + +Status DataObjectServiceClient::DeleteDataObject(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::DeleteDataObjectRequest request; + request.set_name(name); + return connection_->DeleteDataObject(request); +} + +Status DataObjectServiceClient::DeleteDataObject( + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDataObject(request); +} + +Status DataObjectServiceClient::BatchDeleteDataObjects( + std::string const& parent, + std::vector const& + requests, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest request; + request.set_parent(parent); + *request.mutable_requests() = {requests.begin(), requests.end()}; + return connection_->BatchDeleteDataObjects(request); +} + +Status DataObjectServiceClient::BatchDeleteDataObjects( + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->BatchDeleteDataObjects(request); +} + +StreamRange +DataObjectServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr +DataObjectServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange +DataObjectServiceClient::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 +DataObjectServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr DataObjectServiceClient::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 DataObjectServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status DataObjectServiceClient::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 DataObjectServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status DataObjectServiceClient::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 DataObjectServiceClient::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 vectorsearch_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/data_object_client.h b/google/cloud/vectorsearch/v1/data_object_client.h new file mode 100644 index 0000000000000..307c116f70586 --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_client.h @@ -0,0 +1,829 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_CLIENT_H + +#include "google/cloud/vectorsearch/v1/data_object_connection.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/version.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// Service for creating and managing data objects. +/// +/// @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 DataObjectServiceClient { + public: + explicit DataObjectServiceClient( + std::shared_ptr connection, + Options opts = {}); + ~DataObjectServiceClient(); + + ///@{ + /// @name Copy and move support + DataObjectServiceClient(DataObjectServiceClient const&) = default; + DataObjectServiceClient& operator=(DataObjectServiceClient const&) = default; + DataObjectServiceClient(DataObjectServiceClient&&) = default; + DataObjectServiceClient& operator=(DataObjectServiceClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(DataObjectServiceClient const& a, + DataObjectServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(DataObjectServiceClient const& a, + DataObjectServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Creates a dataObject. + /// + /// @param parent Required. The resource name of the Collection to create the DataObject in. + /// Format: `projects/{project}/locations/{location}/collections/{collection}` + /// @param data_object Required. The DataObject to create. + /// @param data_object_id Required. The id of the dataObject to create. + /// The id must be 1-63 characters long, and comply with + /// [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + /// Specifically, it must be 1-63 characters long and match the regular + /// expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`. + /// @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.vectorsearch.v1.DataObject]) + /// 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.vectorsearch.v1.CreateDataObjectRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L108} + /// [google.cloud.vectorsearch.v1.DataObject]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object.proto#L33} + /// + // clang-format on + StatusOr CreateDataObject( + std::string const& parent, + google::cloud::vectorsearch::v1::DataObject const& data_object, + std::string const& data_object_id, Options opts = {}); + + // clang-format off + /// + /// Creates a dataObject. + /// + /// @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.vectorsearch.v1.CreateDataObjectRequest]. + /// 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.vectorsearch.v1.DataObject]) + /// 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.vectorsearch.v1.CreateDataObjectRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L108} + /// [google.cloud.vectorsearch.v1.DataObject]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object.proto#L33} + /// + // clang-format on + StatusOr CreateDataObject( + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a batch of dataObjects. + /// + /// @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.vectorsearch.v1.BatchCreateDataObjectsRequest]. + /// 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.vectorsearch.v1.BatchCreateDataObjectsResponse]) + /// 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.vectorsearch.v1.BatchCreateDataObjectsRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L131} + /// [google.cloud.vectorsearch.v1.BatchCreateDataObjectsResponse]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L151} + /// + // clang-format on + StatusOr + BatchCreateDataObjects( + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Gets a data object. + /// + /// @param name Required. The name of the DataObject resource. + /// Format: + /// `projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}` + /// @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.vectorsearch.v1.DataObject]) + /// 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.vectorsearch.v1.DataObject]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object.proto#L33} + /// [google.cloud.vectorsearch.v1.GetDataObjectRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L159} + /// + // clang-format on + StatusOr GetDataObject( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a data object. + /// + /// @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.vectorsearch.v1.GetDataObjectRequest]. + /// 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.vectorsearch.v1.DataObject]) + /// 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.vectorsearch.v1.DataObject]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object.proto#L33} + /// [google.cloud.vectorsearch.v1.GetDataObjectRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L159} + /// + // clang-format on + StatusOr GetDataObject( + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates a dataObject. + /// + /// @param data_object Required. The DataObject which replaces the resource on the server. + /// @param update_mask Optional. The update mask applies to the resource. See + /// [google.protobuf.FieldMask][google.protobuf.FieldMask]. + /// @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.vectorsearch.v1.DataObject]) + /// 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.vectorsearch.v1.DataObject]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object.proto#L33} + /// [google.cloud.vectorsearch.v1.UpdateDataObjectRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L173} + /// [google.protobuf.FieldMask]: @googleapis_reference_link{google/protobuf/field_mask.proto#L242} + /// + // clang-format on + StatusOr UpdateDataObject( + google::cloud::vectorsearch::v1::DataObject const& data_object, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a dataObject. + /// + /// @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.vectorsearch.v1.UpdateDataObjectRequest]. + /// 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.vectorsearch.v1.DataObject]) + /// 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.vectorsearch.v1.DataObject]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object.proto#L33} + /// [google.cloud.vectorsearch.v1.UpdateDataObjectRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L173} + /// + // clang-format on + StatusOr UpdateDataObject( + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates dataObjects in a batch. + /// + /// @param parent Required. The resource name of the Collection to update the DataObjects in. + /// Format: `projects/{project}/locations/{location}/collections/{collection}`. + /// The parent field in the UpdateDataObjectRequest messages must match this + /// field. + /// @param requests Required. The request message specifying the resources to update. + /// A maximum of 1000 DataObjects can be updated in a batch. + /// @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.vectorsearch.v1.BatchUpdateDataObjectsResponse]) + /// 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.vectorsearch.v1.BatchUpdateDataObjectsRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L185} + /// [google.cloud.vectorsearch.v1.BatchUpdateDataObjectsResponse]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L205} + /// + // clang-format on + StatusOr + BatchUpdateDataObjects( + std::string const& parent, + std::vector< + google::cloud::vectorsearch::v1::UpdateDataObjectRequest> const& + requests, + Options opts = {}); + + // clang-format off + /// + /// Updates dataObjects in a batch. + /// + /// @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.vectorsearch.v1.BatchUpdateDataObjectsRequest]. + /// 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.vectorsearch.v1.BatchUpdateDataObjectsResponse]) + /// 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.vectorsearch.v1.BatchUpdateDataObjectsRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L185} + /// [google.cloud.vectorsearch.v1.BatchUpdateDataObjectsResponse]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L205} + /// + // clang-format on + StatusOr + BatchUpdateDataObjects( + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Deletes a dataObject. + /// + /// @param name Required. The name of the DataObject resource to be deleted. + /// Format: + /// `projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}` + /// @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.cloud.vectorsearch.v1.DeleteDataObjectRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L209} + /// + // clang-format on + Status DeleteDataObject(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a dataObject. + /// + /// @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.vectorsearch.v1.DeleteDataObjectRequest]. + /// 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.cloud.vectorsearch.v1.DeleteDataObjectRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L209} + /// + // clang-format on + Status DeleteDataObject( + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes dataObjects in a batch. + /// + /// @param parent Required. The resource name of the Collection to delete the DataObjects in. + /// Format: `projects/{project}/locations/{location}/collections/{collection}`. + /// @param requests Required. The request message specifying the resources to delete. + /// A maximum of 1000 DataObjects can be deleted in a batch. + /// @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.cloud.vectorsearch.v1.BatchDeleteDataObjectsRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L228} + /// + // clang-format on + Status BatchDeleteDataObjects( + std::string const& parent, + std::vector< + google::cloud::vectorsearch::v1::DeleteDataObjectRequest> const& + requests, + Options opts = {}); + + // clang-format off + /// + /// Deletes dataObjects in a batch. + /// + /// @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.vectorsearch.v1.BatchDeleteDataObjectsRequest]. + /// 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.cloud.vectorsearch.v1.BatchDeleteDataObjectsRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_service.proto#L228} + /// + // clang-format on + Status BatchDeleteDataObjects( + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request, + 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 vectorsearch_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_CLIENT_H diff --git a/google/cloud/vectorsearch/v1/data_object_connection.cc b/google/cloud/vectorsearch/v1/data_object_connection.cc new file mode 100644 index 0000000000000..002bdf4879c92 --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_connection.cc @@ -0,0 +1,140 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#include "google/cloud/vectorsearch/v1/data_object_connection.h" +#include "google/cloud/vectorsearch/v1/data_object_options.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_connection_impl.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_option_defaults.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_stub_factory.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_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 vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectServiceConnection::~DataObjectServiceConnection() = default; + +StatusOr +DataObjectServiceConnection::CreateDataObject( + google::cloud::vectorsearch::v1::CreateDataObjectRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +DataObjectServiceConnection::BatchCreateDataObjects( + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +DataObjectServiceConnection::GetDataObject( + google::cloud::vectorsearch::v1::GetDataObjectRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +DataObjectServiceConnection::UpdateDataObject( + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +DataObjectServiceConnection::BatchUpdateDataObjects( + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status DataObjectServiceConnection::DeleteDataObject( + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status DataObjectServiceConnection::BatchDeleteDataObjects( + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +DataObjectServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +DataObjectServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +DataObjectServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +DataObjectServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status DataObjectServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status DataObjectServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeDataObjectServiceConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = vectorsearch_v1_internal::DataObjectServiceDefaultOptions( + std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = vectorsearch_v1_internal::CreateDefaultDataObjectServiceStub( + std::move(auth), options); + return vectorsearch_v1_internal::MakeDataObjectServiceTracingConnection( + std::make_shared< + vectorsearch_v1_internal::DataObjectServiceConnectionImpl>( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/data_object_connection.h b/google/cloud/vectorsearch/v1/data_object_connection.h new file mode 100644 index 0000000000000..8da3038216912 --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_connection.h @@ -0,0 +1,266 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_CONNECTION_H + +#include "google/cloud/vectorsearch/v1/data_object_connection_idempotency_policy.h" +#include "google/cloud/vectorsearch/v1/data_object_service.pb.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_retry_traits.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/internal/retry_policy_impl.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `DataObjectServiceConnection`. +class DataObjectServiceRetryPolicy : 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 `DataObjectServiceConnection` 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 DataObjectServiceLimitedErrorCountRetryPolicy + : public DataObjectServiceRetryPolicy { + 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 DataObjectServiceLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + DataObjectServiceLimitedErrorCountRetryPolicy( + DataObjectServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : DataObjectServiceLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + DataObjectServiceLimitedErrorCountRetryPolicy( + DataObjectServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : DataObjectServiceLimitedErrorCountRetryPolicy(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 = DataObjectServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + vectorsearch_v1_internal::DataObjectServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `DataObjectServiceConnection` 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 DataObjectServiceLimitedTimeRetryPolicy + : public DataObjectServiceRetryPolicy { + 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 DataObjectServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + DataObjectServiceLimitedTimeRetryPolicy( + DataObjectServiceLimitedTimeRetryPolicy&& rhs) noexcept + : DataObjectServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + DataObjectServiceLimitedTimeRetryPolicy( + DataObjectServiceLimitedTimeRetryPolicy const& rhs) noexcept + : DataObjectServiceLimitedTimeRetryPolicy(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 = DataObjectServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + vectorsearch_v1_internal::DataObjectServiceRetryTraits> + impl_; +}; + +/** + * The `DataObjectServiceConnection` object for `DataObjectServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `DataObjectServiceClient`. This allows users to inject custom + * behavior (e.g., with a Google Mock object) when writing tests that use + * objects of type `DataObjectServiceClient`. + * + * To create a concrete instance, see `MakeDataObjectServiceConnection()`. + * + * For mocking, see `vectorsearch_v1_mocks::MockDataObjectServiceConnection`. + */ +class DataObjectServiceConnection { + public: + virtual ~DataObjectServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StatusOr + CreateDataObject( + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request); + + virtual StatusOr< + google::cloud::vectorsearch::v1::BatchCreateDataObjectsResponse> + BatchCreateDataObjects( + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request); + + virtual StatusOr GetDataObject( + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request); + + virtual StatusOr + UpdateDataObject( + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request); + + virtual StatusOr< + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsResponse> + BatchUpdateDataObjects( + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request); + + virtual Status DeleteDataObject( + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request); + + virtual Status BatchDeleteDataObjects( + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request); + + 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 + * `DataObjectServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of + * DataObjectServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `DataObjectServiceConnection`. Expected options are any of the types + * in the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::vectorsearch_v1::DataObjectServicePolicyOptionList` + * + * @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 `DataObjectServiceConnection` created + * by this function. + */ +std::shared_ptr MakeDataObjectServiceConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_CONNECTION_H diff --git a/google/cloud/vectorsearch/v1/data_object_connection_idempotency_policy.cc b/google/cloud/vectorsearch/v1/data_object_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..1f633597c3965 --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_connection_idempotency_policy.cc @@ -0,0 +1,113 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#include "google/cloud/vectorsearch/v1/data_object_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +DataObjectServiceConnectionIdempotencyPolicy:: + ~DataObjectServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +DataObjectServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency DataObjectServiceConnectionIdempotencyPolicy::CreateDataObject( + google::cloud::vectorsearch::v1::CreateDataObjectRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +DataObjectServiceConnectionIdempotencyPolicy::BatchCreateDataObjects( + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataObjectServiceConnectionIdempotencyPolicy::GetDataObject( + google::cloud::vectorsearch::v1::GetDataObjectRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataObjectServiceConnectionIdempotencyPolicy::UpdateDataObject( + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +DataObjectServiceConnectionIdempotencyPolicy::BatchUpdateDataObjects( + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataObjectServiceConnectionIdempotencyPolicy::DeleteDataObject( + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +DataObjectServiceConnectionIdempotencyPolicy::BatchDeleteDataObjects( + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataObjectServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency DataObjectServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataObjectServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency DataObjectServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataObjectServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataObjectServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultDataObjectServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/data_object_connection_idempotency_policy.h b/google/cloud/vectorsearch/v1/data_object_connection_idempotency_policy.h new file mode 100644 index 0000000000000..12ecda5507d4c --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_connection_idempotency_policy.h @@ -0,0 +1,93 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vectorsearch/v1/data_object_service.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectServiceConnectionIdempotencyPolicy { + public: + virtual ~DataObjectServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() + const; + + virtual google::cloud::Idempotency CreateDataObject( + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request); + + virtual google::cloud::Idempotency BatchCreateDataObjects( + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request); + + virtual google::cloud::Idempotency GetDataObject( + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request); + + virtual google::cloud::Idempotency UpdateDataObject( + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request); + + virtual google::cloud::Idempotency BatchUpdateDataObjects( + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request); + + virtual google::cloud::Idempotency DeleteDataObject( + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request); + + virtual google::cloud::Idempotency BatchDeleteDataObjects( + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest 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 +MakeDefaultDataObjectServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/vectorsearch/v1/data_object_options.h b/google/cloud/vectorsearch/v1/data_object_options.h new file mode 100644 index 0000000000000..4ad34569ad8f7 --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_options.h @@ -0,0 +1,76 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_OPTIONS_H + +#include "google/cloud/vectorsearch/v1/data_object_connection.h" +#include "google/cloud/vectorsearch/v1/data_object_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 vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-vectorsearch-options + */ +struct DataObjectServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-vectorsearch-options + */ +struct DataObjectServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-vectorsearch-options + */ +struct DataObjectServiceConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to DataObjectService. + * + * @ingroup google-cloud-vectorsearch-options + */ +using DataObjectServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_OPTIONS_H diff --git a/google/cloud/vectorsearch/v1/data_object_search_client.cc b/google/cloud/vectorsearch/v1/data_object_search_client.cc new file mode 100644 index 0000000000000..74f1ee52c0155 --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_search_client.cc @@ -0,0 +1,147 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#include "google/cloud/vectorsearch/v1/data_object_search_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectSearchServiceClient::DataObjectSearchServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +DataObjectSearchServiceClient::~DataObjectSearchServiceClient() = default; + +StreamRange +DataObjectSearchServiceClient::SearchDataObjects( + google::cloud::vectorsearch::v1::SearchDataObjectsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->SearchDataObjects(std::move(request)); +} + +StreamRange +DataObjectSearchServiceClient::QueryDataObjects( + google::cloud::vectorsearch::v1::QueryDataObjectsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->QueryDataObjects(std::move(request)); +} + +StatusOr +DataObjectSearchServiceClient::AggregateDataObjects( + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AggregateDataObjects(request); +} + +StatusOr +DataObjectSearchServiceClient::BatchSearchDataObjects( + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->BatchSearchDataObjects(request); +} + +StreamRange +DataObjectSearchServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr +DataObjectSearchServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange +DataObjectSearchServiceClient::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 +DataObjectSearchServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr +DataObjectSearchServiceClient::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 +DataObjectSearchServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status DataObjectSearchServiceClient::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 DataObjectSearchServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status DataObjectSearchServiceClient::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 DataObjectSearchServiceClient::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 vectorsearch_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/data_object_search_client.h b/google/cloud/vectorsearch/v1/data_object_search_client.h new file mode 100644 index 0000000000000..5012dd5ae5646 --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_search_client.h @@ -0,0 +1,584 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_SEARCH_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_SEARCH_CLIENT_H + +#include "google/cloud/vectorsearch/v1/data_object_search_connection.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/version.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// Service for searching data objects. +/// +/// @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 DataObjectSearchServiceClient { + public: + explicit DataObjectSearchServiceClient( + std::shared_ptr connection, + Options opts = {}); + ~DataObjectSearchServiceClient(); + + ///@{ + /// @name Copy and move support + DataObjectSearchServiceClient(DataObjectSearchServiceClient const&) = default; + DataObjectSearchServiceClient& operator=( + DataObjectSearchServiceClient const&) = default; + DataObjectSearchServiceClient(DataObjectSearchServiceClient&&) = default; + DataObjectSearchServiceClient& operator=(DataObjectSearchServiceClient&&) = + default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(DataObjectSearchServiceClient const& a, + DataObjectSearchServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(DataObjectSearchServiceClient const& a, + DataObjectSearchServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Searches data objects. + /// + /// @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.vectorsearch.v1.SearchDataObjectsRequest]. + /// 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.vectorsearch.v1.SearchResult], 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.vectorsearch.v1.SearchDataObjectsRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_search_service.proto#L227} + /// [google.cloud.vectorsearch.v1.SearchResult]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_search_service.proto#L264} + /// + // clang-format on + StreamRange SearchDataObjects( + google::cloud::vectorsearch::v1::SearchDataObjectsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Queries data objects. + /// + /// @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.vectorsearch.v1.QueryDataObjectsRequest]. + /// 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.vectorsearch.v1.DataObject], 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.vectorsearch.v1.DataObject]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object.proto#L33} + /// [google.cloud.vectorsearch.v1.QueryDataObjectsRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_search_service.proto#L314} + /// + // clang-format on + StreamRange QueryDataObjects( + google::cloud::vectorsearch::v1::QueryDataObjectsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Aggregates data objects. + /// + /// @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.vectorsearch.v1.AggregateDataObjectsRequest]. + /// 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.vectorsearch.v1.AggregateDataObjectsResponse]) + /// 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.vectorsearch.v1.AggregateDataObjectsRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_search_service.proto#L286} + /// [google.cloud.vectorsearch.v1.AggregateDataObjectsResponse]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_search_service.proto#L306} + /// + // clang-format on + StatusOr + AggregateDataObjects( + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Batch searches data objects. + /// + /// @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.vectorsearch.v1.BatchSearchDataObjectsRequest]. + /// 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.vectorsearch.v1.BatchSearchDataObjectsResponse]) + /// 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.vectorsearch.v1.BatchSearchDataObjectsRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_search_service.proto#L358} + /// [google.cloud.vectorsearch.v1.BatchSearchDataObjectsResponse]: @googleapis_reference_link{google/cloud/vectorsearch/v1/data_object_search_service.proto#L404} + /// + // clang-format on + StatusOr + BatchSearchDataObjects( + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request, + 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 vectorsearch_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_SEARCH_CLIENT_H diff --git a/google/cloud/vectorsearch/v1/data_object_search_connection.cc b/google/cloud/vectorsearch/v1/data_object_search_connection.cc new file mode 100644 index 0000000000000..b8d3aee11b7cb --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_search_connection.cc @@ -0,0 +1,130 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#include "google/cloud/vectorsearch/v1/data_object_search_connection.h" +#include "google/cloud/vectorsearch/v1/data_object_search_options.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_connection_impl.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_option_defaults.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_stub_factory.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_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 vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectSearchServiceConnection::~DataObjectSearchServiceConnection() = + default; + +StreamRange +DataObjectSearchServiceConnection::SearchDataObjects( + google::cloud::vectorsearch::v1:: + SearchDataObjectsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StreamRange +DataObjectSearchServiceConnection::QueryDataObjects( + google::cloud::vectorsearch::v1:: + QueryDataObjectsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +DataObjectSearchServiceConnection::AggregateDataObjects( + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +DataObjectSearchServiceConnection::BatchSearchDataObjects( + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +DataObjectSearchServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +DataObjectSearchServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +DataObjectSearchServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +DataObjectSearchServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status DataObjectSearchServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status DataObjectSearchServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr +MakeDataObjectSearchServiceConnection(Options options) { + internal::CheckExpectedOptions( + options, __func__); + options = vectorsearch_v1_internal::DataObjectSearchServiceDefaultOptions( + std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = + vectorsearch_v1_internal::CreateDefaultDataObjectSearchServiceStub( + std::move(auth), options); + return vectorsearch_v1_internal::MakeDataObjectSearchServiceTracingConnection( + std::make_shared< + vectorsearch_v1_internal::DataObjectSearchServiceConnectionImpl>( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/data_object_search_connection.h b/google/cloud/vectorsearch/v1/data_object_search_connection.h new file mode 100644 index 0000000000000..04376bb9f909d --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_search_connection.h @@ -0,0 +1,263 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_SEARCH_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_SEARCH_CONNECTION_H + +#include "google/cloud/vectorsearch/v1/data_object_search_connection_idempotency_policy.h" +#include "google/cloud/vectorsearch/v1/data_object_search_service.pb.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_retry_traits.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/internal/retry_policy_impl.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `DataObjectSearchServiceConnection`. +class DataObjectSearchServiceRetryPolicy : 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 `DataObjectSearchServiceConnection` 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 DataObjectSearchServiceLimitedErrorCountRetryPolicy + : public DataObjectSearchServiceRetryPolicy { + 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 DataObjectSearchServiceLimitedErrorCountRetryPolicy( + int maximum_failures) + : impl_(maximum_failures) {} + + DataObjectSearchServiceLimitedErrorCountRetryPolicy( + DataObjectSearchServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : DataObjectSearchServiceLimitedErrorCountRetryPolicy( + rhs.maximum_failures()) {} + DataObjectSearchServiceLimitedErrorCountRetryPolicy( + DataObjectSearchServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : DataObjectSearchServiceLimitedErrorCountRetryPolicy( + 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< + DataObjectSearchServiceLimitedErrorCountRetryPolicy>( + maximum_failures()); + } + + // This is provided only for backwards compatibility. + using BaseType = DataObjectSearchServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + vectorsearch_v1_internal::DataObjectSearchServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `DataObjectSearchServiceConnection` 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 DataObjectSearchServiceLimitedTimeRetryPolicy + : public DataObjectSearchServiceRetryPolicy { + 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 DataObjectSearchServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + DataObjectSearchServiceLimitedTimeRetryPolicy( + DataObjectSearchServiceLimitedTimeRetryPolicy&& rhs) noexcept + : DataObjectSearchServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + DataObjectSearchServiceLimitedTimeRetryPolicy( + DataObjectSearchServiceLimitedTimeRetryPolicy const& rhs) noexcept + : DataObjectSearchServiceLimitedTimeRetryPolicy(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 = DataObjectSearchServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + vectorsearch_v1_internal::DataObjectSearchServiceRetryTraits> + impl_; +}; + +/** + * The `DataObjectSearchServiceConnection` object for + * `DataObjectSearchServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `DataObjectSearchServiceClient`. This allows users to inject custom + * behavior (e.g., with a Google Mock object) when writing tests that use + * objects of type `DataObjectSearchServiceClient`. + * + * To create a concrete instance, see `MakeDataObjectSearchServiceConnection()`. + * + * For mocking, see + * `vectorsearch_v1_mocks::MockDataObjectSearchServiceConnection`. + */ +class DataObjectSearchServiceConnection { + public: + virtual ~DataObjectSearchServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StreamRange + SearchDataObjects( + google::cloud::vectorsearch::v1::SearchDataObjectsRequest request); + + virtual StreamRange + QueryDataObjects( + google::cloud::vectorsearch::v1::QueryDataObjectsRequest request); + + virtual StatusOr< + google::cloud::vectorsearch::v1::AggregateDataObjectsResponse> + AggregateDataObjects( + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request); + + virtual StatusOr< + google::cloud::vectorsearch::v1::BatchSearchDataObjectsResponse> + BatchSearchDataObjects( + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request); + + 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 + * `DataObjectSearchServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of + * DataObjectSearchServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `DataObjectSearchServiceConnection`. Expected options are any of the + * types in the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::vectorsearch_v1::DataObjectSearchServicePolicyOptionList` + * + * @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 `DataObjectSearchServiceConnection` + * created by this function. + */ +std::shared_ptr +MakeDataObjectSearchServiceConnection(Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_SEARCH_CONNECTION_H diff --git a/google/cloud/vectorsearch/v1/data_object_search_connection_idempotency_policy.cc b/google/cloud/vectorsearch/v1/data_object_search_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..81150b576e81e --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_search_connection_idempotency_policy.cc @@ -0,0 +1,100 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#include "google/cloud/vectorsearch/v1/data_object_search_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +DataObjectSearchServiceConnectionIdempotencyPolicy:: + ~DataObjectSearchServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +DataObjectSearchServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique( + *this); +} + +Idempotency +DataObjectSearchServiceConnectionIdempotencyPolicy::SearchDataObjects( + google::cloud::vectorsearch::v1::SearchDataObjectsRequest) { // NOLINT + return Idempotency::kNonIdempotent; +} + +Idempotency +DataObjectSearchServiceConnectionIdempotencyPolicy::QueryDataObjects( + google::cloud::vectorsearch::v1::QueryDataObjectsRequest) { // NOLINT + return Idempotency::kNonIdempotent; +} + +Idempotency +DataObjectSearchServiceConnectionIdempotencyPolicy::AggregateDataObjects( + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +DataObjectSearchServiceConnectionIdempotencyPolicy::BatchSearchDataObjects( + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataObjectSearchServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency DataObjectSearchServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataObjectSearchServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency DataObjectSearchServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency DataObjectSearchServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency DataObjectSearchServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultDataObjectSearchServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/data_object_search_connection_idempotency_policy.h b/google/cloud/vectorsearch/v1/data_object_search_connection_idempotency_policy.h new file mode 100644 index 0000000000000..f585f01718766 --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_search_connection_idempotency_policy.h @@ -0,0 +1,83 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vectorsearch/v1/data_object_search_service.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectSearchServiceConnectionIdempotencyPolicy { + public: + virtual ~DataObjectSearchServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr + clone() const; + + virtual google::cloud::Idempotency SearchDataObjects( + google::cloud::vectorsearch::v1::SearchDataObjectsRequest request); + + virtual google::cloud::Idempotency QueryDataObjects( + google::cloud::vectorsearch::v1::QueryDataObjectsRequest request); + + virtual google::cloud::Idempotency AggregateDataObjects( + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request); + + virtual google::cloud::Idempotency BatchSearchDataObjects( + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest 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 +MakeDefaultDataObjectSearchServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/vectorsearch/v1/data_object_search_options.h b/google/cloud/vectorsearch/v1/data_object_search_options.h new file mode 100644 index 0000000000000..45b7396c778d0 --- /dev/null +++ b/google/cloud/vectorsearch/v1/data_object_search_options.h @@ -0,0 +1,77 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_SEARCH_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_SEARCH_OPTIONS_H + +#include "google/cloud/vectorsearch/v1/data_object_search_connection.h" +#include "google/cloud/vectorsearch/v1/data_object_search_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 vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-vectorsearch-options + */ +struct DataObjectSearchServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-vectorsearch-options + */ +struct DataObjectSearchServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-vectorsearch-options + */ +struct DataObjectSearchServiceConnectionIdempotencyPolicyOption { + using Type = + std::shared_ptr; +}; + +/** + * The options applicable to DataObjectSearchService. + * + * @ingroup google-cloud-vectorsearch-options + */ +using DataObjectSearchServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_DATA_OBJECT_SEARCH_OPTIONS_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_auth_decorator.cc b/google/cloud/vectorsearch/v1/internal/data_object_auth_decorator.cc new file mode 100644 index 0000000000000..a6013fef9797a --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_auth_decorator.cc @@ -0,0 +1,156 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_auth_decorator.h" +#include "google/cloud/vectorsearch/v1/data_object_service.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectServiceAuth::DataObjectServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +DataObjectServiceAuth::CreateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateDataObject(context, options, request); +} + +StatusOr +DataObjectServiceAuth::BatchCreateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->BatchCreateDataObjects(context, options, request); +} + +StatusOr +DataObjectServiceAuth::GetDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetDataObject(context, options, request); +} + +StatusOr +DataObjectServiceAuth::UpdateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateDataObject(context, options, request); +} + +StatusOr +DataObjectServiceAuth::BatchUpdateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->BatchUpdateDataObjects(context, options, request); +} + +Status DataObjectServiceAuth::DeleteDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteDataObject(context, options, request); +} + +Status DataObjectServiceAuth::BatchDeleteDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->BatchDeleteDataObjects(context, options, request); +} + +StatusOr +DataObjectServiceAuth::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 DataObjectServiceAuth::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 +DataObjectServiceAuth::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 DataObjectServiceAuth::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 DataObjectServiceAuth::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 DataObjectServiceAuth::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); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/data_object_auth_decorator.h b/google/cloud/vectorsearch/v1/internal/data_object_auth_decorator.h new file mode 100644 index 0000000000000..c757a59224d7e --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_auth_decorator.h @@ -0,0 +1,117 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_AUTH_DECORATOR_H + +#include "google/cloud/vectorsearch/v1/internal/data_object_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectServiceAuth : public DataObjectServiceStub { + public: + ~DataObjectServiceAuth() override = default; + DataObjectServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr CreateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) + override; + + StatusOr + BatchCreateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) override; + + StatusOr GetDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) + override; + + StatusOr UpdateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) + override; + + StatusOr + BatchUpdateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) override; + + Status DeleteDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) + override; + + Status BatchDeleteDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest 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; + + private: + std::shared_ptr auth_; + std::shared_ptr child_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_AUTH_DECORATOR_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_connection_impl.cc b/google/cloud/vectorsearch/v1/internal/data_object_connection_impl.cc new file mode 100644 index 0000000000000..d339120f63e26 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_connection_impl.cc @@ -0,0 +1,298 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_connection_impl.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_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/pagination_range.h" +#include "google/cloud/internal/retry_loop.h" +#include +#include + +namespace google { +namespace cloud { +namespace vectorsearch_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< + vectorsearch_v1::DataObjectServiceConnectionIdempotencyPolicyOption>() + ->clone(); +} + +} // namespace + +DataObjectServiceConnectionImpl::DataObjectServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions( + std::move(options), DataObjectServiceConnection::options())) {} + +StatusOr +DataObjectServiceConnectionImpl::CreateDataObject( + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateDataObject(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& + request) { + return stub_->CreateDataObject(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +DataObjectServiceConnectionImpl::BatchCreateDataObjects( + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->BatchCreateDataObjects(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) { + return stub_->BatchCreateDataObjects(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +DataObjectServiceConnectionImpl::GetDataObject( + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetDataObject(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetDataObjectRequest const& + request) { + return stub_->GetDataObject(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +DataObjectServiceConnectionImpl::UpdateDataObject( + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateDataObject(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& + request) { + return stub_->UpdateDataObject(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +DataObjectServiceConnectionImpl::BatchUpdateDataObjects( + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->BatchUpdateDataObjects(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) { + return stub_->BatchUpdateDataObjects(context, options, request); + }, + *current, request, __func__); +} + +Status DataObjectServiceConnectionImpl::DeleteDataObject( + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteDataObject(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& + request) { + return stub_->DeleteDataObject(context, options, request); + }, + *current, request, __func__); +} + +Status DataObjectServiceConnectionImpl::BatchDeleteDataObjects( + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->BatchDeleteDataObjects(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request) { + return stub_->BatchDeleteDataObjects(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +DataObjectServiceConnectionImpl::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 +DataObjectServiceConnectionImpl::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 +DataObjectServiceConnectionImpl::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 +DataObjectServiceConnectionImpl::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 DataObjectServiceConnectionImpl::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 DataObjectServiceConnectionImpl::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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/internal/data_object_connection_impl.h b/google/cloud/vectorsearch/v1/internal/data_object_connection_impl.h new file mode 100644 index 0000000000000..02df83bc5b2ef --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_connection_impl.h @@ -0,0 +1,111 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_CONNECTION_IMPL_H + +#include "google/cloud/vectorsearch/v1/data_object_connection.h" +#include "google/cloud/vectorsearch/v1/data_object_connection_idempotency_policy.h" +#include "google/cloud/vectorsearch/v1/data_object_options.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_retry_traits.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_stub.h" +#include "google/cloud/background_threads.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectServiceConnectionImpl + : public vectorsearch_v1::DataObjectServiceConnection { + public: + ~DataObjectServiceConnectionImpl() override = default; + + DataObjectServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + StatusOr CreateDataObject( + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) + override; + + StatusOr + BatchCreateDataObjects( + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) override; + + StatusOr GetDataObject( + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) + override; + + StatusOr UpdateDataObject( + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) + override; + + StatusOr + BatchUpdateDataObjects( + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) override; + + Status DeleteDataObject( + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) + override; + + Status BatchDeleteDataObjects( + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request) 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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_CONNECTION_IMPL_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_logging_decorator.cc b/google/cloud/vectorsearch/v1/internal/data_object_logging_decorator.cc new file mode 100644 index 0000000000000..af8c2aaa13788 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_logging_decorator.cc @@ -0,0 +1,210 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_logging_decorator.h" +#include "google/cloud/vectorsearch/v1/data_object_service.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectServiceLogging::DataObjectServiceLogging( + std::shared_ptr child, + TracingOptions tracing_options, std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +DataObjectServiceLogging::CreateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& + request) { + return child_->CreateDataObject(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataObjectServiceLogging::BatchCreateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) { + return child_->BatchCreateDataObjects(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataObjectServiceLogging::GetDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetDataObjectRequest const& + request) { + return child_->GetDataObject(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataObjectServiceLogging::UpdateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& + request) { + return child_->UpdateDataObject(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataObjectServiceLogging::BatchUpdateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) { + return child_->BatchUpdateDataObjects(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status DataObjectServiceLogging::DeleteDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& + request) { + return child_->DeleteDataObject(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status DataObjectServiceLogging::BatchDeleteDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request) { + return child_->BatchDeleteDataObjects(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataObjectServiceLogging::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 +DataObjectServiceLogging::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 +DataObjectServiceLogging::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 DataObjectServiceLogging::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 DataObjectServiceLogging::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 DataObjectServiceLogging::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_); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/data_object_logging_decorator.h b/google/cloud/vectorsearch/v1/internal/data_object_logging_decorator.h new file mode 100644 index 0000000000000..72c6ae64d6f0c --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_logging_decorator.h @@ -0,0 +1,117 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_LOGGING_DECORATOR_H + +#include "google/cloud/vectorsearch/v1/internal/data_object_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectServiceLogging : public DataObjectServiceStub { + public: + ~DataObjectServiceLogging() override = default; + DataObjectServiceLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr CreateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) + override; + + StatusOr + BatchCreateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) override; + + StatusOr GetDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) + override; + + StatusOr UpdateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) + override; + + StatusOr + BatchUpdateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) override; + + Status DeleteDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) + override; + + Status BatchDeleteDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest 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; + + private: + std::shared_ptr child_; + TracingOptions tracing_options_; +}; // DataObjectServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_LOGGING_DECORATOR_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_metadata_decorator.cc b/google/cloud/vectorsearch/v1/internal/data_object_metadata_decorator.cc new file mode 100644 index 0000000000000..e2d9bce0b4c81 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_metadata_decorator.cc @@ -0,0 +1,186 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_metadata_decorator.h" +#include "google/cloud/vectorsearch/v1/data_object_service.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectServiceMetadata::DataObjectServiceMetadata( + 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 +DataObjectServiceMetadata::CreateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateDataObject(context, options, request); +} + +StatusOr +DataObjectServiceMetadata::BatchCreateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->BatchCreateDataObjects(context, options, request); +} + +StatusOr +DataObjectServiceMetadata::GetDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetDataObject(context, options, request); +} + +StatusOr +DataObjectServiceMetadata::UpdateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) { + SetMetadata(context, options, + absl::StrCat("data_object.name=", + internal::UrlEncode(request.data_object().name()))); + return child_->UpdateDataObject(context, options, request); +} + +StatusOr +DataObjectServiceMetadata::BatchUpdateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->BatchUpdateDataObjects(context, options, request); +} + +Status DataObjectServiceMetadata::DeleteDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteDataObject(context, options, request); +} + +Status DataObjectServiceMetadata::BatchDeleteDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->BatchDeleteDataObjects(context, options, request); +} + +StatusOr +DataObjectServiceMetadata::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 +DataObjectServiceMetadata::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 +DataObjectServiceMetadata::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 +DataObjectServiceMetadata::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 DataObjectServiceMetadata::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 DataObjectServiceMetadata::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); +} + +void DataObjectServiceMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void DataObjectServiceMetadata::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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/data_object_metadata_decorator.h b/google/cloud/vectorsearch/v1/internal/data_object_metadata_decorator.h new file mode 100644 index 0000000000000..65804aab12477 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_metadata_decorator.h @@ -0,0 +1,123 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_METADATA_DECORATOR_H + +#include "google/cloud/vectorsearch/v1/internal/data_object_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectServiceMetadata : public DataObjectServiceStub { + public: + ~DataObjectServiceMetadata() override = default; + DataObjectServiceMetadata( + std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr CreateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) + override; + + StatusOr + BatchCreateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) override; + + StatusOr GetDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) + override; + + StatusOr UpdateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) + override; + + StatusOr + BatchUpdateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) override; + + Status DeleteDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) + override; + + Status BatchDeleteDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest 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; + + 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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_METADATA_DECORATOR_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_option_defaults.cc b/google/cloud/vectorsearch/v1/internal/data_object_option_defaults.cc new file mode 100644 index 0000000000000..75bd4391d396f --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_option_defaults.cc @@ -0,0 +1,69 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_option_defaults.h" +#include "google/cloud/vectorsearch/v1/data_object_connection.h" +#include "google/cloud/vectorsearch/v1/data_object_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 vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options DataObjectServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_DATA_OBJECT_SERVICE_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_DATA_OBJECT_SERVICE_AUTHORITY", + "vectorsearch.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + vectorsearch_v1::DataObjectServiceLimitedTimeRetryPolicy( + std::chrono::minutes(10)) + .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< + vectorsearch_v1::DataObjectServiceConnectionIdempotencyPolicyOption>( + vectorsearch_v1:: + MakeDefaultDataObjectServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/internal/data_object_option_defaults.h b/google/cloud/vectorsearch/v1/internal/data_object_option_defaults.h new file mode 100644 index 0000000000000..b572a074358f2 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options DataObjectServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_OPTION_DEFAULTS_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_retry_traits.h b/google/cloud/vectorsearch/v1/internal/data_object_retry_traits.h new file mode 100644 index 0000000000000..9e05e87806660 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct DataObjectServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_RETRY_TRAITS_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_auth_decorator.cc b/google/cloud/vectorsearch/v1/internal/data_object_search_auth_decorator.cc new file mode 100644 index 0000000000000..fc7b32de06907 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_auth_decorator.cc @@ -0,0 +1,132 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_auth_decorator.h" +#include "google/cloud/vectorsearch/v1/data_object_search_service.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectSearchServiceAuth::DataObjectSearchServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +DataObjectSearchServiceAuth::SearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::SearchDataObjectsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->SearchDataObjects(context, options, request); +} + +StatusOr +DataObjectSearchServiceAuth::QueryDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::QueryDataObjectsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->QueryDataObjects(context, options, request); +} + +StatusOr +DataObjectSearchServiceAuth::AggregateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->AggregateDataObjects(context, options, request); +} + +StatusOr +DataObjectSearchServiceAuth::BatchSearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->BatchSearchDataObjects(context, options, request); +} + +StatusOr +DataObjectSearchServiceAuth::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 +DataObjectSearchServiceAuth::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 +DataObjectSearchServiceAuth::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 +DataObjectSearchServiceAuth::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 DataObjectSearchServiceAuth::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 DataObjectSearchServiceAuth::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); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_auth_decorator.h b/google/cloud/vectorsearch/v1/internal/data_object_search_auth_decorator.h new file mode 100644 index 0000000000000..8b2b1701a921d --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_auth_decorator.h @@ -0,0 +1,104 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_AUTH_DECORATOR_H + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectSearchServiceAuth : public DataObjectSearchServiceStub { + public: + ~DataObjectSearchServiceAuth() override = default; + DataObjectSearchServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr + SearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::SearchDataObjectsRequest const& request) + override; + + StatusOr + QueryDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::QueryDataObjectsRequest const& request) + override; + + StatusOr + AggregateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) override; + + StatusOr + BatchSearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest 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; + + private: + std::shared_ptr auth_; + std::shared_ptr child_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_AUTH_DECORATOR_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_connection_impl.cc b/google/cloud/vectorsearch/v1/internal/data_object_search_connection_impl.cc new file mode 100644 index 0000000000000..1cd9f4f721cfc --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_connection_impl.cc @@ -0,0 +1,299 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_connection_impl.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_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/pagination_range.h" +#include "google/cloud/internal/retry_loop.h" +#include +#include + +namespace google { +namespace cloud { +namespace vectorsearch_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< + vectorsearch_v1::DataObjectSearchServiceConnectionIdempotencyPolicy> +idempotency_policy(Options const& options) { + return options + .get() + ->clone(); +} + +} // namespace + +DataObjectSearchServiceConnectionImpl::DataObjectSearchServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions( + std::move(options), DataObjectSearchServiceConnection::options())) {} + +StreamRange +DataObjectSearchServiceConnectionImpl::SearchDataObjects( + google::cloud::vectorsearch::v1::SearchDataObjectsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->SearchDataObjects(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::vectorsearch::v1::SearchDataObjectsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::SearchDataObjectsRequest const& + request) { + return stub->SearchDataObjects(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::vectorsearch::v1::SearchDataObjectsResponse r) { + std::vector result( + r.results().size()); + auto& messages = *r.mutable_results(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StreamRange +DataObjectSearchServiceConnectionImpl::QueryDataObjects( + google::cloud::vectorsearch::v1::QueryDataObjectsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->QueryDataObjects(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::vectorsearch::v1::QueryDataObjectsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::QueryDataObjectsRequest const& + request) { + return stub->QueryDataObjects(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::vectorsearch::v1::QueryDataObjectsResponse r) { + std::vector result( + r.data_objects().size()); + auto& messages = *r.mutable_data_objects(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +DataObjectSearchServiceConnectionImpl::AggregateDataObjects( + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->AggregateDataObjects(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) { + return stub_->AggregateDataObjects(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +DataObjectSearchServiceConnectionImpl::BatchSearchDataObjects( + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->BatchSearchDataObjects(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request) { + return stub_->BatchSearchDataObjects(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +DataObjectSearchServiceConnectionImpl::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 +DataObjectSearchServiceConnectionImpl::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 +DataObjectSearchServiceConnectionImpl::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 +DataObjectSearchServiceConnectionImpl::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 DataObjectSearchServiceConnectionImpl::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 DataObjectSearchServiceConnectionImpl::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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_connection_impl.h b/google/cloud/vectorsearch/v1/internal/data_object_search_connection_impl.h new file mode 100644 index 0000000000000..526d24f579253 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_connection_impl.h @@ -0,0 +1,100 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_CONNECTION_IMPL_H + +#include "google/cloud/vectorsearch/v1/data_object_search_connection.h" +#include "google/cloud/vectorsearch/v1/data_object_search_connection_idempotency_policy.h" +#include "google/cloud/vectorsearch/v1/data_object_search_options.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_retry_traits.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_stub.h" +#include "google/cloud/background_threads.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectSearchServiceConnectionImpl + : public vectorsearch_v1::DataObjectSearchServiceConnection { + public: + ~DataObjectSearchServiceConnectionImpl() override = default; + + DataObjectSearchServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr + stub, + Options options); + + Options options() override { return options_; } + + StreamRange SearchDataObjects( + google::cloud::vectorsearch::v1::SearchDataObjectsRequest request) + override; + + StreamRange QueryDataObjects( + google::cloud::vectorsearch::v1::QueryDataObjectsRequest request) + override; + + StatusOr + AggregateDataObjects( + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) override; + + StatusOr + BatchSearchDataObjects( + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request) 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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_CONNECTION_IMPL_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_logging_decorator.cc b/google/cloud/vectorsearch/v1/internal/data_object_search_logging_decorator.cc new file mode 100644 index 0000000000000..9b5757f5d0453 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_logging_decorator.cc @@ -0,0 +1,171 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_logging_decorator.h" +#include "google/cloud/vectorsearch/v1/data_object_search_service.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectSearchServiceLogging::DataObjectSearchServiceLogging( + std::shared_ptr child, + TracingOptions tracing_options, std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +DataObjectSearchServiceLogging::SearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::SearchDataObjectsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::SearchDataObjectsRequest const& + request) { + return child_->SearchDataObjects(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataObjectSearchServiceLogging::QueryDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::QueryDataObjectsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::QueryDataObjectsRequest const& + request) { + return child_->QueryDataObjects(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataObjectSearchServiceLogging::AggregateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) { + return child_->AggregateDataObjects(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataObjectSearchServiceLogging::BatchSearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request) { + return child_->BatchSearchDataObjects(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +DataObjectSearchServiceLogging::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 +DataObjectSearchServiceLogging::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 +DataObjectSearchServiceLogging::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 +DataObjectSearchServiceLogging::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 DataObjectSearchServiceLogging::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 DataObjectSearchServiceLogging::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_); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_logging_decorator.h b/google/cloud/vectorsearch/v1/internal/data_object_search_logging_decorator.h new file mode 100644 index 0000000000000..a1ded9d89c1ad --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_logging_decorator.h @@ -0,0 +1,104 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_LOGGING_DECORATOR_H + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectSearchServiceLogging : public DataObjectSearchServiceStub { + public: + ~DataObjectSearchServiceLogging() override = default; + DataObjectSearchServiceLogging( + std::shared_ptr child, + TracingOptions tracing_options, std::set const& components); + + StatusOr + SearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::SearchDataObjectsRequest const& request) + override; + + StatusOr + QueryDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::QueryDataObjectsRequest const& request) + override; + + StatusOr + AggregateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) override; + + StatusOr + BatchSearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest 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; + + private: + std::shared_ptr child_; + TracingOptions tracing_options_; +}; // DataObjectSearchServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_LOGGING_DECORATOR_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_metadata_decorator.cc b/google/cloud/vectorsearch/v1/internal/data_object_search_metadata_decorator.cc new file mode 100644 index 0000000000000..ddf530ccd2e26 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_metadata_decorator.cc @@ -0,0 +1,159 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_metadata_decorator.h" +#include "google/cloud/vectorsearch/v1/data_object_search_service.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectSearchServiceMetadata::DataObjectSearchServiceMetadata( + 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 +DataObjectSearchServiceMetadata::SearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::SearchDataObjectsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->SearchDataObjects(context, options, request); +} + +StatusOr +DataObjectSearchServiceMetadata::QueryDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::QueryDataObjectsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->QueryDataObjects(context, options, request); +} + +StatusOr +DataObjectSearchServiceMetadata::AggregateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AggregateDataObjects(context, options, request); +} + +StatusOr +DataObjectSearchServiceMetadata::BatchSearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->BatchSearchDataObjects(context, options, request); +} + +StatusOr +DataObjectSearchServiceMetadata::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 +DataObjectSearchServiceMetadata::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 +DataObjectSearchServiceMetadata::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 +DataObjectSearchServiceMetadata::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 DataObjectSearchServiceMetadata::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 DataObjectSearchServiceMetadata::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); +} + +void DataObjectSearchServiceMetadata::SetMetadata( + grpc::ClientContext& context, Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void DataObjectSearchServiceMetadata::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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_metadata_decorator.h b/google/cloud/vectorsearch/v1/internal/data_object_search_metadata_decorator.h new file mode 100644 index 0000000000000..d3479fc8fb846 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_metadata_decorator.h @@ -0,0 +1,110 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_METADATA_DECORATOR_H + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectSearchServiceMetadata : public DataObjectSearchServiceStub { + public: + ~DataObjectSearchServiceMetadata() override = default; + DataObjectSearchServiceMetadata( + std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr + SearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::SearchDataObjectsRequest const& request) + override; + + StatusOr + QueryDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::QueryDataObjectsRequest const& request) + override; + + StatusOr + AggregateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) override; + + StatusOr + BatchSearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest 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; + + 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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_METADATA_DECORATOR_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_option_defaults.cc b/google/cloud/vectorsearch/v1/internal/data_object_search_option_defaults.cc new file mode 100644 index 0000000000000..8277d6220fcad --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_option_defaults.cc @@ -0,0 +1,73 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_option_defaults.h" +#include "google/cloud/vectorsearch/v1/data_object_search_connection.h" +#include "google/cloud/vectorsearch/v1/data_object_search_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 vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options DataObjectSearchServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), + "GOOGLE_CLOUD_CPP_DATA_OBJECT_SEARCH_SERVICE_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_DATA_OBJECT_SEARCH_SERVICE_AUTHORITY", + "vectorsearch.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options + .has()) { + options.set( + vectorsearch_v1::DataObjectSearchServiceLimitedTimeRetryPolicy( + std::chrono::minutes(10)) + .clone()); + } + if (!options.has< + vectorsearch_v1::DataObjectSearchServiceBackoffPolicyOption>()) { + options.set( + ExponentialBackoffPolicy( + std::chrono::seconds(0), std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling, kBackoffScaling) + .clone()); + } + if (!options.has< + vectorsearch_v1:: + DataObjectSearchServiceConnectionIdempotencyPolicyOption>()) { + options.set( + vectorsearch_v1:: + MakeDefaultDataObjectSearchServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_option_defaults.h b/google/cloud/vectorsearch/v1/internal/data_object_search_option_defaults.h new file mode 100644 index 0000000000000..61cea05cf1e3f --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options DataObjectSearchServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_OPTION_DEFAULTS_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_retry_traits.h b/google/cloud/vectorsearch/v1/internal/data_object_search_retry_traits.h new file mode 100644 index 0000000000000..6b5510db938c1 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct DataObjectSearchServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_RETRY_TRAITS_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_sources.cc b/google/cloud/vectorsearch/v1/internal/data_object_search_sources.cc new file mode 100644 index 0000000000000..47d4f522b0748 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/vectorsearch/v1/data_object_search_client.cc" +#include "google/cloud/vectorsearch/v1/data_object_search_connection.cc" +#include "google/cloud/vectorsearch/v1/data_object_search_connection_idempotency_policy.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_auth_decorator.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_connection_impl.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_logging_decorator.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_metadata_decorator.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_option_defaults.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_stub.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_stub_factory.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_tracing_connection.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_tracing_stub.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_stub.cc b/google/cloud/vectorsearch/v1/internal/data_object_search_stub.cc new file mode 100644 index 0000000000000..9de0a5d71df46 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_stub.cc @@ -0,0 +1,162 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_stub.h" +#include "google/cloud/vectorsearch/v1/data_object_search_service.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectSearchServiceStub::~DataObjectSearchServiceStub() = default; + +StatusOr +DefaultDataObjectSearchServiceStub::SearchDataObjects( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::SearchDataObjectsRequest const& request) { + google::cloud::vectorsearch::v1::SearchDataObjectsResponse response; + auto status = grpc_stub_->SearchDataObjects(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataObjectSearchServiceStub::QueryDataObjects( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::QueryDataObjectsRequest const& request) { + google::cloud::vectorsearch::v1::QueryDataObjectsResponse response; + auto status = grpc_stub_->QueryDataObjects(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataObjectSearchServiceStub::AggregateDataObjects( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) { + google::cloud::vectorsearch::v1::AggregateDataObjectsResponse response; + auto status = grpc_stub_->AggregateDataObjects(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataObjectSearchServiceStub::BatchSearchDataObjects( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request) { + google::cloud::vectorsearch::v1::BatchSearchDataObjectsResponse response; + auto status = + grpc_stub_->BatchSearchDataObjects(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataObjectSearchServiceStub::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 +DefaultDataObjectSearchServiceStub::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 +DefaultDataObjectSearchServiceStub::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 +DefaultDataObjectSearchServiceStub::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 DefaultDataObjectSearchServiceStub::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 DefaultDataObjectSearchServiceStub::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(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_stub.h b/google/cloud/vectorsearch/v1/internal/data_object_search_stub.h new file mode 100644 index 0000000000000..cb338f41bd8c7 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_stub.h @@ -0,0 +1,174 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_STUB_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vectorsearch/v1/data_object_search_service.grpc.pb.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectSearchServiceStub { + public: + virtual ~DataObjectSearchServiceStub() = 0; + + virtual StatusOr + SearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::SearchDataObjectsRequest const& + request) = 0; + + virtual StatusOr + QueryDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::QueryDataObjectsRequest const& + request) = 0; + + virtual StatusOr< + google::cloud::vectorsearch::v1::AggregateDataObjectsResponse> + AggregateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) = 0; + + virtual StatusOr< + google::cloud::vectorsearch::v1::BatchSearchDataObjectsResponse> + BatchSearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest 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; +}; + +class DefaultDataObjectSearchServiceStub : public DataObjectSearchServiceStub { + public: + explicit DefaultDataObjectSearchServiceStub( + std::unique_ptr + grpc_stub, + std::unique_ptr + operations_stub, + std::unique_ptr + locations_stub) + : grpc_stub_(std::move(grpc_stub)), + operations_stub_(std::move(operations_stub)), + locations_stub_(std::move(locations_stub)) {} + + StatusOr + SearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::SearchDataObjectsRequest const& request) + override; + + StatusOr + QueryDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::QueryDataObjectsRequest const& request) + override; + + StatusOr + AggregateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) override; + + StatusOr + BatchSearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest 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; + + private: + std::unique_ptr< + google::cloud::vectorsearch::v1::DataObjectSearchService::StubInterface> + grpc_stub_; + std::unique_ptr + operations_stub_; + std::unique_ptr + locations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_STUB_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_stub_factory.cc b/google/cloud/vectorsearch/v1/internal/data_object_search_stub_factory.cc new file mode 100644 index 0000000000000..8078d4825f7a5 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_stub_factory.cc @@ -0,0 +1,86 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vectorsearch/v1/data_object_search_service.grpc.pb.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_auth_decorator.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_logging_decorator.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_metadata_decorator.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_stub.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_search_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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr +CreateDefaultDataObjectSearchServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::vectorsearch::v1::DataObjectSearchService::NewStub( + channel); + auto service_operations_stub = + google::longrunning::Operations::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_operations_stub), + std::move(service_locations_stub)); + + 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 = MakeDataObjectSearchServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_stub_factory.h b/google/cloud/vectorsearch/v1/internal/data_object_search_stub_factory.h new file mode 100644 index 0000000000000..db54d15dd7a6f --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_stub_factory.h @@ -0,0 +1,48 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_STUB_FACTORY_H + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr +CreateDefaultDataObjectSearchServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_STUB_FACTORY_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_tracing_connection.cc b/google/cloud/vectorsearch/v1/internal/data_object_search_tracing_connection.cc new file mode 100644 index 0000000000000..ce0dd27d152ea --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_tracing_connection.cc @@ -0,0 +1,151 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectSearchServiceTracingConnection:: + DataObjectSearchServiceTracingConnection( + std::shared_ptr + child) + : child_(std::move(child)) {} + +StreamRange +DataObjectSearchServiceTracingConnection::SearchDataObjects( + google::cloud::vectorsearch::v1::SearchDataObjectsRequest request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectSearchServiceConnection::SearchDataObjects"); + internal::OTelScope scope(span); + auto sr = child_->SearchDataObjects(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::vectorsearch::v1::SearchResult>(std::move(span), + std::move(sr)); +} + +StreamRange +DataObjectSearchServiceTracingConnection::QueryDataObjects( + google::cloud::vectorsearch::v1::QueryDataObjectsRequest request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectSearchServiceConnection::QueryDataObjects"); + internal::OTelScope scope(span); + auto sr = child_->QueryDataObjects(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::vectorsearch::v1::DataObject>(std::move(span), + std::move(sr)); +} + +StatusOr +DataObjectSearchServiceTracingConnection::AggregateDataObjects( + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectSearchServiceConnection::" + "AggregateDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->AggregateDataObjects(request)); +} + +StatusOr +DataObjectSearchServiceTracingConnection::BatchSearchDataObjects( + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectSearchServiceConnection::" + "BatchSearchDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->BatchSearchDataObjects(request)); +} + +StreamRange +DataObjectSearchServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectSearchServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +DataObjectSearchServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectSearchServiceConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +DataObjectSearchServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectSearchServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +DataObjectSearchServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectSearchServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status DataObjectSearchServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectSearchServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status DataObjectSearchServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectSearchServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeDataObjectSearchServiceTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared( + std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_tracing_connection.h b/google/cloud/vectorsearch/v1/internal/data_object_search_tracing_connection.h new file mode 100644 index 0000000000000..5a2df6477a956 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_tracing_connection.h @@ -0,0 +1,97 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_TRACING_CONNECTION_H + +#include "google/cloud/vectorsearch/v1/data_object_search_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectSearchServiceTracingConnection + : public vectorsearch_v1::DataObjectSearchServiceConnection { + public: + ~DataObjectSearchServiceTracingConnection() override = default; + + explicit DataObjectSearchServiceTracingConnection( + std::shared_ptr + child); + + Options options() override { return child_->options(); } + + StreamRange SearchDataObjects( + google::cloud::vectorsearch::v1::SearchDataObjectsRequest request) + override; + + StreamRange QueryDataObjects( + google::cloud::vectorsearch::v1::QueryDataObjectsRequest request) + override; + + StatusOr + AggregateDataObjects( + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) override; + + StatusOr + BatchSearchDataObjects( + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request) 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_; +}; + +/** + * 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 +MakeDataObjectSearchServiceTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_TRACING_CONNECTION_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_tracing_stub.cc b/google/cloud/vectorsearch/v1/internal/data_object_search_tracing_stub.cc new file mode 100644 index 0000000000000..f3e7e4034af42 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_tracing_stub.cc @@ -0,0 +1,174 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectSearchServiceTracingStub::DataObjectSearchServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +DataObjectSearchServiceTracingStub::SearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::SearchDataObjectsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectSearchService", + "SearchDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->SearchDataObjects(context, options, request)); +} + +StatusOr +DataObjectSearchServiceTracingStub::QueryDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::QueryDataObjectsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectSearchService", + "QueryDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->QueryDataObjects(context, options, request)); +} + +StatusOr +DataObjectSearchServiceTracingStub::AggregateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectSearchService", + "AggregateDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->AggregateDataObjects(context, options, request)); +} + +StatusOr +DataObjectSearchServiceTracingStub::BatchSearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectSearchService", + "BatchSearchDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->BatchSearchDataObjects(context, options, request)); +} + +StatusOr +DataObjectSearchServiceTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectSearchService", "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +DataObjectSearchServiceTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectSearchService", "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +DataObjectSearchServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectSearchService", "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +DataObjectSearchServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectSearchService", "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status DataObjectSearchServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectSearchService", + "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status DataObjectSearchServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectSearchService", + "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +std::shared_ptr +MakeDataObjectSearchServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/data_object_search_tracing_stub.h b/google/cloud/vectorsearch/v1/internal/data_object_search_tracing_stub.h new file mode 100644 index 0000000000000..7a2800087753b --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_search_tracing_stub.h @@ -0,0 +1,114 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_TRACING_STUB_H + +#include "google/cloud/vectorsearch/v1/internal/data_object_search_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectSearchServiceTracingStub : public DataObjectSearchServiceStub { + public: + ~DataObjectSearchServiceTracingStub() override = default; + + explicit DataObjectSearchServiceTracingStub( + std::shared_ptr child); + + StatusOr + SearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::SearchDataObjectsRequest const& request) + override; + + StatusOr + QueryDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::QueryDataObjectsRequest const& request) + override; + + StatusOr + AggregateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request) override; + + StatusOr + BatchSearchDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest 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; + + private: + std::shared_ptr child_; + std::shared_ptr + propagator_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr +MakeDataObjectSearchServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_SEARCH_TRACING_STUB_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_sources.cc b/google/cloud/vectorsearch/v1/internal/data_object_sources.cc new file mode 100644 index 0000000000000..c2fda11619c39 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/vectorsearch/v1/data_object_client.cc" +#include "google/cloud/vectorsearch/v1/data_object_connection.cc" +#include "google/cloud/vectorsearch/v1/data_object_connection_idempotency_policy.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_auth_decorator.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_connection_impl.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_logging_decorator.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_metadata_decorator.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_option_defaults.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_stub.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_stub_factory.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_tracing_connection.cc" +#include "google/cloud/vectorsearch/v1/internal/data_object_tracing_stub.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/vectorsearch/v1/internal/data_object_stub.cc b/google/cloud/vectorsearch/v1/internal/data_object_stub.cc new file mode 100644 index 0000000000000..9c5308161e4cc --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_stub.cc @@ -0,0 +1,199 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_stub.h" +#include "google/cloud/vectorsearch/v1/data_object_service.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectServiceStub::~DataObjectServiceStub() = default; + +StatusOr +DefaultDataObjectServiceStub::CreateDataObject( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) { + google::cloud::vectorsearch::v1::DataObject response; + auto status = grpc_stub_->CreateDataObject(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataObjectServiceStub::BatchCreateDataObjects( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) { + google::cloud::vectorsearch::v1::BatchCreateDataObjectsResponse response; + auto status = + grpc_stub_->BatchCreateDataObjects(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataObjectServiceStub::GetDataObject( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) { + google::cloud::vectorsearch::v1::DataObject response; + auto status = grpc_stub_->GetDataObject(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataObjectServiceStub::UpdateDataObject( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) { + google::cloud::vectorsearch::v1::DataObject response; + auto status = grpc_stub_->UpdateDataObject(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultDataObjectServiceStub::BatchUpdateDataObjects( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) { + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsResponse response; + auto status = + grpc_stub_->BatchUpdateDataObjects(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultDataObjectServiceStub::DeleteDataObject( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteDataObject(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +Status DefaultDataObjectServiceStub::BatchDeleteDataObjects( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request) { + google::protobuf::Empty response; + auto status = + grpc_stub_->BatchDeleteDataObjects(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +StatusOr +DefaultDataObjectServiceStub::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 +DefaultDataObjectServiceStub::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 +DefaultDataObjectServiceStub::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 +DefaultDataObjectServiceStub::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 DefaultDataObjectServiceStub::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 DefaultDataObjectServiceStub::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(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/data_object_stub.h b/google/cloud/vectorsearch/v1/internal/data_object_stub.h new file mode 100644 index 0000000000000..a395372e6f57d --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_stub.h @@ -0,0 +1,201 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_STUB_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vectorsearch/v1/data_object_service.grpc.pb.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectServiceStub { + public: + virtual ~DataObjectServiceStub() = 0; + + virtual StatusOr + CreateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& + request) = 0; + + virtual StatusOr< + google::cloud::vectorsearch::v1::BatchCreateDataObjectsResponse> + BatchCreateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) = 0; + + virtual StatusOr GetDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) = 0; + + virtual StatusOr + UpdateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& + request) = 0; + + virtual StatusOr< + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsResponse> + BatchUpdateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) = 0; + + virtual Status DeleteDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& + request) = 0; + + virtual Status BatchDeleteDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest 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; +}; + +class DefaultDataObjectServiceStub : public DataObjectServiceStub { + public: + explicit DefaultDataObjectServiceStub( + std::unique_ptr< + google::cloud::vectorsearch::v1::DataObjectService::StubInterface> + grpc_stub, + std::unique_ptr + operations_stub, + std::unique_ptr + locations_stub) + : grpc_stub_(std::move(grpc_stub)), + operations_stub_(std::move(operations_stub)), + locations_stub_(std::move(locations_stub)) {} + + StatusOr CreateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) + override; + + StatusOr + BatchCreateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) override; + + StatusOr GetDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) + override; + + StatusOr UpdateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) + override; + + StatusOr + BatchUpdateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) override; + + Status DeleteDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) + override; + + Status BatchDeleteDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest 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; + + private: + std::unique_ptr< + google::cloud::vectorsearch::v1::DataObjectService::StubInterface> + grpc_stub_; + std::unique_ptr + operations_stub_; + std::unique_ptr + locations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_STUB_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_stub_factory.cc b/google/cloud/vectorsearch/v1/internal/data_object_stub_factory.cc new file mode 100644 index 0000000000000..86c019d018fba --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_stub_factory.cc @@ -0,0 +1,84 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vectorsearch/v1/data_object_service.grpc.pb.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_auth_decorator.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_logging_decorator.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_metadata_decorator.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_stub.h" +#include "google/cloud/vectorsearch/v1/internal/data_object_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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultDataObjectServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::vectorsearch::v1::DataObjectService::NewStub(channel); + auto service_operations_stub = + google::longrunning::Operations::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_operations_stub), + std::move(service_locations_stub)); + + 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 = MakeDataObjectServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/data_object_stub_factory.h b/google/cloud/vectorsearch/v1/internal/data_object_stub_factory.h new file mode 100644 index 0000000000000..0a076ad074f5c --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_STUB_FACTORY_H + +#include "google/cloud/vectorsearch/v1/internal/data_object_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultDataObjectServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_STUB_FACTORY_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_tracing_connection.cc b/google/cloud/vectorsearch/v1/internal/data_object_tracing_connection.cc new file mode 100644 index 0000000000000..4403de7f4ae73 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_tracing_connection.cc @@ -0,0 +1,167 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectServiceTracingConnection::DataObjectServiceTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StatusOr +DataObjectServiceTracingConnection::CreateDataObject( + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectServiceConnection::CreateDataObject"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateDataObject(request)); +} + +StatusOr +DataObjectServiceTracingConnection::BatchCreateDataObjects( + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectServiceConnection::BatchCreateDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->BatchCreateDataObjects(request)); +} + +StatusOr +DataObjectServiceTracingConnection::GetDataObject( + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectServiceConnection::GetDataObject"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetDataObject(request)); +} + +StatusOr +DataObjectServiceTracingConnection::UpdateDataObject( + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectServiceConnection::UpdateDataObject"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateDataObject(request)); +} + +StatusOr +DataObjectServiceTracingConnection::BatchUpdateDataObjects( + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectServiceConnection::BatchUpdateDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->BatchUpdateDataObjects(request)); +} + +Status DataObjectServiceTracingConnection::DeleteDataObject( + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectServiceConnection::DeleteDataObject"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteDataObject(request)); +} + +Status DataObjectServiceTracingConnection::BatchDeleteDataObjects( + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectServiceConnection::BatchDeleteDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->BatchDeleteDataObjects(request)); +} + +StreamRange +DataObjectServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +DataObjectServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectServiceConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +DataObjectServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +DataObjectServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status DataObjectServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status DataObjectServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::DataObjectServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeDataObjectServiceTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = + std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/internal/data_object_tracing_connection.h b/google/cloud/vectorsearch/v1/internal/data_object_tracing_connection.h new file mode 100644 index 0000000000000..6af0969c8b1f7 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_tracing_connection.h @@ -0,0 +1,108 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_TRACING_CONNECTION_H + +#include "google/cloud/vectorsearch/v1/data_object_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectServiceTracingConnection + : public vectorsearch_v1::DataObjectServiceConnection { + public: + ~DataObjectServiceTracingConnection() override = default; + + explicit DataObjectServiceTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StatusOr CreateDataObject( + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) + override; + + StatusOr + BatchCreateDataObjects( + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) override; + + StatusOr GetDataObject( + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) + override; + + StatusOr UpdateDataObject( + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) + override; + + StatusOr + BatchUpdateDataObjects( + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) override; + + Status DeleteDataObject( + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) + override; + + Status BatchDeleteDataObjects( + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request) 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_; +}; + +/** + * 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 +MakeDataObjectServiceTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_TRACING_CONNECTION_H diff --git a/google/cloud/vectorsearch/v1/internal/data_object_tracing_stub.cc b/google/cloud/vectorsearch/v1/internal/data_object_tracing_stub.cc new file mode 100644 index 0000000000000..2417a29128f82 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_tracing_stub.cc @@ -0,0 +1,207 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#include "google/cloud/vectorsearch/v1/internal/data_object_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +DataObjectServiceTracingStub::DataObjectServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +DataObjectServiceTracingStub::CreateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectService", "CreateDataObject"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateDataObject(context, options, request)); +} + +StatusOr +DataObjectServiceTracingStub::BatchCreateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.vectorsearch.v1.DataObjectService", + "BatchCreateDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->BatchCreateDataObjects(context, options, request)); +} + +StatusOr +DataObjectServiceTracingStub::GetDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectService", "GetDataObject"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetDataObject(context, options, request)); +} + +StatusOr +DataObjectServiceTracingStub::UpdateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectService", "UpdateDataObject"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateDataObject(context, options, request)); +} + +StatusOr +DataObjectServiceTracingStub::BatchUpdateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.vectorsearch.v1.DataObjectService", + "BatchUpdateDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->BatchUpdateDataObjects(context, options, request)); +} + +Status DataObjectServiceTracingStub::DeleteDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectService", "DeleteDataObject"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteDataObject(context, options, request)); +} + +Status DataObjectServiceTracingStub::BatchDeleteDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.vectorsearch.v1.DataObjectService", + "BatchDeleteDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->BatchDeleteDataObjects(context, options, request)); +} + +StatusOr +DataObjectServiceTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectService", "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +DataObjectServiceTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectService", "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +DataObjectServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectService", "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +DataObjectServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectService", "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status DataObjectServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectService", "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status DataObjectServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.DataObjectService", "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +std::shared_ptr MakeDataObjectServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/data_object_tracing_stub.h b/google/cloud/vectorsearch/v1/internal/data_object_tracing_stub.h new file mode 100644 index 0000000000000..03a17af733f24 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/data_object_tracing_stub.h @@ -0,0 +1,126 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_TRACING_STUB_H + +#include "google/cloud/vectorsearch/v1/internal/data_object_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class DataObjectServiceTracingStub : public DataObjectServiceStub { + public: + ~DataObjectServiceTracingStub() override = default; + + explicit DataObjectServiceTracingStub( + std::shared_ptr child); + + StatusOr CreateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request) + override; + + StatusOr + BatchCreateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request) override; + + StatusOr GetDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetDataObjectRequest const& request) + override; + + StatusOr UpdateDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request) + override; + + StatusOr + BatchUpdateDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request) override; + + Status DeleteDataObject( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request) + override; + + Status BatchDeleteDataObjects( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest 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; + + private: + std::shared_ptr child_; + std::shared_ptr + propagator_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeDataObjectServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_DATA_OBJECT_TRACING_STUB_H diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_auth_decorator.cc b/google/cloud/vectorsearch/v1/internal/vector_search_auth_decorator.cc new file mode 100644 index 0000000000000..eb7584dc2eec1 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_auth_decorator.cc @@ -0,0 +1,366 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#include "google/cloud/vectorsearch/v1/internal/vector_search_auth_decorator.h" +#include "google/cloud/vectorsearch/v1/vectorsearch_service.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +VectorSearchServiceAuth::VectorSearchServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +VectorSearchServiceAuth::ListCollections( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListCollectionsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListCollections(context, options, request); +} + +StatusOr +VectorSearchServiceAuth::GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetCollection(context, options, request); +} + +future> +VectorSearchServiceAuth::AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateCollectionRequest 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->AsyncCreateCollection(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +VectorSearchServiceAuth::CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateCollection(context, options, request); +} + +future> +VectorSearchServiceAuth::AsyncUpdateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest 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->AsyncUpdateCollection(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +VectorSearchServiceAuth::UpdateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateCollection(context, options, request); +} + +future> +VectorSearchServiceAuth::AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest 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->AsyncDeleteCollection(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +VectorSearchServiceAuth::DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteCollection(context, options, request); +} + +StatusOr +VectorSearchServiceAuth::ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListIndexesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListIndexes(context, options, request); +} + +StatusOr +VectorSearchServiceAuth::GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetIndexRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetIndex(context, options, request); +} + +future> +VectorSearchServiceAuth::AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateIndexRequest 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->AsyncCreateIndex(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr VectorSearchServiceAuth::CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateIndex(context, options, request); +} + +future> +VectorSearchServiceAuth::AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteIndexRequest 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->AsyncDeleteIndex(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr VectorSearchServiceAuth::DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteIndex(context, options, request); +} + +future> +VectorSearchServiceAuth::AsyncImportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest 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->AsyncImportDataObjects(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +VectorSearchServiceAuth::ImportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ImportDataObjects(context, options, request); +} + +future> +VectorSearchServiceAuth::AsyncExportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest 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->AsyncExportDataObjects(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +VectorSearchServiceAuth::ExportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ExportDataObjects(context, options, request); +} + +StatusOr +VectorSearchServiceAuth::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 +VectorSearchServiceAuth::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 +VectorSearchServiceAuth::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 VectorSearchServiceAuth::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 VectorSearchServiceAuth::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 VectorSearchServiceAuth::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> +VectorSearchServiceAuth::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 VectorSearchServiceAuth::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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_auth_decorator.h b/google/cloud/vectorsearch/v1/internal/vector_search_auth_decorator.h new file mode 100644 index 0000000000000..cee0298ccabc8 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_auth_decorator.h @@ -0,0 +1,196 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_AUTH_DECORATOR_H + +#include "google/cloud/vectorsearch/v1/internal/vector_search_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class VectorSearchServiceAuth : public VectorSearchServiceStub { + public: + ~VectorSearchServiceAuth() override = default; + VectorSearchServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr + ListCollections(grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListCollectionsRequest const& + request) override; + + StatusOr GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) + override; + + future> AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + future> AsyncUpdateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + future> AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + StatusOr DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + StatusOr ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListIndexesRequest const& request) + override; + + StatusOr GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetIndexRequest const& request) override; + + future> AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + StatusOr CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + future> AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) + override; + + StatusOr DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) + override; + + future> AsyncImportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + StatusOr ImportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + future> AsyncExportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) + override; + + StatusOr ExportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest 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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_AUTH_DECORATOR_H diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_connection_impl.cc b/google/cloud/vectorsearch/v1/internal/vector_search_connection_impl.cc new file mode 100644 index 0000000000000..f99be4d32dd12 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_connection_impl.cc @@ -0,0 +1,943 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#include "google/cloud/vectorsearch/v1/internal/vector_search_connection_impl.h" +#include "google/cloud/vectorsearch/v1/internal/vector_search_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 vectorsearch_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 + +VectorSearchServiceConnectionImpl::VectorSearchServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions( + std::move(options), VectorSearchServiceConnection::options())) {} + +StreamRange +VectorSearchServiceConnectionImpl::ListCollections( + google::cloud::vectorsearch::v1::ListCollectionsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListCollections(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::vectorsearch::v1::ListCollectionsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListCollectionsRequest const& + request) { + return stub->ListCollections(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::vectorsearch::v1::ListCollectionsResponse r) { + std::vector result( + r.collections().size()); + auto& messages = *r.mutable_collections(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +VectorSearchServiceConnectionImpl::GetCollection( + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetCollection(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetCollectionRequest const& + request) { + return stub_->GetCollection(context, options, request); + }, + *current, request, __func__); +} + +future> +VectorSearchServiceConnectionImpl::CreateCollection( + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateCollection(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::vectorsearch::v1::Collection>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& + request) { + return stub->AsyncCreateCollection(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::vectorsearch::v1::Collection>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +VectorSearchServiceConnectionImpl::CreateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateCollection(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& + request) { + return stub_->CreateCollection(context, options, request); + }, + *current, request, __func__); +} + +future> +VectorSearchServiceConnectionImpl::CreateCollection( + 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 CreateCollection", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::vectorsearch::v1::Collection>( + 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::vectorsearch::v1::Collection>, + polling_policy(*current), __func__); +} + +future> +VectorSearchServiceConnectionImpl::UpdateCollection( + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateCollection(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::vectorsearch::v1::Collection>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& + request) { + return stub->AsyncUpdateCollection(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::vectorsearch::v1::Collection>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +VectorSearchServiceConnectionImpl::UpdateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateCollection(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& + request) { + return stub_->UpdateCollection(context, options, request); + }, + *current, request, __func__); +} + +future> +VectorSearchServiceConnectionImpl::UpdateCollection( + 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 UpdateCollection", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::vectorsearch::v1::Collection>( + 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::vectorsearch::v1::Collection>, + polling_policy(*current), __func__); +} + +future> +VectorSearchServiceConnectionImpl::DeleteCollection( + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteCollection(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::vectorsearch::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::vectorsearch::v1::DeleteCollectionRequest const& + request) { + return stub->AsyncDeleteCollection(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::vectorsearch::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +VectorSearchServiceConnectionImpl::DeleteCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteCollection(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& + request) { + return stub_->DeleteCollection(context, options, request); + }, + *current, request, __func__); +} + +future> +VectorSearchServiceConnectionImpl::DeleteCollection( + 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 DeleteCollection", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::vectorsearch::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::vectorsearch::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +VectorSearchServiceConnectionImpl::ListIndexes( + google::cloud::vectorsearch::v1::ListIndexesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListIndexes(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::vectorsearch::v1::ListIndexesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListIndexesRequest const& + request) { + return stub->ListIndexes(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::vectorsearch::v1::ListIndexesResponse r) { + std::vector result( + r.indexes().size()); + auto& messages = *r.mutable_indexes(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +VectorSearchServiceConnectionImpl::GetIndex( + google::cloud::vectorsearch::v1::GetIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetIndex(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetIndexRequest const& request) { + return stub_->GetIndex(context, options, request); + }, + *current, request, __func__); +} + +future> +VectorSearchServiceConnectionImpl::CreateIndex( + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateIndex(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::vectorsearch::v1::Index>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + return stub->AsyncCreateIndex(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::vectorsearch::v1::Index>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +VectorSearchServiceConnectionImpl::CreateIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateIndex(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + return stub_->CreateIndex(context, options, request); + }, + *current, request, __func__); +} + +future> +VectorSearchServiceConnectionImpl::CreateIndex( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateIndex", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::vectorsearch::v1::Index>( + 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::vectorsearch::v1::Index>, + polling_policy(*current), __func__); +} + +future> +VectorSearchServiceConnectionImpl::DeleteIndex( + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteIndex(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::vectorsearch::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::vectorsearch::v1::DeleteIndexRequest const& request) { + return stub->AsyncDeleteIndex(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::vectorsearch::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +VectorSearchServiceConnectionImpl::DeleteIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteIndex(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + return stub_->DeleteIndex(context, options, request); + }, + *current, request, __func__); +} + +future> +VectorSearchServiceConnectionImpl::DeleteIndex( + 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 DeleteIndex", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::vectorsearch::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::vectorsearch::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +future> +VectorSearchServiceConnectionImpl::ImportDataObjects( + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->ImportDataObjects(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::vectorsearch::v1::ImportDataObjectsResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& + request) { + return stub->AsyncImportDataObjects(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::vectorsearch::v1::ImportDataObjectsResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +VectorSearchServiceConnectionImpl::ImportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ImportDataObjects(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& + request) { + return stub_->ImportDataObjects(context, options, request); + }, + *current, request, __func__); +} + +future> +VectorSearchServiceConnectionImpl::ImportDataObjects( + 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 ImportDataObjects", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::vectorsearch::v1::ImportDataObjectsResponse>( + 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::vectorsearch::v1::ImportDataObjectsResponse>, + polling_policy(*current), __func__); +} + +future> +VectorSearchServiceConnectionImpl::ExportDataObjects( + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->ExportDataObjects(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::vectorsearch::v1::ExportDataObjectsResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& + request) { + return stub->AsyncExportDataObjects(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::vectorsearch::v1::ExportDataObjectsResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +VectorSearchServiceConnectionImpl::ExportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ExportDataObjects(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& + request) { + return stub_->ExportDataObjects(context, options, request); + }, + *current, request, __func__); +} + +future> +VectorSearchServiceConnectionImpl::ExportDataObjects( + 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 ExportDataObjects", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::vectorsearch::v1::ExportDataObjectsResponse>( + 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::vectorsearch::v1::ExportDataObjectsResponse>, + polling_policy(*current), __func__); +} + +StreamRange +VectorSearchServiceConnectionImpl::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 +VectorSearchServiceConnectionImpl::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 +VectorSearchServiceConnectionImpl::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 +VectorSearchServiceConnectionImpl::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 VectorSearchServiceConnectionImpl::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 VectorSearchServiceConnectionImpl::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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_connection_impl.h b/google/cloud/vectorsearch/v1/internal/vector_search_connection_impl.h new file mode 100644 index 0000000000000..3100e4bcd1b05 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_connection_impl.h @@ -0,0 +1,186 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_CONNECTION_IMPL_H + +#include "google/cloud/vectorsearch/v1/internal/vector_search_retry_traits.h" +#include "google/cloud/vectorsearch/v1/internal/vector_search_stub.h" +#include "google/cloud/vectorsearch/v1/vector_search_connection.h" +#include "google/cloud/vectorsearch/v1/vector_search_connection_idempotency_policy.h" +#include "google/cloud/vectorsearch/v1/vector_search_options.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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class VectorSearchServiceConnectionImpl + : public vectorsearch_v1::VectorSearchServiceConnection { + public: + ~VectorSearchServiceConnectionImpl() override = default; + + VectorSearchServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + StreamRange ListCollections( + google::cloud::vectorsearch::v1::ListCollectionsRequest request) override; + + StatusOr GetCollection( + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) + override; + + future> + CreateCollection( + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + future> + CreateCollection(google::longrunning::Operation const& operation) override; + + future> + UpdateCollection( + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + future> + UpdateCollection(google::longrunning::Operation const& operation) override; + + future> + DeleteCollection( + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + StatusOr DeleteCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + future> + DeleteCollection(google::longrunning::Operation const& operation) override; + + StreamRange ListIndexes( + google::cloud::vectorsearch::v1::ListIndexesRequest request) override; + + StatusOr GetIndex( + google::cloud::vectorsearch::v1::GetIndexRequest const& request) override; + + future> CreateIndex( + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + StatusOr CreateIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + future> CreateIndex( + google::longrunning::Operation const& operation) override; + + future> + DeleteIndex(google::cloud::vectorsearch::v1::DeleteIndexRequest const& + request) override; + + StatusOr DeleteIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) + override; + + future> + DeleteIndex(google::longrunning::Operation const& operation) override; + + future> + ImportDataObjects( + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + StatusOr ImportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + future> + ImportDataObjects(google::longrunning::Operation const& operation) override; + + future> + ExportDataObjects( + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) + override; + + StatusOr ExportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) + override; + + future> + ExportDataObjects(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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_CONNECTION_IMPL_H diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_logging_decorator.cc b/google/cloud/vectorsearch/v1/internal/vector_search_logging_decorator.cc new file mode 100644 index 0000000000000..10391433fd952 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_logging_decorator.cc @@ -0,0 +1,426 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#include "google/cloud/vectorsearch/v1/internal/vector_search_logging_decorator.h" +#include "google/cloud/vectorsearch/v1/vectorsearch_service.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +VectorSearchServiceLogging::VectorSearchServiceLogging( + std::shared_ptr child, + TracingOptions tracing_options, std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +VectorSearchServiceLogging::ListCollections( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListCollectionsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListCollectionsRequest const& + request) { + return child_->ListCollections(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +VectorSearchServiceLogging::GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetCollectionRequest const& + request) { + return child_->GetCollection(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +VectorSearchServiceLogging::AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& + request) { + return child_->AsyncCreateCollection(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +VectorSearchServiceLogging::CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& + request) { + return child_->CreateCollection(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +VectorSearchServiceLogging::AsyncUpdateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& + request) { + return child_->AsyncUpdateCollection(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +VectorSearchServiceLogging::UpdateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& + request) { + return child_->UpdateCollection(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +VectorSearchServiceLogging::AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& + request) { + return child_->AsyncDeleteCollection(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +VectorSearchServiceLogging::DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& + request) { + return child_->DeleteCollection(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +VectorSearchServiceLogging::ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListIndexesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListIndexesRequest const& request) { + return child_->ListIndexes(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +VectorSearchServiceLogging::GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetIndexRequest const& request) { + return child_->GetIndex(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +VectorSearchServiceLogging::AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + return child_->AsyncCreateIndex(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +VectorSearchServiceLogging::CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + return child_->CreateIndex(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +VectorSearchServiceLogging::AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + return child_->AsyncDeleteIndex(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +VectorSearchServiceLogging::DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + return child_->DeleteIndex(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +VectorSearchServiceLogging::AsyncImportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& + request) { + return child_->AsyncImportDataObjects(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +VectorSearchServiceLogging::ImportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& + request) { + return child_->ImportDataObjects(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +VectorSearchServiceLogging::AsyncExportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& + request) { + return child_->AsyncExportDataObjects(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +VectorSearchServiceLogging::ExportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& + request) { + return child_->ExportDataObjects(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +VectorSearchServiceLogging::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 +VectorSearchServiceLogging::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 +VectorSearchServiceLogging::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 +VectorSearchServiceLogging::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 VectorSearchServiceLogging::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 VectorSearchServiceLogging::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> +VectorSearchServiceLogging::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 VectorSearchServiceLogging::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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_logging_decorator.h b/google/cloud/vectorsearch/v1/internal/vector_search_logging_decorator.h new file mode 100644 index 0000000000000..6acb4752ad3a6 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_logging_decorator.h @@ -0,0 +1,196 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_LOGGING_DECORATOR_H + +#include "google/cloud/vectorsearch/v1/internal/vector_search_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class VectorSearchServiceLogging : public VectorSearchServiceStub { + public: + ~VectorSearchServiceLogging() override = default; + VectorSearchServiceLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr + ListCollections(grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListCollectionsRequest const& + request) override; + + StatusOr GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) + override; + + future> AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + future> AsyncUpdateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + future> AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + StatusOr DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + StatusOr ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListIndexesRequest const& request) + override; + + StatusOr GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetIndexRequest const& request) override; + + future> AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + StatusOr CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + future> AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) + override; + + StatusOr DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) + override; + + future> AsyncImportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + StatusOr ImportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + future> AsyncExportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) + override; + + StatusOr ExportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest 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_; +}; // VectorSearchServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_LOGGING_DECORATOR_H diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_metadata_decorator.cc b/google/cloud/vectorsearch/v1/internal/vector_search_metadata_decorator.cc new file mode 100644 index 0000000000000..a009a648ac638 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_metadata_decorator.cc @@ -0,0 +1,329 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#include "google/cloud/vectorsearch/v1/internal/vector_search_metadata_decorator.h" +#include "google/cloud/vectorsearch/v1/vectorsearch_service.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +VectorSearchServiceMetadata::VectorSearchServiceMetadata( + 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 +VectorSearchServiceMetadata::ListCollections( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListCollectionsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListCollections(context, options, request); +} + +StatusOr +VectorSearchServiceMetadata::GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetCollection(context, options, request); +} + +future> +VectorSearchServiceMetadata::AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateCollection(cq, std::move(context), + std::move(options), request); +} + +StatusOr +VectorSearchServiceMetadata::CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateCollection(context, options, request); +} + +future> +VectorSearchServiceMetadata::AsyncUpdateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("collection.name=", + internal::UrlEncode(request.collection().name()))); + return child_->AsyncUpdateCollection(cq, std::move(context), + std::move(options), request); +} + +StatusOr +VectorSearchServiceMetadata::UpdateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("collection.name=", + internal::UrlEncode(request.collection().name()))); + return child_->UpdateCollection(context, options, request); +} + +future> +VectorSearchServiceMetadata::AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteCollection(cq, std::move(context), + std::move(options), request); +} + +StatusOr +VectorSearchServiceMetadata::DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteCollection(context, options, request); +} + +StatusOr +VectorSearchServiceMetadata::ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListIndexesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListIndexes(context, options, request); +} + +StatusOr +VectorSearchServiceMetadata::GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetIndexRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetIndex(context, options, request); +} + +future> +VectorSearchServiceMetadata::AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateIndex(cq, std::move(context), std::move(options), + request); +} + +StatusOr +VectorSearchServiceMetadata::CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateIndex(context, options, request); +} + +future> +VectorSearchServiceMetadata::AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteIndex(cq, std::move(context), std::move(options), + request); +} + +StatusOr +VectorSearchServiceMetadata::DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteIndex(context, options, request); +} + +future> +VectorSearchServiceMetadata::AsyncImportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncImportDataObjects(cq, std::move(context), + std::move(options), request); +} + +StatusOr +VectorSearchServiceMetadata::ImportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->ImportDataObjects(context, options, request); +} + +future> +VectorSearchServiceMetadata::AsyncExportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncExportDataObjects(cq, std::move(context), + std::move(options), request); +} + +StatusOr +VectorSearchServiceMetadata::ExportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->ExportDataObjects(context, options, request); +} + +StatusOr +VectorSearchServiceMetadata::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 +VectorSearchServiceMetadata::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 +VectorSearchServiceMetadata::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 +VectorSearchServiceMetadata::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 VectorSearchServiceMetadata::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 VectorSearchServiceMetadata::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> +VectorSearchServiceMetadata::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 VectorSearchServiceMetadata::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 VectorSearchServiceMetadata::SetMetadata( + grpc::ClientContext& context, Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void VectorSearchServiceMetadata::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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_metadata_decorator.h b/google/cloud/vectorsearch/v1/internal/vector_search_metadata_decorator.h new file mode 100644 index 0000000000000..2bcf91a30830c --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_metadata_decorator.h @@ -0,0 +1,202 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_METADATA_DECORATOR_H + +#include "google/cloud/vectorsearch/v1/internal/vector_search_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class VectorSearchServiceMetadata : public VectorSearchServiceStub { + public: + ~VectorSearchServiceMetadata() override = default; + VectorSearchServiceMetadata( + std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr + ListCollections(grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListCollectionsRequest const& + request) override; + + StatusOr GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) + override; + + future> AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + future> AsyncUpdateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + future> AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + StatusOr DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + StatusOr ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListIndexesRequest const& request) + override; + + StatusOr GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetIndexRequest const& request) override; + + future> AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + StatusOr CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + future> AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) + override; + + StatusOr DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) + override; + + future> AsyncImportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + StatusOr ImportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + future> AsyncExportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) + override; + + StatusOr ExportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest 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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_METADATA_DECORATOR_H diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_option_defaults.cc b/google/cloud/vectorsearch/v1/internal/vector_search_option_defaults.cc new file mode 100644 index 0000000000000..176de7508fbcb --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_option_defaults.cc @@ -0,0 +1,83 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#include "google/cloud/vectorsearch/v1/internal/vector_search_option_defaults.h" +#include "google/cloud/vectorsearch/v1/vector_search_connection.h" +#include "google/cloud/vectorsearch/v1/vector_search_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 vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options VectorSearchServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_VECTOR_SEARCH_SERVICE_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_VECTOR_SEARCH_SERVICE_AUTHORITY", + "vectorsearch.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + vectorsearch_v1::VectorSearchServiceLimitedTimeRetryPolicy( + std::chrono::minutes(10)) + .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< + vectorsearch_v1::VectorSearchServiceRetryPolicyOption::Type, + vectorsearch_v1::VectorSearchServiceBackoffPolicyOption::Type>( + options + .get() + ->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } + if (!options + .has()) { + options.set< + vectorsearch_v1::VectorSearchServiceConnectionIdempotencyPolicyOption>( + vectorsearch_v1:: + MakeDefaultVectorSearchServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_option_defaults.h b/google/cloud/vectorsearch/v1/internal/vector_search_option_defaults.h new file mode 100644 index 0000000000000..374f6d6e30e03 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options VectorSearchServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_OPTION_DEFAULTS_H diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_retry_traits.h b/google/cloud/vectorsearch/v1/internal/vector_search_retry_traits.h new file mode 100644 index 0000000000000..556931d49e8d1 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct VectorSearchServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_RETRY_TRAITS_H diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_sources.cc b/google/cloud/vectorsearch/v1/internal/vector_search_sources.cc new file mode 100644 index 0000000000000..ffadc86c9f417 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/vectorsearch/v1/internal/vector_search_auth_decorator.cc" +#include "google/cloud/vectorsearch/v1/internal/vector_search_connection_impl.cc" +#include "google/cloud/vectorsearch/v1/internal/vector_search_logging_decorator.cc" +#include "google/cloud/vectorsearch/v1/internal/vector_search_metadata_decorator.cc" +#include "google/cloud/vectorsearch/v1/internal/vector_search_option_defaults.cc" +#include "google/cloud/vectorsearch/v1/internal/vector_search_stub.cc" +#include "google/cloud/vectorsearch/v1/internal/vector_search_stub_factory.cc" +#include "google/cloud/vectorsearch/v1/internal/vector_search_tracing_connection.cc" +#include "google/cloud/vectorsearch/v1/internal/vector_search_tracing_stub.cc" +#include "google/cloud/vectorsearch/v1/vector_search_client.cc" +#include "google/cloud/vectorsearch/v1/vector_search_connection.cc" +#include "google/cloud/vectorsearch/v1/vector_search_connection_idempotency_policy.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_stub.cc b/google/cloud/vectorsearch/v1/internal/vector_search_stub.cc new file mode 100644 index 0000000000000..322a73b3bbee8 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_stub.cc @@ -0,0 +1,414 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#include "google/cloud/vectorsearch/v1/internal/vector_search_stub.h" +#include "google/cloud/vectorsearch/v1/vectorsearch_service.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +VectorSearchServiceStub::~VectorSearchServiceStub() = default; + +StatusOr +DefaultVectorSearchServiceStub::ListCollections( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::ListCollectionsRequest const& request) { + google::cloud::vectorsearch::v1::ListCollectionsResponse response; + auto status = grpc_stub_->ListCollections(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultVectorSearchServiceStub::GetCollection( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) { + google::cloud::vectorsearch::v1::Collection response; + auto status = grpc_stub_->GetCollection(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultVectorSearchServiceStub::AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::vectorsearch::v1::CreateCollectionRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateCollection(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultVectorSearchServiceStub::CreateCollection( + grpc::ClientContext& context, Options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateCollection(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultVectorSearchServiceStub::AsyncUpdateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::vectorsearch::v1::UpdateCollectionRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateCollection(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultVectorSearchServiceStub::UpdateCollection( + grpc::ClientContext& context, Options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateCollection(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultVectorSearchServiceStub::AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::vectorsearch::v1::DeleteCollectionRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteCollection(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultVectorSearchServiceStub::DeleteCollection( + grpc::ClientContext& context, Options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteCollection(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultVectorSearchServiceStub::ListIndexes( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::ListIndexesRequest const& request) { + google::cloud::vectorsearch::v1::ListIndexesResponse response; + auto status = grpc_stub_->ListIndexes(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultVectorSearchServiceStub::GetIndex( + grpc::ClientContext& context, Options const&, + google::cloud::vectorsearch::v1::GetIndexRequest const& request) { + google::cloud::vectorsearch::v1::Index response; + auto status = grpc_stub_->GetIndex(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultVectorSearchServiceStub::AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::vectorsearch::v1::CreateIndexRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateIndex(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultVectorSearchServiceStub::CreateIndex( + grpc::ClientContext& context, Options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateIndex(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultVectorSearchServiceStub::AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::vectorsearch::v1::DeleteIndexRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteIndex(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultVectorSearchServiceStub::DeleteIndex( + grpc::ClientContext& context, Options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteIndex(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultVectorSearchServiceStub::AsyncImportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::vectorsearch::v1::ImportDataObjectsRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncImportDataObjects(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultVectorSearchServiceStub::ImportDataObjects( + grpc::ClientContext& context, Options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->ImportDataObjects(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultVectorSearchServiceStub::AsyncExportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::vectorsearch::v1::ExportDataObjectsRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncExportDataObjects(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultVectorSearchServiceStub::ExportDataObjects( + grpc::ClientContext& context, Options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->ExportDataObjects(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultVectorSearchServiceStub::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 +DefaultVectorSearchServiceStub::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 +DefaultVectorSearchServiceStub::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 +DefaultVectorSearchServiceStub::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 DefaultVectorSearchServiceStub::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 DefaultVectorSearchServiceStub::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> +DefaultVectorSearchServiceStub::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 DefaultVectorSearchServiceStub::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 vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_stub.h b/google/cloud/vectorsearch/v1/internal/vector_search_stub.h new file mode 100644 index 0000000000000..59314aef89d09 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_stub.h @@ -0,0 +1,356 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_STUB_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vectorsearch/v1/vectorsearch_service.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class VectorSearchServiceStub { + public: + virtual ~VectorSearchServiceStub() = 0; + + virtual StatusOr + ListCollections(grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListCollectionsRequest const& + request) = 0; + + virtual StatusOr GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) = 0; + + virtual future> + AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& + request) = 0; + + virtual StatusOr CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& + request) = 0; + + virtual future> + AsyncUpdateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& + request) = 0; + + virtual StatusOr UpdateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& + request) = 0; + + virtual future> + AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& + request) = 0; + + virtual StatusOr DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& + request) = 0; + + virtual StatusOr + ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListIndexesRequest const& request) = 0; + + virtual StatusOr GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetIndexRequest const& request) = 0; + + virtual future> AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) = 0; + + virtual StatusOr CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) = 0; + + virtual future> AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) = 0; + + virtual StatusOr DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) = 0; + + virtual future> + AsyncImportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& + request) = 0; + + virtual StatusOr ImportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& + request) = 0; + + virtual future> + AsyncExportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& + request) = 0; + + virtual StatusOr ExportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest 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 DefaultVectorSearchServiceStub : public VectorSearchServiceStub { + public: + DefaultVectorSearchServiceStub( + std::unique_ptr< + google::cloud::vectorsearch::v1::VectorSearchService::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 + ListCollections(grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListCollectionsRequest const& + request) override; + + StatusOr GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) + override; + + future> AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + future> AsyncUpdateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + future> AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + StatusOr DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + StatusOr ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListIndexesRequest const& request) + override; + + StatusOr GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetIndexRequest const& request) override; + + future> AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + StatusOr CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + future> AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) + override; + + StatusOr DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) + override; + + future> AsyncImportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + StatusOr ImportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + future> AsyncExportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) + override; + + StatusOr ExportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest 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::vectorsearch::v1::VectorSearchService::StubInterface> + grpc_stub_; + std::unique_ptr + locations_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_STUB_H diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_stub_factory.cc b/google/cloud/vectorsearch/v1/internal/vector_search_stub_factory.cc new file mode 100644 index 0000000000000..148be690cf568 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_stub_factory.cc @@ -0,0 +1,82 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#include "google/cloud/vectorsearch/v1/internal/vector_search_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vectorsearch/v1/internal/vector_search_auth_decorator.h" +#include "google/cloud/vectorsearch/v1/internal/vector_search_logging_decorator.h" +#include "google/cloud/vectorsearch/v1/internal/vector_search_metadata_decorator.h" +#include "google/cloud/vectorsearch/v1/internal/vector_search_stub.h" +#include "google/cloud/vectorsearch/v1/internal/vector_search_tracing_stub.h" +#include "google/cloud/vectorsearch/v1/vectorsearch_service.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultVectorSearchServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::vectorsearch::v1::VectorSearchService::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 = MakeVectorSearchServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_stub_factory.h b/google/cloud/vectorsearch/v1/internal/vector_search_stub_factory.h new file mode 100644 index 0000000000000..14b82d4f65d78 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_STUB_FACTORY_H + +#include "google/cloud/vectorsearch/v1/internal/vector_search_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultVectorSearchServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_STUB_FACTORY_H diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_tracing_connection.cc b/google/cloud/vectorsearch/v1/internal/vector_search_tracing_connection.cc new file mode 100644 index 0000000000000..df53b763b14d4 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_tracing_connection.cc @@ -0,0 +1,350 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#include "google/cloud/vectorsearch/v1/internal/vector_search_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +VectorSearchServiceTracingConnection::VectorSearchServiceTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StreamRange +VectorSearchServiceTracingConnection::ListCollections( + google::cloud::vectorsearch::v1::ListCollectionsRequest request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::ListCollections"); + internal::OTelScope scope(span); + auto sr = child_->ListCollections(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::vectorsearch::v1::Collection>(std::move(span), + std::move(sr)); +} + +StatusOr +VectorSearchServiceTracingConnection::GetCollection( + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::GetCollection"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetCollection(request)); +} + +future> +VectorSearchServiceTracingConnection::CreateCollection( + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::CreateCollection"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateCollection(request)); +} + +StatusOr +VectorSearchServiceTracingConnection::CreateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::CreateCollection"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateCollection(NoAwaitTag{}, request)); +} + +future> +VectorSearchServiceTracingConnection::CreateCollection( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::CreateCollection"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateCollection(operation)); +} + +future> +VectorSearchServiceTracingConnection::UpdateCollection( + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::UpdateCollection"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateCollection(request)); +} + +StatusOr +VectorSearchServiceTracingConnection::UpdateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::UpdateCollection"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateCollection(NoAwaitTag{}, request)); +} + +future> +VectorSearchServiceTracingConnection::UpdateCollection( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::UpdateCollection"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateCollection(operation)); +} + +future> +VectorSearchServiceTracingConnection::DeleteCollection( + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::DeleteCollection"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteCollection(request)); +} + +StatusOr +VectorSearchServiceTracingConnection::DeleteCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::DeleteCollection"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteCollection(NoAwaitTag{}, request)); +} + +future> +VectorSearchServiceTracingConnection::DeleteCollection( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::DeleteCollection"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteCollection(operation)); +} + +StreamRange +VectorSearchServiceTracingConnection::ListIndexes( + google::cloud::vectorsearch::v1::ListIndexesRequest request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::ListIndexes"); + internal::OTelScope scope(span); + auto sr = child_->ListIndexes(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::vectorsearch::v1::Index>(std::move(span), std::move(sr)); +} + +StatusOr +VectorSearchServiceTracingConnection::GetIndex( + google::cloud::vectorsearch::v1::GetIndexRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::GetIndex"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetIndex(request)); +} + +future> +VectorSearchServiceTracingConnection::CreateIndex( + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::CreateIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateIndex(request)); +} + +StatusOr +VectorSearchServiceTracingConnection::CreateIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::CreateIndex"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateIndex(NoAwaitTag{}, request)); +} + +future> +VectorSearchServiceTracingConnection::CreateIndex( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::CreateIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateIndex(operation)); +} + +future> +VectorSearchServiceTracingConnection::DeleteIndex( + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::DeleteIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteIndex(request)); +} + +StatusOr +VectorSearchServiceTracingConnection::DeleteIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::DeleteIndex"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteIndex(NoAwaitTag{}, request)); +} + +future> +VectorSearchServiceTracingConnection::DeleteIndex( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::DeleteIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteIndex(operation)); +} + +future> +VectorSearchServiceTracingConnection::ImportDataObjects( + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::ImportDataObjects"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->ImportDataObjects(request)); +} + +StatusOr +VectorSearchServiceTracingConnection::ImportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::ImportDataObjects"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->ImportDataObjects(NoAwaitTag{}, request)); +} + +future> +VectorSearchServiceTracingConnection::ImportDataObjects( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::ImportDataObjects"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ImportDataObjects(operation)); +} + +future> +VectorSearchServiceTracingConnection::ExportDataObjects( + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::ExportDataObjects"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->ExportDataObjects(request)); +} + +StatusOr +VectorSearchServiceTracingConnection::ExportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::ExportDataObjects"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->ExportDataObjects(NoAwaitTag{}, request)); +} + +future> +VectorSearchServiceTracingConnection::ExportDataObjects( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::ExportDataObjects"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->ExportDataObjects(operation)); +} + +StreamRange +VectorSearchServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +VectorSearchServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +VectorSearchServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +VectorSearchServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status VectorSearchServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status VectorSearchServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "vectorsearch_v1::VectorSearchServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeVectorSearchServiceTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = + std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_tracing_connection.h b/google/cloud/vectorsearch/v1/internal/vector_search_tracing_connection.h new file mode 100644 index 0000000000000..3af497a47cbbb --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_tracing_connection.h @@ -0,0 +1,180 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_TRACING_CONNECTION_H + +#include "google/cloud/vectorsearch/v1/vector_search_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class VectorSearchServiceTracingConnection + : public vectorsearch_v1::VectorSearchServiceConnection { + public: + ~VectorSearchServiceTracingConnection() override = default; + + explicit VectorSearchServiceTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StreamRange ListCollections( + google::cloud::vectorsearch::v1::ListCollectionsRequest request) override; + + StatusOr GetCollection( + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) + override; + + future> + CreateCollection( + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + future> + CreateCollection(google::longrunning::Operation const& operation) override; + + future> + UpdateCollection( + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + future> + UpdateCollection(google::longrunning::Operation const& operation) override; + + future> + DeleteCollection( + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + StatusOr DeleteCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + future> + DeleteCollection(google::longrunning::Operation const& operation) override; + + StreamRange ListIndexes( + google::cloud::vectorsearch::v1::ListIndexesRequest request) override; + + StatusOr GetIndex( + google::cloud::vectorsearch::v1::GetIndexRequest const& request) override; + + future> CreateIndex( + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + StatusOr CreateIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + future> CreateIndex( + google::longrunning::Operation const& operation) override; + + future> + DeleteIndex(google::cloud::vectorsearch::v1::DeleteIndexRequest const& + request) override; + + StatusOr DeleteIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) + override; + + future> + DeleteIndex(google::longrunning::Operation const& operation) override; + + future> + ImportDataObjects( + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + StatusOr ImportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + future> + ImportDataObjects(google::longrunning::Operation const& operation) override; + + future> + ExportDataObjects( + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) + override; + + StatusOr ExportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) + override; + + future> + ExportDataObjects(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_; +}; + +/** + * 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 +MakeVectorSearchServiceTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_TRACING_CONNECTION_H diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_tracing_stub.cc b/google/cloud/vectorsearch/v1/internal/vector_search_tracing_stub.cc new file mode 100644 index 0000000000000..abdec203666c9 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_tracing_stub.cc @@ -0,0 +1,379 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#include "google/cloud/vectorsearch/v1/internal/vector_search_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +VectorSearchServiceTracingStub::VectorSearchServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +VectorSearchServiceTracingStub::ListCollections( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListCollectionsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "ListCollections"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListCollections(context, options, request)); +} + +StatusOr +VectorSearchServiceTracingStub::GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "GetCollection"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetCollection(context, options, request)); +} + +future> +VectorSearchServiceTracingStub::AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "CreateCollection"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateCollection(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +VectorSearchServiceTracingStub::CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "CreateCollection"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateCollection(context, options, request)); +} + +future> +VectorSearchServiceTracingStub::AsyncUpdateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "UpdateCollection"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateCollection(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +VectorSearchServiceTracingStub::UpdateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "UpdateCollection"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateCollection(context, options, request)); +} + +future> +VectorSearchServiceTracingStub::AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "DeleteCollection"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteCollection(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +VectorSearchServiceTracingStub::DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "DeleteCollection"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteCollection(context, options, request)); +} + +StatusOr +VectorSearchServiceTracingStub::ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListIndexesRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "ListIndexes"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListIndexes(context, options, request)); +} + +StatusOr +VectorSearchServiceTracingStub::GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetIndexRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "GetIndex"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetIndex(context, options, request)); +} + +future> +VectorSearchServiceTracingStub::AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "CreateIndex"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateIndex(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +VectorSearchServiceTracingStub::CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "CreateIndex"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateIndex(context, options, request)); +} + +future> +VectorSearchServiceTracingStub::AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "DeleteIndex"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteIndex(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +VectorSearchServiceTracingStub::DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "DeleteIndex"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteIndex(context, options, request)); +} + +future> +VectorSearchServiceTracingStub::AsyncImportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "ImportDataObjects"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncImportDataObjects(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +VectorSearchServiceTracingStub::ImportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "ImportDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ImportDataObjects(context, options, request)); +} + +future> +VectorSearchServiceTracingStub::AsyncExportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "ExportDataObjects"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncExportDataObjects(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +VectorSearchServiceTracingStub::ExportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "ExportDataObjects"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ExportDataObjects(context, options, request)); +} + +StatusOr +VectorSearchServiceTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +VectorSearchServiceTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +VectorSearchServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +VectorSearchServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status VectorSearchServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status VectorSearchServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.vectorsearch.v1.VectorSearchService", "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +VectorSearchServiceTracingStub::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 VectorSearchServiceTracingStub::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)); +} + +std::shared_ptr MakeVectorSearchServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/vectorsearch/v1/internal/vector_search_tracing_stub.h b/google/cloud/vectorsearch/v1/internal/vector_search_tracing_stub.h new file mode 100644 index 0000000000000..46c19ad04bf91 --- /dev/null +++ b/google/cloud/vectorsearch/v1/internal/vector_search_tracing_stub.h @@ -0,0 +1,204 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_TRACING_STUB_H + +#include "google/cloud/vectorsearch/v1/internal/vector_search_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace vectorsearch_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class VectorSearchServiceTracingStub : public VectorSearchServiceStub { + public: + ~VectorSearchServiceTracingStub() override = default; + + explicit VectorSearchServiceTracingStub( + std::shared_ptr child); + + StatusOr + ListCollections(grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListCollectionsRequest const& + request) override; + + StatusOr GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetCollectionRequest const& request) + override; + + future> AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request) + override; + + future> AsyncUpdateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request) + override; + + future> AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + StatusOr DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request) + override; + + StatusOr ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::ListIndexesRequest const& request) + override; + + StatusOr GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::vectorsearch::v1::GetIndexRequest const& request) override; + + future> AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + StatusOr CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request) + override; + + future> AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) + override; + + StatusOr DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request) + override; + + future> AsyncImportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + StatusOr ImportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request) + override; + + future> AsyncExportDataObjects( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request) + override; + + StatusOr ExportDataObjects( + grpc::ClientContext& context, Options options, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest 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_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeVectorSearchServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_INTERNAL_VECTOR_SEARCH_TRACING_STUB_H diff --git a/google/cloud/vectorsearch/v1/mocks/mock_data_object_connection.h b/google/cloud/vectorsearch/v1/mocks/mock_data_object_connection.h new file mode 100644 index 0000000000000..896c2dd740c65 --- /dev/null +++ b/google/cloud/vectorsearch/v1/mocks/mock_data_object_connection.h @@ -0,0 +1,119 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_MOCKS_MOCK_DATA_OBJECT_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_MOCKS_MOCK_DATA_OBJECT_CONNECTION_H + +#include "google/cloud/vectorsearch/v1/data_object_connection.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `DataObjectServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `DataObjectServiceClient`. To do so, + * construct an object of type `DataObjectServiceClient` 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 MockDataObjectServiceConnection + : public vectorsearch_v1::DataObjectServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD( + StatusOr, CreateDataObject, + (google::cloud::vectorsearch::v1::CreateDataObjectRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, + BatchCreateDataObjects, + (google::cloud::vectorsearch::v1::BatchCreateDataObjectsRequest const& + request), + (override)); + + MOCK_METHOD( + StatusOr, GetDataObject, + (google::cloud::vectorsearch::v1::GetDataObjectRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, UpdateDataObject, + (google::cloud::vectorsearch::v1::UpdateDataObjectRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, + BatchUpdateDataObjects, + (google::cloud::vectorsearch::v1::BatchUpdateDataObjectsRequest const& + request), + (override)); + + MOCK_METHOD( + Status, DeleteDataObject, + (google::cloud::vectorsearch::v1::DeleteDataObjectRequest const& request), + (override)); + + MOCK_METHOD( + Status, BatchDeleteDataObjects, + (google::cloud::vectorsearch::v1::BatchDeleteDataObjectsRequest const& + request), + (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 vectorsearch_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_MOCKS_MOCK_DATA_OBJECT_CONNECTION_H diff --git a/google/cloud/vectorsearch/v1/mocks/mock_data_object_search_connection.h b/google/cloud/vectorsearch/v1/mocks/mock_data_object_search_connection.h new file mode 100644 index 0000000000000..e1dd8d385ff21 --- /dev/null +++ b/google/cloud/vectorsearch/v1/mocks/mock_data_object_search_connection.h @@ -0,0 +1,105 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_MOCKS_MOCK_DATA_OBJECT_SEARCH_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_MOCKS_MOCK_DATA_OBJECT_SEARCH_CONNECTION_H + +#include "google/cloud/vectorsearch/v1/data_object_search_connection.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `DataObjectSearchServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `DataObjectSearchServiceClient`. To + * do so, construct an object of type `DataObjectSearchServiceClient` 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 MockDataObjectSearchServiceConnection + : public vectorsearch_v1::DataObjectSearchServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD( + (StreamRange), + SearchDataObjects, + (google::cloud::vectorsearch::v1::SearchDataObjectsRequest request), + (override)); + + MOCK_METHOD( + (StreamRange), + QueryDataObjects, + (google::cloud::vectorsearch::v1::QueryDataObjectsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, + AggregateDataObjects, + (google::cloud::vectorsearch::v1::AggregateDataObjectsRequest const& + request), + (override)); + + MOCK_METHOD( + StatusOr, + BatchSearchDataObjects, + (google::cloud::vectorsearch::v1::BatchSearchDataObjectsRequest const& + request), + (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 vectorsearch_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_MOCKS_MOCK_DATA_OBJECT_SEARCH_CONNECTION_H diff --git a/google/cloud/vectorsearch/v1/mocks/mock_vector_search_connection.h b/google/cloud/vectorsearch/v1/mocks/mock_vector_search_connection.h new file mode 100644 index 0000000000000..7586a69061aa2 --- /dev/null +++ b/google/cloud/vectorsearch/v1/mocks/mock_vector_search_connection.h @@ -0,0 +1,380 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_MOCKS_MOCK_VECTOR_SEARCH_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_MOCKS_MOCK_VECTOR_SEARCH_CONNECTION_H + +#include "google/cloud/vectorsearch/v1/vector_search_connection.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `VectorSearchServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `VectorSearchServiceClient`. To do + * so, construct an object of type `VectorSearchServiceClient` 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 MockVectorSearchServiceConnection + : public vectorsearch_v1::VectorSearchServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD((StreamRange), + ListCollections, + (google::cloud::vectorsearch::v1::ListCollectionsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, GetCollection, + (google::cloud::vectorsearch::v1::GetCollectionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateCollection(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateCollection, + (google::cloud::vectorsearch::v1::CreateCollectionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateCollection(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateCollection, + (NoAwaitTag, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateCollection(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateCollection, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateCollection(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateCollection, + (google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateCollection(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateCollection, + (NoAwaitTag, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateCollection(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateCollection, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteCollection(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteCollection, + (google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteCollection(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteCollection, + (NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteCollection(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteCollection, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), + ListIndexes, + (google::cloud::vectorsearch::v1::ListIndexesRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetIndex, + (google::cloud::vectorsearch::v1::GetIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateIndex(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, CreateIndex, + (google::cloud::vectorsearch::v1::CreateIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateIndex(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateIndex, + (NoAwaitTag, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateIndex(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateIndex, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteIndex(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteIndex, + (google::cloud::vectorsearch::v1::DeleteIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteIndex(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteIndex, + (NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteIndex(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteIndex, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ImportDataObjects(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + ImportDataObjects, + (google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, ImportDataObjects(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, ImportDataObjects, + (NoAwaitTag, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ImportDataObjects(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + ImportDataObjects, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ExportDataObjects(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + ExportDataObjects, + (google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, ExportDataObjects(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, ExportDataObjects, + (NoAwaitTag, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ExportDataObjects(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + ExportDataObjects, (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 vectorsearch_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_MOCKS_MOCK_VECTOR_SEARCH_CONNECTION_H diff --git a/google/cloud/vectorsearch/v1/samples/data_object_client_samples.cc b/google/cloud/vectorsearch/v1/samples/data_object_client_samples.cc new file mode 100644 index 0000000000000..74f7cd695fba9 --- /dev/null +++ b/google/cloud/vectorsearch/v1/samples/data_object_client_samples.cc @@ -0,0 +1,186 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_service.proto + +#include "google/cloud/vectorsearch/v1/data_object_client.h" +#include "google/cloud/vectorsearch/v1/data_object_connection_idempotency_policy.h" +#include "google/cloud/vectorsearch/v1/data_object_options.h" +#include "google/cloud/common_options.h" +#include "google/cloud/credentials.h" +#include "google/cloud/internal/getenv.h" +#include "google/cloud/testing_util/example_driver.h" +#include "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: vectorsearch_v1::DataObjectServiceClient +// 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::vectorsearch_v1::DataObjectServiceClient( + google::cloud::vectorsearch_v1::MakeDataObjectServiceConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::vectorsearch_v1::DataObjectServiceClient( + google::cloud::vectorsearch_v1::MakeDataObjectServiceConnection( + *ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::vectorsearch_v1:: + DataObjectServiceConnectionIdempotencyPolicy { + 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::vectorsearch_v1:: + DataObjectServiceLimitedErrorCountRetryPolicy(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::vectorsearch_v1::MakeDataObjectServiceConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::vectorsearch_v1::DataObjectServiceClient(connection); + auto c2 = google::cloud::vectorsearch_v1::DataObjectServiceClient(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::vectorsearch_v1::DataObjectServiceClient( + connection, google::cloud::Options{} + .set( + google::cloud::vectorsearch_v1:: + DataObjectServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::vectorsearch_v1::DataObjectServiceLimitedErrorCountRetryPolicy(10).clone())); + //! [set-retry-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::vectorsearch_v1::DataObjectServiceClient( + google::cloud::vectorsearch_v1::MakeDataObjectServiceConnection( + 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 WithServiceAccount() example" << std::endl; + WithServiceAccount({keyfile}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"with-service-account", WithServiceAccount}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/vectorsearch/v1/samples/data_object_search_client_samples.cc b/google/cloud/vectorsearch/v1/samples/data_object_search_client_samples.cc new file mode 100644 index 0000000000000..a9bc15563481e --- /dev/null +++ b/google/cloud/vectorsearch/v1/samples/data_object_search_client_samples.cc @@ -0,0 +1,192 @@ +// Copyright 2026 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/vectorsearch/v1/data_object_search_service.proto + +#include "google/cloud/vectorsearch/v1/data_object_search_client.h" +#include "google/cloud/vectorsearch/v1/data_object_search_connection_idempotency_policy.h" +#include "google/cloud/vectorsearch/v1/data_object_search_options.h" +#include "google/cloud/common_options.h" +#include "google/cloud/credentials.h" +#include "google/cloud/internal/getenv.h" +#include "google/cloud/testing_util/example_driver.h" +#include "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: vectorsearch_v1::DataObjectSearchServiceClient +// 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::vectorsearch_v1::DataObjectSearchServiceClient( + google::cloud::vectorsearch_v1::MakeDataObjectSearchServiceConnection( + options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = + google::cloud::vectorsearch_v1::DataObjectSearchServiceClient( + google::cloud::vectorsearch_v1::MakeDataObjectSearchServiceConnection( + *ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::vectorsearch_v1:: + DataObjectSearchServiceConnectionIdempotencyPolicy { + 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::vectorsearch_v1:: + DataObjectSearchServiceLimitedErrorCountRetryPolicy(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::vectorsearch_v1::MakeDataObjectSearchServiceConnection( + options); + + // c1 and c2 share the same retry policies + auto c1 = + google::cloud::vectorsearch_v1::DataObjectSearchServiceClient(connection); + auto c2 = + google::cloud::vectorsearch_v1::DataObjectSearchServiceClient(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::vectorsearch_v1::DataObjectSearchServiceClient( + connection, google::cloud::Options{} + .set( + google::cloud::vectorsearch_v1:: + DataObjectSearchServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::vectorsearch_v1::DataObjectSearchServiceLimitedErrorCountRetryPolicy(10).clone())); + //! [set-retry-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::vectorsearch_v1::DataObjectSearchServiceClient( + google::cloud::vectorsearch_v1::MakeDataObjectSearchServiceConnection( + 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 WithServiceAccount() example" << std::endl; + WithServiceAccount({keyfile}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"with-service-account", WithServiceAccount}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/vectorsearch/v1/samples/vector_search_client_samples.cc b/google/cloud/vectorsearch/v1/samples/vector_search_client_samples.cc new file mode 100644 index 0000000000000..7659fcc6878d7 --- /dev/null +++ b/google/cloud/vectorsearch/v1/samples/vector_search_client_samples.cc @@ -0,0 +1,240 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#include "google/cloud/vectorsearch/v1/vector_search_client.h" +#include "google/cloud/vectorsearch/v1/vector_search_connection_idempotency_policy.h" +#include "google/cloud/vectorsearch/v1/vector_search_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 "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: vectorsearch_v1::VectorSearchServiceClient +// 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::vectorsearch_v1::VectorSearchServiceClient( + google::cloud::vectorsearch_v1::MakeVectorSearchServiceConnection( + options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::vectorsearch_v1::VectorSearchServiceClient( + google::cloud::vectorsearch_v1::MakeVectorSearchServiceConnection( + *ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::vectorsearch_v1:: + VectorSearchServiceConnectionIdempotencyPolicy { + 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::vectorsearch_v1:: + VectorSearchServiceLimitedErrorCountRetryPolicy(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::vectorsearch_v1::MakeVectorSearchServiceConnection( + options); + + // c1 and c2 share the same retry policies + auto c1 = + google::cloud::vectorsearch_v1::VectorSearchServiceClient(connection); + auto c2 = + google::cloud::vectorsearch_v1::VectorSearchServiceClient(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::vectorsearch_v1::VectorSearchServiceClient( + connection, google::cloud::Options{} + .set( + google::cloud::vectorsearch_v1:: + VectorSearchServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::vectorsearch_v1::VectorSearchServiceLimitedErrorCountRetryPolicy(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::vectorsearch_v1:: + VectorSearchServiceRetryPolicyOption::Type, + google::cloud::vectorsearch_v1:: + VectorSearchServiceBackoffPolicyOption::Type>( + google::cloud::vectorsearch_v1:: + VectorSearchServiceLimitedTimeRetryPolicy( + /*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::vectorsearch_v1::MakeVectorSearchServiceConnection( + options); + + // c1 and c2 share the same polling policies. + auto c1 = + google::cloud::vectorsearch_v1::VectorSearchServiceClient(connection); + auto c2 = + google::cloud::vectorsearch_v1::VectorSearchServiceClient(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::vectorsearch_v1::VectorSearchServiceClient( + google::cloud::vectorsearch_v1::MakeVectorSearchServiceConnection( + 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}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/vectorsearch/v1/vector_search_client.cc b/google/cloud/vectorsearch/v1/vector_search_client.cc new file mode 100644 index 0000000000000..72e8ea58203d5 --- /dev/null +++ b/google/cloud/vectorsearch/v1/vector_search_client.cc @@ -0,0 +1,452 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#include "google/cloud/vectorsearch/v1/vector_search_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +VectorSearchServiceClient::VectorSearchServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +VectorSearchServiceClient::~VectorSearchServiceClient() = default; + +StreamRange +VectorSearchServiceClient::ListCollections(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::ListCollectionsRequest request; + request.set_parent(parent); + return connection_->ListCollections(request); +} + +StreamRange +VectorSearchServiceClient::ListCollections( + google::cloud::vectorsearch::v1::ListCollectionsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListCollections(std::move(request)); +} + +StatusOr +VectorSearchServiceClient::GetCollection(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::GetCollectionRequest request; + request.set_name(name); + return connection_->GetCollection(request); +} + +StatusOr +VectorSearchServiceClient::GetCollection( + google::cloud::vectorsearch::v1::GetCollectionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetCollection(request); +} + +future> +VectorSearchServiceClient::CreateCollection( + std::string const& parent, + google::cloud::vectorsearch::v1::Collection const& collection, + std::string const& collection_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::CreateCollectionRequest request; + request.set_parent(parent); + *request.mutable_collection() = collection; + request.set_collection_id(collection_id); + return connection_->CreateCollection(request); +} + +StatusOr +VectorSearchServiceClient::CreateCollection( + NoAwaitTag, std::string const& parent, + google::cloud::vectorsearch::v1::Collection const& collection, + std::string const& collection_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::CreateCollectionRequest request; + request.set_parent(parent); + *request.mutable_collection() = collection; + request.set_collection_id(collection_id); + return connection_->CreateCollection(NoAwaitTag{}, request); +} + +future> +VectorSearchServiceClient::CreateCollection( + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCollection(request); +} + +StatusOr +VectorSearchServiceClient::CreateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCollection(NoAwaitTag{}, request); +} + +future> +VectorSearchServiceClient::CreateCollection( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCollection(operation); +} + +future> +VectorSearchServiceClient::UpdateCollection( + google::cloud::vectorsearch::v1::Collection const& collection, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::UpdateCollectionRequest request; + *request.mutable_collection() = collection; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateCollection(request); +} + +StatusOr +VectorSearchServiceClient::UpdateCollection( + NoAwaitTag, google::cloud::vectorsearch::v1::Collection const& collection, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::UpdateCollectionRequest request; + *request.mutable_collection() = collection; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateCollection(NoAwaitTag{}, request); +} + +future> +VectorSearchServiceClient::UpdateCollection( + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateCollection(request); +} + +StatusOr +VectorSearchServiceClient::UpdateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateCollection(NoAwaitTag{}, request); +} + +future> +VectorSearchServiceClient::UpdateCollection( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateCollection(operation); +} + +future> +VectorSearchServiceClient::DeleteCollection(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::DeleteCollectionRequest request; + request.set_name(name); + return connection_->DeleteCollection(request); +} + +StatusOr +VectorSearchServiceClient::DeleteCollection(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::DeleteCollectionRequest request; + request.set_name(name); + return connection_->DeleteCollection(NoAwaitTag{}, request); +} + +future> +VectorSearchServiceClient::DeleteCollection( + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCollection(request); +} + +StatusOr +VectorSearchServiceClient::DeleteCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCollection(NoAwaitTag{}, request); +} + +future> +VectorSearchServiceClient::DeleteCollection( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCollection(operation); +} + +StreamRange +VectorSearchServiceClient::ListIndexes(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::ListIndexesRequest request; + request.set_parent(parent); + return connection_->ListIndexes(request); +} + +StreamRange +VectorSearchServiceClient::ListIndexes( + google::cloud::vectorsearch::v1::ListIndexesRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListIndexes(std::move(request)); +} + +StatusOr +VectorSearchServiceClient::GetIndex(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::GetIndexRequest request; + request.set_name(name); + return connection_->GetIndex(request); +} + +StatusOr +VectorSearchServiceClient::GetIndex( + google::cloud::vectorsearch::v1::GetIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetIndex(request); +} + +future> +VectorSearchServiceClient::CreateIndex( + std::string const& parent, + google::cloud::vectorsearch::v1::Index const& index, + std::string const& index_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::CreateIndexRequest request; + request.set_parent(parent); + *request.mutable_index() = index; + request.set_index_id(index_id); + return connection_->CreateIndex(request); +} + +StatusOr VectorSearchServiceClient::CreateIndex( + NoAwaitTag, std::string const& parent, + google::cloud::vectorsearch::v1::Index const& index, + std::string const& index_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::CreateIndexRequest request; + request.set_parent(parent); + *request.mutable_index() = index; + request.set_index_id(index_id); + return connection_->CreateIndex(NoAwaitTag{}, request); +} + +future> +VectorSearchServiceClient::CreateIndex( + google::cloud::vectorsearch::v1::CreateIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateIndex(request); +} + +StatusOr VectorSearchServiceClient::CreateIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateIndex(NoAwaitTag{}, request); +} + +future> +VectorSearchServiceClient::CreateIndex( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateIndex(operation); +} + +future> +VectorSearchServiceClient::DeleteIndex(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::DeleteIndexRequest request; + request.set_name(name); + return connection_->DeleteIndex(request); +} + +StatusOr VectorSearchServiceClient::DeleteIndex( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::vectorsearch::v1::DeleteIndexRequest request; + request.set_name(name); + return connection_->DeleteIndex(NoAwaitTag{}, request); +} + +future> +VectorSearchServiceClient::DeleteIndex( + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteIndex(request); +} + +StatusOr VectorSearchServiceClient::DeleteIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteIndex(NoAwaitTag{}, request); +} + +future> +VectorSearchServiceClient::DeleteIndex( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteIndex(operation); +} + +future> +VectorSearchServiceClient::ImportDataObjects( + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ImportDataObjects(request); +} + +StatusOr +VectorSearchServiceClient::ImportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ImportDataObjects(NoAwaitTag{}, request); +} + +future> +VectorSearchServiceClient::ImportDataObjects( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ImportDataObjects(operation); +} + +future> +VectorSearchServiceClient::ExportDataObjects( + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportDataObjects(request); +} + +StatusOr +VectorSearchServiceClient::ExportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportDataObjects(NoAwaitTag{}, request); +} + +future> +VectorSearchServiceClient::ExportDataObjects( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ExportDataObjects(operation); +} + +StreamRange +VectorSearchServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr +VectorSearchServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange +VectorSearchServiceClient::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 +VectorSearchServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr +VectorSearchServiceClient::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 +VectorSearchServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status VectorSearchServiceClient::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 VectorSearchServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status VectorSearchServiceClient::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 VectorSearchServiceClient::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 vectorsearch_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/vector_search_client.h b/google/cloud/vectorsearch/v1/vector_search_client.h new file mode 100644 index 0000000000000..64e6610b0ea67 --- /dev/null +++ b/google/cloud/vectorsearch/v1/vector_search_client.h @@ -0,0 +1,1453 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_VECTOR_SEARCH_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_VECTOR_SEARCH_CLIENT_H + +#include "google/cloud/vectorsearch/v1/vector_search_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 "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// VectorSearchService provides methods for managing Collection resources, and +/// Collection Index resources. The primary resources offered by this service +/// are Collections which are a container for a set of related JSON data +/// objects, and Collection Indexes which enable efficient ANN search across +/// data objects within a Collection. +/// +/// @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 VectorSearchServiceClient { + public: + explicit VectorSearchServiceClient( + std::shared_ptr connection, + Options opts = {}); + ~VectorSearchServiceClient(); + + ///@{ + /// @name Copy and move support + VectorSearchServiceClient(VectorSearchServiceClient const&) = default; + VectorSearchServiceClient& operator=(VectorSearchServiceClient const&) = + default; + VectorSearchServiceClient(VectorSearchServiceClient&&) = default; + VectorSearchServiceClient& operator=(VectorSearchServiceClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(VectorSearchServiceClient const& a, + VectorSearchServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(VectorSearchServiceClient const& a, + VectorSearchServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Lists Collections in a given project and location. + /// + /// @param parent Required. Parent value for ListCollectionsRequest + /// @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.vectorsearch.v1.Collection], 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.vectorsearch.v1.Collection]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L178} + /// [google.cloud.vectorsearch.v1.ListCollectionsRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L246} + /// + // clang-format on + StreamRange ListCollections( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Collections 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.vectorsearch.v1.ListCollectionsRequest]. + /// 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.vectorsearch.v1.Collection], 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.vectorsearch.v1.Collection]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L178} + /// [google.cloud.vectorsearch.v1.ListCollectionsRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L246} + /// + // clang-format on + StreamRange ListCollections( + google::cloud::vectorsearch::v1::ListCollectionsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Collection. + /// + /// @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.vectorsearch.v1.Collection]) + /// 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.vectorsearch.v1.Collection]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L178} + /// [google.cloud.vectorsearch.v1.GetCollectionRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L283} + /// + // clang-format on + StatusOr GetCollection( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Collection. + /// + /// @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.vectorsearch.v1.GetCollectionRequest]. + /// 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.vectorsearch.v1.Collection]) + /// 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.vectorsearch.v1.Collection]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L178} + /// [google.cloud.vectorsearch.v1.GetCollectionRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L283} + /// + // clang-format on + StatusOr GetCollection( + google::cloud::vectorsearch::v1::GetCollectionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Collection in a given project and location. + /// + /// @param parent Required. Value for parent. + /// @param collection Required. The resource being created + /// @param collection_id Required. ID of the Collection to create. + /// The id must be 1-63 characters long, and comply with + /// [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + /// Specifically, it must be 1-63 characters long and match the regular + /// expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`. + /// @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.vectorsearch.v1.Collection] 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.vectorsearch.v1.Collection]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L178} + /// [google.cloud.vectorsearch.v1.CreateCollectionRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L294} + /// + // clang-format on + future> + CreateCollection( + std::string const& parent, + google::cloud::vectorsearch::v1::Collection const& collection, + std::string const& collection_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCollection + /// + /// 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 CreateCollection( + NoAwaitTag, std::string const& parent, + google::cloud::vectorsearch::v1::Collection const& collection, + std::string const& collection_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Collection 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.vectorsearch.v1.CreateCollectionRequest]. + /// 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.vectorsearch.v1.Collection] 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.vectorsearch.v1.Collection]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L178} + /// [google.cloud.vectorsearch.v1.CreateCollectionRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L294} + /// + // clang-format on + future> + CreateCollection( + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCollection + /// + /// 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 CreateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCollection + /// + /// 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> + CreateCollection(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Collection. + /// + /// @param collection Required. The resource being updated + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// Collection 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 present in the request will be + /// overwritten. + /// @n + /// The following fields support update: `display_name`, `description`, + /// `labels`, `data_schema`, `vector_schema`. + /// For `data_schema` and `vector_schema`, fields can only be added, not + /// deleted, but `vertex_embedding_config` in `vector_schema` can be added or + /// removed. + /// Partial updates for `data_schema` and `vector_schema` are also supported + /// by using sub-field paths in `update_mask`, e.g. + /// `data_schema.properties.foo` or `vector_schema.my_vector_field`. + /// @n + /// If `*` is provided in the update_mask, full replacement will be performed. + /// @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.vectorsearch.v1.Collection] 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.vectorsearch.v1.Collection]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L178} + /// [google.cloud.vectorsearch.v1.UpdateCollectionRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L333} + /// + // clang-format on + future> + UpdateCollection( + google::cloud::vectorsearch::v1::Collection const& collection, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateCollection + /// + /// 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 UpdateCollection( + NoAwaitTag, google::cloud::vectorsearch::v1::Collection const& collection, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Collection. + /// + /// @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.vectorsearch.v1.UpdateCollectionRequest]. + /// 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.vectorsearch.v1.Collection] 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.vectorsearch.v1.Collection]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L178} + /// [google.cloud.vectorsearch.v1.UpdateCollectionRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L333} + /// + // clang-format on + future> + UpdateCollection( + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateCollection + /// + /// 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 UpdateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateCollection + /// + /// 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> + UpdateCollection(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single Collection. + /// + /// @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.vectorsearch.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.vectorsearch.v1.DeleteCollectionRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L377} + /// [google.cloud.vectorsearch.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L580} + /// + // clang-format on + future> + DeleteCollection(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCollection + /// + /// 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 DeleteCollection( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Collection. + /// + /// @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.vectorsearch.v1.DeleteCollectionRequest]. + /// 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.vectorsearch.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.vectorsearch.v1.DeleteCollectionRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L377} + /// [google.cloud.vectorsearch.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L580} + /// + // clang-format on + future> + DeleteCollection( + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCollection + /// + /// 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 DeleteCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCollection + /// + /// 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> + DeleteCollection(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists Indexes in a given project and location. + /// + /// @param parent Required. Parent value for ListIndexesRequest + /// @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.vectorsearch.v1.Index], 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.vectorsearch.v1.Index]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L406} + /// [google.cloud.vectorsearch.v1.ListIndexesRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L536} + /// + // clang-format on + StreamRange ListIndexes( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Indexes 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.vectorsearch.v1.ListIndexesRequest]. + /// 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.vectorsearch.v1.Index], 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.vectorsearch.v1.Index]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L406} + /// [google.cloud.vectorsearch.v1.ListIndexesRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L536} + /// + // clang-format on + StreamRange ListIndexes( + google::cloud::vectorsearch::v1::ListIndexesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Index. + /// + /// @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.vectorsearch.v1.Index]) + /// 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.vectorsearch.v1.GetIndexRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L569} + /// [google.cloud.vectorsearch.v1.Index]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L406} + /// + // clang-format on + StatusOr GetIndex( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Index. + /// + /// @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.vectorsearch.v1.GetIndexRequest]. + /// 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.vectorsearch.v1.Index]) + /// 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.vectorsearch.v1.GetIndexRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L569} + /// [google.cloud.vectorsearch.v1.Index]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L406} + /// + // clang-format on + StatusOr GetIndex( + google::cloud::vectorsearch::v1::GetIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Index in a given project and location. + /// + /// @param parent Required. The resource name of the Collection for which to create the + /// Index. Format: + /// `projects/{project}/locations/{location}/collections/{collection}` + /// @param index Required. The resource being created + /// @param index_id Required. ID of the Index to create. + /// The id must be 1-63 characters long, and comply with + /// [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + /// Specifically, it must be 1-63 characters long and match the regular + /// expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`. + /// @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.vectorsearch.v1.Index] 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.vectorsearch.v1.CreateIndexRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L464} + /// [google.cloud.vectorsearch.v1.Index]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L406} + /// + // clang-format on + future> CreateIndex( + std::string const& parent, + google::cloud::vectorsearch::v1::Index const& index, + std::string const& index_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateIndex + /// + /// 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 CreateIndex( + NoAwaitTag, std::string const& parent, + google::cloud::vectorsearch::v1::Index const& index, + std::string const& index_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Index 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.vectorsearch.v1.CreateIndexRequest]. + /// 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.vectorsearch.v1.Index] 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.vectorsearch.v1.CreateIndexRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L464} + /// [google.cloud.vectorsearch.v1.Index]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L406} + /// + // clang-format on + future> CreateIndex( + google::cloud::vectorsearch::v1::CreateIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateIndex + /// + /// 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 CreateIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateIndex + /// + /// 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> CreateIndex( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Index. + /// + /// @param name Required. The resource name of the Index to delete. + /// Format: + /// `projects/{project}/locations/{location}/collections/{collection}/indexes/{index}` + /// @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.vectorsearch.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.vectorsearch.v1.DeleteIndexRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L505} + /// [google.cloud.vectorsearch.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L580} + /// + // clang-format on + future> + DeleteIndex(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteIndex + /// + /// 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 DeleteIndex(NoAwaitTag, + std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single Index. + /// + /// @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.vectorsearch.v1.DeleteIndexRequest]. + /// 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.vectorsearch.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.vectorsearch.v1.DeleteIndexRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L505} + /// [google.cloud.vectorsearch.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L580} + /// + // clang-format on + future> + DeleteIndex( + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteIndex + /// + /// 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 DeleteIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteIndex + /// + /// 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> + DeleteIndex(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Initiates a Long-Running Operation to import DataObjects into a Collection. + /// + /// @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.vectorsearch.v1.ImportDataObjectsRequest]. + /// 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.vectorsearch.v1.ImportDataObjectsResponse] 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.vectorsearch.v1.ImportDataObjectsRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L612} + /// [google.cloud.vectorsearch.v1.ImportDataObjectsResponse]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L665} + /// + // clang-format on + future> + ImportDataObjects( + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ImportDataObjects + /// + /// 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 ImportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ImportDataObjects + /// + /// 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> + ImportDataObjects(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Initiates a Long-Running Operation to export DataObjects from a Collection. + /// + /// @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.vectorsearch.v1.ExportDataObjectsRequest]. + /// 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.vectorsearch.v1.ExportDataObjectsResponse] 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.vectorsearch.v1.ExportDataObjectsRequest]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L672} + /// [google.cloud.vectorsearch.v1.ExportDataObjectsResponse]: @googleapis_reference_link{google/cloud/vectorsearch/v1/vectorsearch_service.proto#L721} + /// + // clang-format on + future> + ExportDataObjects( + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportDataObjects + /// + /// 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 ExportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ExportDataObjects + /// + /// 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> + ExportDataObjects(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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 vectorsearch_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_VECTOR_SEARCH_CLIENT_H diff --git a/google/cloud/vectorsearch/v1/vector_search_connection.cc b/google/cloud/vectorsearch/v1/vector_search_connection.cc new file mode 100644 index 0000000000000..efce9baabfa62 --- /dev/null +++ b/google/cloud/vectorsearch/v1/vector_search_connection.cc @@ -0,0 +1,294 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#include "google/cloud/vectorsearch/v1/vector_search_connection.h" +#include "google/cloud/vectorsearch/v1/internal/vector_search_connection_impl.h" +#include "google/cloud/vectorsearch/v1/internal/vector_search_option_defaults.h" +#include "google/cloud/vectorsearch/v1/internal/vector_search_stub_factory.h" +#include "google/cloud/vectorsearch/v1/internal/vector_search_tracing_connection.h" +#include "google/cloud/vectorsearch/v1/vector_search_options.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 vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +VectorSearchServiceConnection::~VectorSearchServiceConnection() = default; + +StreamRange +VectorSearchServiceConnection::ListCollections( + google::cloud::vectorsearch::v1:: + ListCollectionsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +VectorSearchServiceConnection::GetCollection( + google::cloud::vectorsearch::v1::GetCollectionRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +VectorSearchServiceConnection::CreateCollection( + google::cloud::vectorsearch::v1::CreateCollectionRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +VectorSearchServiceConnection::CreateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateCollectionRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +VectorSearchServiceConnection::CreateCollection( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +VectorSearchServiceConnection::UpdateCollection( + google::cloud::vectorsearch::v1::UpdateCollectionRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +VectorSearchServiceConnection::UpdateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +VectorSearchServiceConnection::UpdateCollection( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +VectorSearchServiceConnection::DeleteCollection( + google::cloud::vectorsearch::v1::DeleteCollectionRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +VectorSearchServiceConnection::DeleteCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +VectorSearchServiceConnection::DeleteCollection( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +VectorSearchServiceConnection::ListIndexes( + google::cloud::vectorsearch::v1:: + ListIndexesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +VectorSearchServiceConnection::GetIndex( + google::cloud::vectorsearch::v1::GetIndexRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +VectorSearchServiceConnection::CreateIndex( + google::cloud::vectorsearch::v1::CreateIndexRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +VectorSearchServiceConnection::CreateIndex( + NoAwaitTag, google::cloud::vectorsearch::v1::CreateIndexRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +VectorSearchServiceConnection::CreateIndex( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +VectorSearchServiceConnection::DeleteIndex( + google::cloud::vectorsearch::v1::DeleteIndexRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +VectorSearchServiceConnection::DeleteIndex( + NoAwaitTag, google::cloud::vectorsearch::v1::DeleteIndexRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +VectorSearchServiceConnection::DeleteIndex( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +VectorSearchServiceConnection::ImportDataObjects( + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +VectorSearchServiceConnection::ImportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +VectorSearchServiceConnection::ImportDataObjects( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +VectorSearchServiceConnection::ExportDataObjects( + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +VectorSearchServiceConnection::ExportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +VectorSearchServiceConnection::ExportDataObjects( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +VectorSearchServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +VectorSearchServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +VectorSearchServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +VectorSearchServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status VectorSearchServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status VectorSearchServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr +MakeVectorSearchServiceConnection(Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = vectorsearch_v1_internal::VectorSearchServiceDefaultOptions( + std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = vectorsearch_v1_internal::CreateDefaultVectorSearchServiceStub( + std::move(auth), options); + return vectorsearch_v1_internal::MakeVectorSearchServiceTracingConnection( + std::make_shared< + vectorsearch_v1_internal::VectorSearchServiceConnectionImpl>( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/vector_search_connection.h b/google/cloud/vectorsearch/v1/vector_search_connection.h new file mode 100644 index 0000000000000..e6c26de0ca565 --- /dev/null +++ b/google/cloud/vectorsearch/v1/vector_search_connection.h @@ -0,0 +1,335 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_VECTOR_SEARCH_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_VECTOR_SEARCH_CONNECTION_H + +#include "google/cloud/vectorsearch/v1/internal/vector_search_retry_traits.h" +#include "google/cloud/vectorsearch/v1/vector_search_connection_idempotency_policy.h" +#include "google/cloud/vectorsearch/v1/vectorsearch_service.pb.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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `VectorSearchServiceConnection`. +class VectorSearchServiceRetryPolicy : 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 `VectorSearchServiceConnection` 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 VectorSearchServiceLimitedErrorCountRetryPolicy + : public VectorSearchServiceRetryPolicy { + 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 VectorSearchServiceLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + VectorSearchServiceLimitedErrorCountRetryPolicy( + VectorSearchServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : VectorSearchServiceLimitedErrorCountRetryPolicy( + rhs.maximum_failures()) {} + VectorSearchServiceLimitedErrorCountRetryPolicy( + VectorSearchServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : VectorSearchServiceLimitedErrorCountRetryPolicy( + 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 = VectorSearchServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + vectorsearch_v1_internal::VectorSearchServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `VectorSearchServiceConnection` 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 VectorSearchServiceLimitedTimeRetryPolicy + : public VectorSearchServiceRetryPolicy { + 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 VectorSearchServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + VectorSearchServiceLimitedTimeRetryPolicy( + VectorSearchServiceLimitedTimeRetryPolicy&& rhs) noexcept + : VectorSearchServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + VectorSearchServiceLimitedTimeRetryPolicy( + VectorSearchServiceLimitedTimeRetryPolicy const& rhs) noexcept + : VectorSearchServiceLimitedTimeRetryPolicy(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 = VectorSearchServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + vectorsearch_v1_internal::VectorSearchServiceRetryTraits> + impl_; +}; + +/** + * The `VectorSearchServiceConnection` object for `VectorSearchServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `VectorSearchServiceClient`. This allows users to inject custom + * behavior (e.g., with a Google Mock object) when writing tests that use + * objects of type `VectorSearchServiceClient`. + * + * To create a concrete instance, see `MakeVectorSearchServiceConnection()`. + * + * For mocking, see `vectorsearch_v1_mocks::MockVectorSearchServiceConnection`. + */ +class VectorSearchServiceConnection { + public: + virtual ~VectorSearchServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StreamRange + ListCollections( + google::cloud::vectorsearch::v1::ListCollectionsRequest request); + + virtual StatusOr GetCollection( + google::cloud::vectorsearch::v1::GetCollectionRequest const& request); + + virtual future> + CreateCollection( + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request); + + virtual StatusOr CreateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request); + + virtual future> + CreateCollection(google::longrunning::Operation const& operation); + + virtual future> + UpdateCollection( + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request); + + virtual StatusOr UpdateCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request); + + virtual future> + UpdateCollection(google::longrunning::Operation const& operation); + + virtual future> + DeleteCollection( + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request); + + virtual StatusOr DeleteCollection( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request); + + virtual future> + DeleteCollection(google::longrunning::Operation const& operation); + + virtual StreamRange ListIndexes( + google::cloud::vectorsearch::v1::ListIndexesRequest request); + + virtual StatusOr GetIndex( + google::cloud::vectorsearch::v1::GetIndexRequest const& request); + + virtual future> CreateIndex( + google::cloud::vectorsearch::v1::CreateIndexRequest const& request); + + virtual StatusOr CreateIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::CreateIndexRequest const& request); + + virtual future> CreateIndex( + google::longrunning::Operation const& operation); + + virtual future> + DeleteIndex( + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request); + + virtual StatusOr DeleteIndex( + NoAwaitTag, + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request); + + virtual future> + DeleteIndex(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + ImportDataObjects( + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request); + + virtual StatusOr ImportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request); + + virtual future< + StatusOr> + ImportDataObjects(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + ExportDataObjects( + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request); + + virtual StatusOr ExportDataObjects( + NoAwaitTag, + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const& request); + + virtual future< + StatusOr> + ExportDataObjects(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 + * `VectorSearchServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of + * VectorSearchServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `VectorSearchServiceConnection`. Expected options are any of the + * types in the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::vectorsearch_v1::VectorSearchServicePolicyOptionList` + * + * @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 `VectorSearchServiceConnection` + * created by this function. + */ +std::shared_ptr +MakeVectorSearchServiceConnection(Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_VECTOR_SEARCH_CONNECTION_H diff --git a/google/cloud/vectorsearch/v1/vector_search_connection_idempotency_policy.cc b/google/cloud/vectorsearch/v1/vector_search_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..fa24855332646 --- /dev/null +++ b/google/cloud/vectorsearch/v1/vector_search_connection_idempotency_policy.cc @@ -0,0 +1,131 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#include "google/cloud/vectorsearch/v1/vector_search_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +VectorSearchServiceConnectionIdempotencyPolicy:: + ~VectorSearchServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +VectorSearchServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique( + *this); +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::ListCollections( + google::cloud::vectorsearch::v1::ListCollectionsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::GetCollection( + google::cloud::vectorsearch::v1::GetCollectionRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::CreateCollection( + google::cloud::vectorsearch::v1::CreateCollectionRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::UpdateCollection( + google::cloud::vectorsearch::v1::UpdateCollectionRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::DeleteCollection( + google::cloud::vectorsearch::v1::DeleteCollectionRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::ListIndexes( + google::cloud::vectorsearch::v1::ListIndexesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::GetIndex( + google::cloud::vectorsearch::v1::GetIndexRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::CreateIndex( + google::cloud::vectorsearch::v1::CreateIndexRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::DeleteIndex( + google::cloud::vectorsearch::v1::DeleteIndexRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::ImportDataObjects( + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::ExportDataObjects( + google::cloud::vectorsearch::v1::ExportDataObjectsRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency VectorSearchServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultVectorSearchServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/vectorsearch/v1/vector_search_connection_idempotency_policy.h b/google/cloud/vectorsearch/v1/vector_search_connection_idempotency_policy.h new file mode 100644 index 0000000000000..ce1d3ca3d5783 --- /dev/null +++ b/google/cloud/vectorsearch/v1/vector_search_connection_idempotency_policy.h @@ -0,0 +1,102 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_VECTOR_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_VECTOR_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/vectorsearch/v1/vectorsearch_service.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class VectorSearchServiceConnectionIdempotencyPolicy { + public: + virtual ~VectorSearchServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr + clone() const; + + virtual google::cloud::Idempotency ListCollections( + google::cloud::vectorsearch::v1::ListCollectionsRequest request); + + virtual google::cloud::Idempotency GetCollection( + google::cloud::vectorsearch::v1::GetCollectionRequest const& request); + + virtual google::cloud::Idempotency CreateCollection( + google::cloud::vectorsearch::v1::CreateCollectionRequest const& request); + + virtual google::cloud::Idempotency UpdateCollection( + google::cloud::vectorsearch::v1::UpdateCollectionRequest const& request); + + virtual google::cloud::Idempotency DeleteCollection( + google::cloud::vectorsearch::v1::DeleteCollectionRequest const& request); + + virtual google::cloud::Idempotency ListIndexes( + google::cloud::vectorsearch::v1::ListIndexesRequest request); + + virtual google::cloud::Idempotency GetIndex( + google::cloud::vectorsearch::v1::GetIndexRequest const& request); + + virtual google::cloud::Idempotency CreateIndex( + google::cloud::vectorsearch::v1::CreateIndexRequest const& request); + + virtual google::cloud::Idempotency DeleteIndex( + google::cloud::vectorsearch::v1::DeleteIndexRequest const& request); + + virtual google::cloud::Idempotency ImportDataObjects( + google::cloud::vectorsearch::v1::ImportDataObjectsRequest const& request); + + virtual google::cloud::Idempotency ExportDataObjects( + google::cloud::vectorsearch::v1::ExportDataObjectsRequest 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 +MakeDefaultVectorSearchServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_VECTOR_SEARCH_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/vectorsearch/v1/vector_search_options.h b/google/cloud/vectorsearch/v1/vector_search_options.h new file mode 100644 index 0000000000000..21dd04e9e3193 --- /dev/null +++ b/google/cloud/vectorsearch/v1/vector_search_options.h @@ -0,0 +1,87 @@ +// Copyright 2026 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/vectorsearch/v1/vectorsearch_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_VECTOR_SEARCH_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_VECTOR_SEARCH_OPTIONS_H + +#include "google/cloud/vectorsearch/v1/vector_search_connection.h" +#include "google/cloud/vectorsearch/v1/vector_search_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 vectorsearch_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-vectorsearch-options + */ +struct VectorSearchServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-vectorsearch-options + */ +struct VectorSearchServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-vectorsearch-options + */ +struct VectorSearchServiceConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-vectorsearch-options + */ +struct VectorSearchServicePollingPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to VectorSearchService. + * + * @ingroup google-cloud-vectorsearch-options + */ +using VectorSearchServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace vectorsearch_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VECTORSEARCH_V1_VECTOR_SEARCH_OPTIONS_H diff --git a/google/cloud/video/livestream/v1/livestream_client.h b/google/cloud/video/livestream/v1/livestream_client.h index 734068a383b42..e2babb07923e8 100644 --- a/google/cloud/video/livestream/v1/livestream_client.h +++ b/google/cloud/video/livestream/v1/livestream_client.h @@ -3621,7 +3621,7 @@ class LivestreamServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -3660,7 +3660,7 @@ class LivestreamServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/video/quickstart/.bazelversion b/google/cloud/video/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/video/quickstart/.bazelversion +++ b/google/cloud/video/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/video/quickstart/WORKSPACE.bazel b/google/cloud/video/quickstart/WORKSPACE.bazel index 5fa32a44a3c55..fd0f4a4f5a400 100644 --- a/google/cloud/video/quickstart/WORKSPACE.bazel +++ b/google/cloud/video/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/video/stitcher/v1/video_stitcher_client.h b/google/cloud/video/stitcher/v1/video_stitcher_client.h index 2169c23fe71e6..865e480c35051 100644 --- a/google/cloud/video/stitcher/v1/video_stitcher_client.h +++ b/google/cloud/video/stitcher/v1/video_stitcher_client.h @@ -2944,7 +2944,7 @@ class VideoStitcherServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2983,7 +2983,7 @@ class VideoStitcherServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/videointelligence/quickstart/.bazelversion b/google/cloud/videointelligence/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/videointelligence/quickstart/.bazelversion +++ b/google/cloud/videointelligence/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/videointelligence/quickstart/WORKSPACE.bazel b/google/cloud/videointelligence/quickstart/WORKSPACE.bazel index 623fc3fb6027d..32f57e34e9b87 100644 --- a/google/cloud/videointelligence/quickstart/WORKSPACE.bazel +++ b/google/cloud/videointelligence/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/vision/quickstart/.bazelversion b/google/cloud/vision/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/vision/quickstart/.bazelversion +++ b/google/cloud/vision/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/vision/quickstart/WORKSPACE.bazel b/google/cloud/vision/quickstart/WORKSPACE.bazel index 03753783b8f3e..595c21a7fffd1 100644 --- a/google/cloud/vision/quickstart/WORKSPACE.bazel +++ b/google/cloud/vision/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/visionai/BUILD.bazel b/google/cloud/visionai/BUILD.bazel new file mode 100644 index 0000000000000..a9e8456fee3c4 --- /dev/null +++ b/google/cloud/visionai/BUILD.bazel @@ -0,0 +1,31 @@ +# Copyright 2026 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 = [ + "@googleapis//google/cloud/visionai/v1:visionai_cc_grpc", +] + +cc_gapic_library( + name = "visionai", + googleapis_deps = googleapis_deps, + service_dirs = service_dirs, +) diff --git a/google/cloud/visionai/CMakeLists.txt b/google/cloud/visionai/CMakeLists.txt new file mode 100644 index 0000000000000..41a2dc7f82726 --- /dev/null +++ b/google/cloud/visionai/CMakeLists.txt @@ -0,0 +1,34 @@ +# ~~~ +# Copyright 2026 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(visionai "Vision AI API" SERVICE_DIRS "v1/") + +if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) + add_executable(visionai_quickstart "quickstart/quickstart.cc") + target_link_libraries(visionai_quickstart + PRIVATE google-cloud-cpp::visionai) + google_cloud_cpp_add_common_options(visionai_quickstart) + add_test( + NAME visionai_quickstart + COMMAND + cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" + $ GOOGLE_CLOUD_PROJECT + GOOGLE_CLOUD_CPP_TEST_REGION) + set_tests_properties(visionai_quickstart + PROPERTIES LABELS "integration-test;quickstart") +endif () diff --git a/google/cloud/visionai/README.md b/google/cloud/visionai/README.md new file mode 100644 index 0000000000000..4a74ea3ece75b --- /dev/null +++ b/google/cloud/visionai/README.md @@ -0,0 +1,58 @@ +# Vision AI API C++ Client Library + +This directory contains an idiomatic C++ client library for the +[Vision AI API][cloud-service-docs]. + +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/visionai/v1/app_platform_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 visionai = ::google::cloud::visionai_v1; + auto client = + visionai::AppPlatformClient(visionai::MakeAppPlatformConnection()); + + for (auto r : client.ListApplications(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 [Vision AI 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/vision-ai/docs +[doxygen-link]: https://cloud.google.com/cpp/docs/reference/visionai/latest/ +[source-link]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/visionai diff --git a/google/cloud/visionai/doc/environment-variables.dox b/google/cloud/visionai/doc/environment-variables.dox new file mode 100644 index 0000000000000..68053d69cc1d9 --- /dev/null +++ b/google/cloud/visionai/doc/environment-variables.dox @@ -0,0 +1,69 @@ +/*! +@page visionai-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 visionai-env-endpoint Endpoint Overrides + + + +- `GOOGLE_CLOUD_CPP_APP_PLATFORM_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "visionai.googleapis.com") + used by `MakeAppPlatformConnection()`. + +- `GOOGLE_CLOUD_CPP_HEALTH_CHECK_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "visionai.googleapis.com") + used by `MakeHealthCheckServiceConnection()`. + +- `GOOGLE_CLOUD_CPP_LIVE_VIDEO_ANALYTICS_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "visionai.googleapis.com") + used by `MakeLiveVideoAnalyticsConnection()`. + +- `GOOGLE_CLOUD_CPP_STREAMING_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "visionai.googleapis.com") + used by `MakeStreamingServiceConnection()`. + +- `GOOGLE_CLOUD_CPP_STREAMS_SERVICE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "visionai.googleapis.com") + used by `MakeStreamsServiceConnection()`. + +- `GOOGLE_CLOUD_CPP_WAREHOUSE_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "warehouse-visionai.googleapis.com") + used by `MakeWarehouseConnection()`. + + + +@see google::cloud::EndpointOption + +@section visionai-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 visionai-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/visionai/doc/main.dox b/google/cloud/visionai/doc/main.dox new file mode 100644 index 0000000000000..3a59bd533f287 --- /dev/null +++ b/google/cloud/visionai/doc/main.dox @@ -0,0 +1,58 @@ +/*! + +@mainpage Vision AI API C++ Client Library + +An idiomatic C++ client library for the [Vision AI API][cloud-service-docs]. + + + +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/visionai/quickstart/` directory, +which should give you a taste of the Vision AI API C++ client library API. + +@snippet quickstart.cc all + +## Main classes + + +This library offers multiple `*Client` classes, which are listed below. Each one +of these classes exposes all the RPCs for a service as member functions of the +class. This library groups multiple services because they are part of the same +product or are often used together. A typical example may be the administrative +and data plane operations for a single product. + +The library also has other classes that provide helpers, configuration +parameters, and infrastructure to mock the `*Client` classes when testing your +application. + +- [\c visionai_v1::AppPlatformClient](@ref google::cloud::visionai_v1::AppPlatformClient) +- [\c visionai_v1::HealthCheckServiceClient](@ref google::cloud::visionai_v1::HealthCheckServiceClient) +- [\c visionai_v1::LiveVideoAnalyticsClient](@ref google::cloud::visionai_v1::LiveVideoAnalyticsClient) +- [\c visionai_v1::StreamingServiceClient](@ref google::cloud::visionai_v1::StreamingServiceClient) +- [\c visionai_v1::StreamsServiceClient](@ref google::cloud::visionai_v1::StreamsServiceClient) +- [\c visionai_v1::WarehouseClient](@ref google::cloud::visionai_v1::WarehouseClient) + + +## More Information + +- @ref common-error-handling - describes how the library reports errors. +- @ref visionai-override-endpoint - describes how to override the default + endpoint. +- @ref visionai-override-authentication - describes how to change the + authentication credentials used by the library. +- @ref visionai-override-retry - describes how to change the default retry + policies. +- @ref visionai-env - describes environment variables that can configure the + behavior of the library. +- @ref visionai-override-universe-domain - describes how to override the default universe domain. + +[cloud-service-docs]: https://cloud.google.com/vision-ai/docs + +*/ diff --git a/google/cloud/visionai/doc/options.dox b/google/cloud/visionai/doc/options.dox new file mode 100644 index 0000000000000..492bd6b04454a --- /dev/null +++ b/google/cloud/visionai/doc/options.dox @@ -0,0 +1,10 @@ +/*! +@defgroup google-cloud-visionai-options Vision AI 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/visionai/doc/override-authentication.dox b/google/cloud/visionai/doc/override-authentication.dox new file mode 100644 index 0000000000000..dcf3a95ef7009 --- /dev/null +++ b/google/cloud/visionai/doc/override-authentication.dox @@ -0,0 +1,74 @@ +/*! +@page visionai-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 app_platform_client_samples.cc with-service-account + +Follow these links to find examples for other \c *Client classes: + +- [\c visionai_v1::AppPlatformClient](@ref visionai_v1::AppPlatformClient-service-account-snippet) +- [\c visionai_v1::HealthCheckServiceClient](@ref visionai_v1::HealthCheckServiceClient-service-account-snippet) +- [\c visionai_v1::LiveVideoAnalyticsClient](@ref visionai_v1::LiveVideoAnalyticsClient-service-account-snippet) +- [\c visionai_v1::StreamingServiceClient](@ref visionai_v1::StreamingServiceClient-service-account-snippet) +- [\c visionai_v1::StreamsServiceClient](@ref visionai_v1::StreamsServiceClient-service-account-snippet) +- [\c visionai_v1::WarehouseClient](@ref visionai_v1::WarehouseClient-service-account-snippet) + + + +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 visionai_v1::AppPlatformClient-service-account-snippet Override visionai_v1::AppPlatformClient Authentication Defaults + +@snippet google/cloud/visionai/v1/samples/app_platform_client_samples.cc with-service-account + +*/ + +/*! @page visionai_v1::HealthCheckServiceClient-service-account-snippet Override visionai_v1::HealthCheckServiceClient Authentication Defaults + +@snippet google/cloud/visionai/v1/samples/health_check_client_samples.cc with-service-account + +*/ + +/*! @page visionai_v1::LiveVideoAnalyticsClient-service-account-snippet Override visionai_v1::LiveVideoAnalyticsClient Authentication Defaults + +@snippet google/cloud/visionai/v1/samples/live_video_analytics_client_samples.cc with-service-account + +*/ + +/*! @page visionai_v1::StreamingServiceClient-service-account-snippet Override visionai_v1::StreamingServiceClient Authentication Defaults + +@snippet google/cloud/visionai/v1/samples/streaming_client_samples.cc with-service-account + +*/ + +/*! @page visionai_v1::StreamsServiceClient-service-account-snippet Override visionai_v1::StreamsServiceClient Authentication Defaults + +@snippet google/cloud/visionai/v1/samples/streams_client_samples.cc with-service-account + +*/ + +/*! @page visionai_v1::WarehouseClient-service-account-snippet Override visionai_v1::WarehouseClient Authentication Defaults + +@snippet google/cloud/visionai/v1/samples/warehouse_client_samples.cc with-service-account + +*/ +// diff --git a/google/cloud/visionai/doc/override-endpoint.dox b/google/cloud/visionai/doc/override-endpoint.dox new file mode 100644 index 0000000000000..0bcc4ffa1393d --- /dev/null +++ b/google/cloud/visionai/doc/override-endpoint.dox @@ -0,0 +1,64 @@ +/*! +@page visionai-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 `visionai_v1::AppPlatformClient`: + +@snippet app_platform_client_samples.cc set-client-endpoint + +Follow these links to find examples for other \c *Client classes: + +- [\c visionai_v1::AppPlatformClient](@ref visionai_v1::AppPlatformClient-endpoint-snippet) +- [\c visionai_v1::HealthCheckServiceClient](@ref visionai_v1::HealthCheckServiceClient-endpoint-snippet) +- [\c visionai_v1::LiveVideoAnalyticsClient](@ref visionai_v1::LiveVideoAnalyticsClient-endpoint-snippet) +- [\c visionai_v1::StreamingServiceClient](@ref visionai_v1::StreamingServiceClient-endpoint-snippet) +- [\c visionai_v1::StreamsServiceClient](@ref visionai_v1::StreamsServiceClient-endpoint-snippet) +- [\c visionai_v1::WarehouseClient](@ref visionai_v1::WarehouseClient-endpoint-snippet) + + + +*/ + +// + +/*! @page visionai_v1::AppPlatformClient-endpoint-snippet Override visionai_v1::AppPlatformClient Endpoint Configuration + +@snippet google/cloud/visionai/v1/samples/app_platform_client_samples.cc set-client-endpoint + +*/ + +/*! @page visionai_v1::HealthCheckServiceClient-endpoint-snippet Override visionai_v1::HealthCheckServiceClient Endpoint Configuration + +@snippet google/cloud/visionai/v1/samples/health_check_client_samples.cc set-client-endpoint + +*/ + +/*! @page visionai_v1::LiveVideoAnalyticsClient-endpoint-snippet Override visionai_v1::LiveVideoAnalyticsClient Endpoint Configuration + +@snippet google/cloud/visionai/v1/samples/live_video_analytics_client_samples.cc set-client-endpoint + +*/ + +/*! @page visionai_v1::StreamingServiceClient-endpoint-snippet Override visionai_v1::StreamingServiceClient Endpoint Configuration + +@snippet google/cloud/visionai/v1/samples/streaming_client_samples.cc set-client-endpoint + +*/ + +/*! @page visionai_v1::StreamsServiceClient-endpoint-snippet Override visionai_v1::StreamsServiceClient Endpoint Configuration + +@snippet google/cloud/visionai/v1/samples/streams_client_samples.cc set-client-endpoint + +*/ + +/*! @page visionai_v1::WarehouseClient-endpoint-snippet Override visionai_v1::WarehouseClient Endpoint Configuration + +@snippet google/cloud/visionai/v1/samples/warehouse_client_samples.cc set-client-endpoint + +*/ +// diff --git a/google/cloud/visionai/doc/override-retry-policies.dox b/google/cloud/visionai/doc/override-retry-policies.dox new file mode 100644 index 0000000000000..6162870211598 --- /dev/null +++ b/google/cloud/visionai/doc/override-retry-policies.dox @@ -0,0 +1,177 @@ +/*! +@page visionai-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 visionai-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 visionai-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 visionai-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 visionai-override-retry-example Example + + +For example, this will override the retry policies for `visionai_v1::AppPlatformClient`: + +@snippet app_platform_client_samples.cc set-retry-policy + +This assumes you have created a custom idempotency policy. Such as: + +@snippet app_platform_client_samples.cc custom-idempotency-policy + +This will override the polling policies for `visionai_v1::AppPlatformClient` + +@snippet app_platform_client_samples.cc set-polling-policy + + +Follow these links to find examples for other \c *Client classes: + +- [\c visionai_v1::AppPlatformClient](@ref visionai_v1::AppPlatformClient-retry-snippet) +- [\c visionai_v1::HealthCheckServiceClient](@ref visionai_v1::HealthCheckServiceClient-retry-snippet) +- [\c visionai_v1::LiveVideoAnalyticsClient](@ref visionai_v1::LiveVideoAnalyticsClient-retry-snippet) +- [\c visionai_v1::StreamingServiceClient](@ref visionai_v1::StreamingServiceClient-retry-snippet) +- [\c visionai_v1::StreamsServiceClient](@ref visionai_v1::StreamsServiceClient-retry-snippet) +- [\c visionai_v1::WarehouseClient](@ref visionai_v1::WarehouseClient-retry-snippet) + + + +@section visionai-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 visionai_v1::AppPlatformClient-retry-snippet Override visionai_v1::AppPlatformClient Retry Policies + +This shows how to override the retry policies for visionai_v1::AppPlatformClient: + +@snippet google/cloud/visionai/v1/samples/app_platform_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/visionai/v1/samples/app_platform_client_samples.cc custom-idempotency-policy + +*/ + +/*! @page visionai_v1::HealthCheckServiceClient-retry-snippet Override visionai_v1::HealthCheckServiceClient Retry Policies + +This shows how to override the retry policies for visionai_v1::HealthCheckServiceClient: + +@snippet google/cloud/visionai/v1/samples/health_check_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/visionai/v1/samples/health_check_client_samples.cc custom-idempotency-policy + +*/ + +/*! @page visionai_v1::LiveVideoAnalyticsClient-retry-snippet Override visionai_v1::LiveVideoAnalyticsClient Retry Policies + +This shows how to override the retry policies for visionai_v1::LiveVideoAnalyticsClient: + +@snippet google/cloud/visionai/v1/samples/live_video_analytics_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/visionai/v1/samples/live_video_analytics_client_samples.cc custom-idempotency-policy + +*/ + +/*! @page visionai_v1::StreamingServiceClient-retry-snippet Override visionai_v1::StreamingServiceClient Retry Policies + +This shows how to override the retry policies for visionai_v1::StreamingServiceClient: + +@snippet google/cloud/visionai/v1/samples/streaming_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/visionai/v1/samples/streaming_client_samples.cc custom-idempotency-policy + +*/ + +/*! @page visionai_v1::StreamsServiceClient-retry-snippet Override visionai_v1::StreamsServiceClient Retry Policies + +This shows how to override the retry policies for visionai_v1::StreamsServiceClient: + +@snippet google/cloud/visionai/v1/samples/streams_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/visionai/v1/samples/streams_client_samples.cc custom-idempotency-policy + +*/ + +/*! @page visionai_v1::WarehouseClient-retry-snippet Override visionai_v1::WarehouseClient Retry Policies + +This shows how to override the retry policies for visionai_v1::WarehouseClient: + +@snippet google/cloud/visionai/v1/samples/warehouse_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/visionai/v1/samples/warehouse_client_samples.cc custom-idempotency-policy + +*/ +// diff --git a/google/cloud/visionai/doc/override-universe-domain.dox b/google/cloud/visionai/doc/override-universe-domain.dox new file mode 100644 index 0000000000000..aec133cc50aad --- /dev/null +++ b/google/cloud/visionai/doc/override-universe-domain.dox @@ -0,0 +1,63 @@ +/*! +@page visionai-override-universe-domain How to Override the Default Universe Domain + +In some cases, you may need to override the default universe domain used by the +client library. Use `AddUniverseDomainOption` when initializing the client +library to change this default. + + +For example, this will override the default universe domain for `visionai_v1::AppPlatformClient`: + +@snippet app_platform_client_samples.cc set-client-universe-domain + +Follow these links to find examples for other \c *Client classes: + +- [\c visionai_v1::AppPlatformClient](@ref visionai_v1::AppPlatformClient-universe-domain-snippet) +- [\c visionai_v1::HealthCheckServiceClient](@ref visionai_v1::HealthCheckServiceClient-universe-domain-snippet) +- [\c visionai_v1::LiveVideoAnalyticsClient](@ref visionai_v1::LiveVideoAnalyticsClient-universe-domain-snippet) +- [\c visionai_v1::StreamingServiceClient](@ref visionai_v1::StreamingServiceClient-universe-domain-snippet) +- [\c visionai_v1::StreamsServiceClient](@ref visionai_v1::StreamsServiceClient-universe-domain-snippet) +- [\c visionai_v1::WarehouseClient](@ref visionai_v1::WarehouseClient-universe-domain-snippet) + + + +*/ + +// + +/*! @page visionai_v1::AppPlatformClient-universe-domain-snippet Override visionai_v1::AppPlatformClient Universe Domain + +@snippet google/cloud/visionai/v1/samples/app_platform_client_samples.cc set-client-universe-domain + +*/ + +/*! @page visionai_v1::HealthCheckServiceClient-universe-domain-snippet Override visionai_v1::HealthCheckServiceClient Universe Domain + +@snippet google/cloud/visionai/v1/samples/health_check_client_samples.cc set-client-universe-domain + +*/ + +/*! @page visionai_v1::LiveVideoAnalyticsClient-universe-domain-snippet Override visionai_v1::LiveVideoAnalyticsClient Universe Domain + +@snippet google/cloud/visionai/v1/samples/live_video_analytics_client_samples.cc set-client-universe-domain + +*/ + +/*! @page visionai_v1::StreamingServiceClient-universe-domain-snippet Override visionai_v1::StreamingServiceClient Universe Domain + +@snippet google/cloud/visionai/v1/samples/streaming_client_samples.cc set-client-universe-domain + +*/ + +/*! @page visionai_v1::StreamsServiceClient-universe-domain-snippet Override visionai_v1::StreamsServiceClient Universe Domain + +@snippet google/cloud/visionai/v1/samples/streams_client_samples.cc set-client-universe-domain + +*/ + +/*! @page visionai_v1::WarehouseClient-universe-domain-snippet Override visionai_v1::WarehouseClient Universe Domain + +@snippet google/cloud/visionai/v1/samples/warehouse_client_samples.cc set-client-universe-domain + +*/ +// diff --git a/google/cloud/visionai/quickstart/.bazelrc b/google/cloud/visionai/quickstart/.bazelrc new file mode 100644 index 0000000000000..c884db46c2b4d --- /dev/null +++ b/google/cloud/visionai/quickstart/.bazelrc @@ -0,0 +1,30 @@ +# Copyright 2026 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/visionai/quickstart/BUILD.bazel b/google/cloud/visionai/quickstart/BUILD.bazel new file mode 100644 index 0000000000000..95ba9f5987422 --- /dev/null +++ b/google/cloud/visionai/quickstart/BUILD.bazel @@ -0,0 +1,25 @@ +# Copyright 2026 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//:visionai", + ], +) diff --git a/google/cloud/visionai/quickstart/CMakeLists.txt b/google/cloud/visionai/quickstart/CMakeLists.txt new file mode 100644 index 0000000000000..1ac56652f01fb --- /dev/null +++ b/google/cloud/visionai/quickstart/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright 2026 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 Vision AI API C++ client library from a larger +# CMake project. + +cmake_minimum_required(VERSION 3.22...3.31) +project(google-cloud-cpp-visionai-quickstart CXX) + +find_package(google_cloud_cpp_visionai 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::visionai) diff --git a/google/cloud/visionai/quickstart/Makefile b/google/cloud/visionai/quickstart/Makefile new file mode 100644 index 0000000000000..f7996d69a2061 --- /dev/null +++ b/google/cloud/visionai/quickstart/Makefile @@ -0,0 +1,35 @@ +# Copyright 2026 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 Vision AI 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 Vision AI API C++ +# client library. +CLIENT_MODULE := google_cloud_cpp_visionai +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/visionai/quickstart/README.md b/google/cloud/visionai/quickstart/README.md new file mode 100644 index 0000000000000..d7a63063b4f0b --- /dev/null +++ b/google/cloud/visionai/quickstart/README.md @@ -0,0 +1,135 @@ +# HOWTO: using the Vision AI API C++ client in your project + +This directory contains small examples showing how to use the Vision AI 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, Vision AI 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/visionai/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,visionai] + ``` + + 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/visionai/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/visionai/quickstart/WORKSPACE.bazel b/google/cloud/visionai/quickstart/WORKSPACE.bazel new file mode 100644 index 0000000000000..9f089ba2c2660 --- /dev/null +++ b/google/cloud/visionai/quickstart/WORKSPACE.bazel @@ -0,0 +1,53 @@ +# Copyright 2026 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 Vision AI 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 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.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/visionai/quickstart/quickstart.cc b/google/cloud/visionai/quickstart/quickstart.cc new file mode 100644 index 0000000000000..b5a420906a009 --- /dev/null +++ b/google/cloud/visionai/quickstart/quickstart.cc @@ -0,0 +1,42 @@ +// Copyright 2026 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/visionai/v1/app_platform_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 visionai = ::google::cloud::visionai_v1; + auto client = + visionai::AppPlatformClient(visionai::MakeAppPlatformConnection()); + + for (auto r : client.ListApplications(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/visionai/v1/.repo-metadata.json b/google/cloud/visionai/v1/.repo-metadata.json new file mode 100644 index 0000000000000..4e9c8627d30fa --- /dev/null +++ b/google/cloud/visionai/v1/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "api_id": "visionai.googleapis.com", + "api_shortname": "visionai", + "client_documentation": "https://cloud.google.com/cpp/docs/reference/visionai/latest", + "distribution_name": "google-cloud-cpp", + "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:187174%20status=open", + "language": "cpp", + "library_type": "GAPIC_AUTO", + "name_pretty": "Vision AI API", + "product_documentation": "https://cloud.google.com/vision-ai/docs", + "release_level": "stable", + "repo": "googleapis/google-cloud-cpp", + "requires_billing": true +} diff --git a/google/cloud/visionai/v1/app_platform_client.cc b/google/cloud/visionai/v1/app_platform_client.cc new file mode 100644 index 0000000000000..fcec22c42e7df --- /dev/null +++ b/google/cloud/visionai/v1/app_platform_client.cc @@ -0,0 +1,999 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#include "google/cloud/visionai/v1/app_platform_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AppPlatformClient::AppPlatformClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +AppPlatformClient::~AppPlatformClient() = default; + +StreamRange +AppPlatformClient::ListApplications(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListApplicationsRequest request; + request.set_parent(parent); + return connection_->ListApplications(request); +} + +StreamRange +AppPlatformClient::ListApplications( + google::cloud::visionai::v1::ListApplicationsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListApplications(std::move(request)); +} + +StatusOr +AppPlatformClient::GetApplication(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetApplicationRequest request; + request.set_name(name); + return connection_->GetApplication(request); +} + +StatusOr +AppPlatformClient::GetApplication( + google::cloud::visionai::v1::GetApplicationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetApplication(request); +} + +future> +AppPlatformClient::CreateApplication( + std::string const& parent, + google::cloud::visionai::v1::Application const& application, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateApplicationRequest request; + request.set_parent(parent); + *request.mutable_application() = application; + return connection_->CreateApplication(request); +} + +StatusOr AppPlatformClient::CreateApplication( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Application const& application, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateApplicationRequest request; + request.set_parent(parent); + *request.mutable_application() = application; + return connection_->CreateApplication(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::CreateApplication( + google::cloud::visionai::v1::CreateApplicationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateApplication(request); +} + +StatusOr AppPlatformClient::CreateApplication( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateApplication(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::CreateApplication( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateApplication(operation); +} + +future> +AppPlatformClient::UpdateApplication( + google::cloud::visionai::v1::Application const& application, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateApplicationRequest request; + *request.mutable_application() = application; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateApplication(request); +} + +StatusOr AppPlatformClient::UpdateApplication( + NoAwaitTag, google::cloud::visionai::v1::Application const& application, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateApplicationRequest request; + *request.mutable_application() = application; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateApplication(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::UpdateApplication( + google::cloud::visionai::v1::UpdateApplicationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateApplication(request); +} + +StatusOr AppPlatformClient::UpdateApplication( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateApplication(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::UpdateApplication( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateApplication(operation); +} + +future> +AppPlatformClient::DeleteApplication(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteApplicationRequest request; + request.set_name(name); + return connection_->DeleteApplication(request); +} + +StatusOr AppPlatformClient::DeleteApplication( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteApplicationRequest request; + request.set_name(name); + return connection_->DeleteApplication(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::DeleteApplication( + google::cloud::visionai::v1::DeleteApplicationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteApplication(request); +} + +StatusOr AppPlatformClient::DeleteApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteApplication(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::DeleteApplication( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteApplication(operation); +} + +future> +AppPlatformClient::DeployApplication(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeployApplicationRequest request; + request.set_name(name); + return connection_->DeployApplication(request); +} + +StatusOr AppPlatformClient::DeployApplication( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeployApplicationRequest request; + request.set_name(name); + return connection_->DeployApplication(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::DeployApplication( + google::cloud::visionai::v1::DeployApplicationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeployApplication(request); +} + +StatusOr AppPlatformClient::DeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeployApplicationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeployApplication(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::DeployApplication( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeployApplication(operation); +} + +future> +AppPlatformClient::UndeployApplication(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UndeployApplicationRequest request; + request.set_name(name); + return connection_->UndeployApplication(request); +} + +StatusOr AppPlatformClient::UndeployApplication( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UndeployApplicationRequest request; + request.set_name(name); + return connection_->UndeployApplication(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::UndeployApplication( + google::cloud::visionai::v1::UndeployApplicationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UndeployApplication(request); +} + +StatusOr AppPlatformClient::UndeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::UndeployApplicationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UndeployApplication(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::UndeployApplication( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UndeployApplication(operation); +} + +future> +AppPlatformClient::AddApplicationStreamInput(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::AddApplicationStreamInputRequest request; + request.set_name(name); + return connection_->AddApplicationStreamInput(request); +} + +StatusOr +AppPlatformClient::AddApplicationStreamInput(NoAwaitTag, + std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::AddApplicationStreamInputRequest request; + request.set_name(name); + return connection_->AddApplicationStreamInput(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::AddApplicationStreamInput( + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AddApplicationStreamInput(request); +} + +StatusOr +AppPlatformClient::AddApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AddApplicationStreamInput(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::AddApplicationStreamInput( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AddApplicationStreamInput(operation); +} + +future< + StatusOr> +AppPlatformClient::RemoveApplicationStreamInput(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest request; + request.set_name(name); + return connection_->RemoveApplicationStreamInput(request); +} + +StatusOr +AppPlatformClient::RemoveApplicationStreamInput(NoAwaitTag, + std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest request; + request.set_name(name); + return connection_->RemoveApplicationStreamInput(NoAwaitTag{}, request); +} + +future< + StatusOr> +AppPlatformClient::RemoveApplicationStreamInput( + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RemoveApplicationStreamInput(request); +} + +StatusOr +AppPlatformClient::RemoveApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RemoveApplicationStreamInput(NoAwaitTag{}, request); +} + +future< + StatusOr> +AppPlatformClient::RemoveApplicationStreamInput( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RemoveApplicationStreamInput(operation); +} + +future< + StatusOr> +AppPlatformClient::UpdateApplicationStreamInput(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest request; + request.set_name(name); + return connection_->UpdateApplicationStreamInput(request); +} + +StatusOr +AppPlatformClient::UpdateApplicationStreamInput(NoAwaitTag, + std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest request; + request.set_name(name); + return connection_->UpdateApplicationStreamInput(NoAwaitTag{}, request); +} + +future< + StatusOr> +AppPlatformClient::UpdateApplicationStreamInput( + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateApplicationStreamInput(request); +} + +StatusOr +AppPlatformClient::UpdateApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateApplicationStreamInput(NoAwaitTag{}, request); +} + +future< + StatusOr> +AppPlatformClient::UpdateApplicationStreamInput( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateApplicationStreamInput(operation); +} + +StreamRange +AppPlatformClient::ListInstances(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListInstancesRequest request; + request.set_parent(parent); + return connection_->ListInstances(request); +} + +StreamRange +AppPlatformClient::ListInstances( + google::cloud::visionai::v1::ListInstancesRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListInstances(std::move(request)); +} + +StatusOr AppPlatformClient::GetInstance( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetInstanceRequest request; + request.set_name(name); + return connection_->GetInstance(request); +} + +StatusOr AppPlatformClient::GetInstance( + google::cloud::visionai::v1::GetInstanceRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetInstance(request); +} + +future< + StatusOr> +AppPlatformClient::CreateApplicationInstances(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateApplicationInstancesRequest request; + request.set_name(name); + return connection_->CreateApplicationInstances(request); +} + +StatusOr +AppPlatformClient::CreateApplicationInstances(NoAwaitTag, + std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateApplicationInstancesRequest request; + request.set_name(name); + return connection_->CreateApplicationInstances(NoAwaitTag{}, request); +} + +future< + StatusOr> +AppPlatformClient::CreateApplicationInstances( + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateApplicationInstances(request); +} + +StatusOr +AppPlatformClient::CreateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateApplicationInstances(NoAwaitTag{}, request); +} + +future< + StatusOr> +AppPlatformClient::CreateApplicationInstances( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateApplicationInstances(operation); +} + +future> +AppPlatformClient::DeleteApplicationInstances(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteApplicationInstancesRequest request; + request.set_name(name); + return connection_->DeleteApplicationInstances(request); +} + +StatusOr +AppPlatformClient::DeleteApplicationInstances(NoAwaitTag, + std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteApplicationInstancesRequest request; + request.set_name(name); + return connection_->DeleteApplicationInstances(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::DeleteApplicationInstances( + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteApplicationInstances(request); +} + +StatusOr +AppPlatformClient::DeleteApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteApplicationInstances(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::DeleteApplicationInstances( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteApplicationInstances(operation); +} + +future< + StatusOr> +AppPlatformClient::UpdateApplicationInstances( + std::string const& name, + std::vector const& application_instances, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateApplicationInstancesRequest request; + request.set_name(name); + *request.mutable_application_instances() = {application_instances.begin(), + application_instances.end()}; + return connection_->UpdateApplicationInstances(request); +} + +StatusOr +AppPlatformClient::UpdateApplicationInstances( + NoAwaitTag, std::string const& name, + std::vector const& application_instances, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateApplicationInstancesRequest request; + request.set_name(name); + *request.mutable_application_instances() = {application_instances.begin(), + application_instances.end()}; + return connection_->UpdateApplicationInstances(NoAwaitTag{}, request); +} + +future< + StatusOr> +AppPlatformClient::UpdateApplicationInstances( + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateApplicationInstances(request); +} + +StatusOr +AppPlatformClient::UpdateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateApplicationInstances(NoAwaitTag{}, request); +} + +future< + StatusOr> +AppPlatformClient::UpdateApplicationInstances( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateApplicationInstances(operation); +} + +StreamRange AppPlatformClient::ListDrafts( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListDraftsRequest request; + request.set_parent(parent); + return connection_->ListDrafts(request); +} + +StreamRange AppPlatformClient::ListDrafts( + google::cloud::visionai::v1::ListDraftsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListDrafts(std::move(request)); +} + +StatusOr AppPlatformClient::GetDraft( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetDraftRequest request; + request.set_name(name); + return connection_->GetDraft(request); +} + +StatusOr AppPlatformClient::GetDraft( + google::cloud::visionai::v1::GetDraftRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetDraft(request); +} + +future> +AppPlatformClient::CreateDraft(std::string const& parent, + google::cloud::visionai::v1::Draft const& draft, + std::string const& draft_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateDraftRequest request; + request.set_parent(parent); + *request.mutable_draft() = draft; + request.set_draft_id(draft_id); + return connection_->CreateDraft(request); +} + +StatusOr AppPlatformClient::CreateDraft( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Draft const& draft, + std::string const& draft_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateDraftRequest request; + request.set_parent(parent); + *request.mutable_draft() = draft; + request.set_draft_id(draft_id); + return connection_->CreateDraft(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::CreateDraft( + google::cloud::visionai::v1::CreateDraftRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDraft(request); +} + +StatusOr AppPlatformClient::CreateDraft( + NoAwaitTag, google::cloud::visionai::v1::CreateDraftRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDraft(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::CreateDraft(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDraft(operation); +} + +future> +AppPlatformClient::UpdateDraft(google::cloud::visionai::v1::Draft const& draft, + google::protobuf::FieldMask const& update_mask, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateDraftRequest request; + *request.mutable_draft() = draft; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateDraft(request); +} + +StatusOr AppPlatformClient::UpdateDraft( + NoAwaitTag, google::cloud::visionai::v1::Draft const& draft, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateDraftRequest request; + *request.mutable_draft() = draft; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateDraft(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::UpdateDraft( + google::cloud::visionai::v1::UpdateDraftRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDraft(request); +} + +StatusOr AppPlatformClient::UpdateDraft( + NoAwaitTag, google::cloud::visionai::v1::UpdateDraftRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDraft(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::UpdateDraft(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDraft(operation); +} + +future> +AppPlatformClient::DeleteDraft(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteDraftRequest request; + request.set_name(name); + return connection_->DeleteDraft(request); +} + +StatusOr AppPlatformClient::DeleteDraft( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteDraftRequest request; + request.set_name(name); + return connection_->DeleteDraft(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::DeleteDraft( + google::cloud::visionai::v1::DeleteDraftRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDraft(request); +} + +StatusOr AppPlatformClient::DeleteDraft( + NoAwaitTag, google::cloud::visionai::v1::DeleteDraftRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDraft(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::DeleteDraft(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDraft(operation); +} + +StreamRange +AppPlatformClient::ListProcessors(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListProcessorsRequest request; + request.set_parent(parent); + return connection_->ListProcessors(request); +} + +StreamRange +AppPlatformClient::ListProcessors( + google::cloud::visionai::v1::ListProcessorsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListProcessors(std::move(request)); +} + +StatusOr +AppPlatformClient::ListPrebuiltProcessors(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest request; + request.set_parent(parent); + return connection_->ListPrebuiltProcessors(request); +} + +StatusOr +AppPlatformClient::ListPrebuiltProcessors( + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListPrebuiltProcessors(request); +} + +StatusOr +AppPlatformClient::GetProcessor(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetProcessorRequest request; + request.set_name(name); + return connection_->GetProcessor(request); +} + +StatusOr +AppPlatformClient::GetProcessor( + google::cloud::visionai::v1::GetProcessorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetProcessor(request); +} + +future> +AppPlatformClient::CreateProcessor( + std::string const& parent, + google::cloud::visionai::v1::Processor const& processor, + std::string const& processor_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateProcessorRequest request; + request.set_parent(parent); + *request.mutable_processor() = processor; + request.set_processor_id(processor_id); + return connection_->CreateProcessor(request); +} + +StatusOr AppPlatformClient::CreateProcessor( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Processor const& processor, + std::string const& processor_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateProcessorRequest request; + request.set_parent(parent); + *request.mutable_processor() = processor; + request.set_processor_id(processor_id); + return connection_->CreateProcessor(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::CreateProcessor( + google::cloud::visionai::v1::CreateProcessorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateProcessor(request); +} + +StatusOr AppPlatformClient::CreateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateProcessor(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::CreateProcessor( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateProcessor(operation); +} + +future> +AppPlatformClient::UpdateProcessor( + google::cloud::visionai::v1::Processor const& processor, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateProcessorRequest request; + *request.mutable_processor() = processor; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateProcessor(request); +} + +StatusOr AppPlatformClient::UpdateProcessor( + NoAwaitTag, google::cloud::visionai::v1::Processor const& processor, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateProcessorRequest request; + *request.mutable_processor() = processor; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateProcessor(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::UpdateProcessor( + google::cloud::visionai::v1::UpdateProcessorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateProcessor(request); +} + +StatusOr AppPlatformClient::UpdateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateProcessor(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::UpdateProcessor( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateProcessor(operation); +} + +future> +AppPlatformClient::DeleteProcessor(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteProcessorRequest request; + request.set_name(name); + return connection_->DeleteProcessor(request); +} + +StatusOr AppPlatformClient::DeleteProcessor( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteProcessorRequest request; + request.set_name(name); + return connection_->DeleteProcessor(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::DeleteProcessor( + google::cloud::visionai::v1::DeleteProcessorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteProcessor(request); +} + +StatusOr AppPlatformClient::DeleteProcessor( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteProcessor(NoAwaitTag{}, request); +} + +future> +AppPlatformClient::DeleteProcessor( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteProcessor(operation); +} + +StreamRange AppPlatformClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr AppPlatformClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange AppPlatformClient::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 AppPlatformClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr AppPlatformClient::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 AppPlatformClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status AppPlatformClient::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 AppPlatformClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status AppPlatformClient::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 AppPlatformClient::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 visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/app_platform_client.h b/google/cloud/visionai/v1/app_platform_client.h new file mode 100644 index 0000000000000..3d41dd77414e8 --- /dev/null +++ b/google/cloud/visionai/v1/app_platform_client.h @@ -0,0 +1,3062 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_APP_PLATFORM_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_APP_PLATFORM_CLIENT_H + +#include "google/cloud/visionai/v1/app_platform_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 "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// Service describing handlers for resources +/// +/// @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 AppPlatformClient { + public: + explicit AppPlatformClient(std::shared_ptr connection, + Options opts = {}); + ~AppPlatformClient(); + + ///@{ + /// @name Copy and move support + AppPlatformClient(AppPlatformClient const&) = default; + AppPlatformClient& operator=(AppPlatformClient const&) = default; + AppPlatformClient(AppPlatformClient&&) = default; + AppPlatformClient& operator=(AppPlatformClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(AppPlatformClient const& a, + AppPlatformClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(AppPlatformClient const& a, + AppPlatformClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Lists Applications in a given project and location. + /// + /// @param parent Required. Parent value for ListApplicationsRequest. + /// @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.visionai.v1.Application], 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.visionai.v1.Application]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1249} + /// [google.cloud.visionai.v1.ListApplicationsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L553} + /// + // clang-format on + StreamRange ListApplications( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Applications 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.visionai.v1.ListApplicationsRequest]. + /// 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.visionai.v1.Application], 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.visionai.v1.Application]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1249} + /// [google.cloud.visionai.v1.ListApplicationsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L553} + /// + // clang-format on + StreamRange ListApplications( + google::cloud::visionai::v1::ListApplicationsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Application. + /// + /// @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.visionai.v1.Application]) + /// 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.visionai.v1.Application]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1249} + /// [google.cloud.visionai.v1.GetApplicationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L589} + /// + // clang-format on + StatusOr GetApplication( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Application. + /// + /// @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.visionai.v1.GetApplicationRequest]. + /// 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.visionai.v1.Application]) + /// 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.visionai.v1.Application]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1249} + /// [google.cloud.visionai.v1.GetApplicationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L589} + /// + // clang-format on + StatusOr GetApplication( + google::cloud::visionai::v1::GetApplicationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Application in a given project and location. + /// + /// @param parent Required. Value for parent. + /// @param application Required. The resource being created. + /// @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.visionai.v1.Application] 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.visionai.v1.Application]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1249} + /// [google.cloud.visionai.v1.CreateApplicationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L600} + /// + // clang-format on + future> CreateApplication( + std::string const& parent, + google::cloud::visionai::v1::Application const& application, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateApplication + /// + /// 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 CreateApplication( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Application const& application, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Application 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.visionai.v1.CreateApplicationRequest]. + /// 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.visionai.v1.Application] 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.visionai.v1.Application]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1249} + /// [google.cloud.visionai.v1.CreateApplicationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L600} + /// + // clang-format on + future> CreateApplication( + google::cloud::visionai::v1::CreateApplicationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateApplication + /// + /// 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 CreateApplication( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateApplication + /// + /// 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> CreateApplication( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Application. + /// + /// @param application Required. The resource being updated. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// Application 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.visionai.v1.Application] 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.visionai.v1.Application]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1249} + /// [google.cloud.visionai.v1.UpdateApplicationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L632} + /// + // clang-format on + future> UpdateApplication( + google::cloud::visionai::v1::Application const& application, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateApplication + /// + /// 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 UpdateApplication( + NoAwaitTag, google::cloud::visionai::v1::Application const& application, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Application. + /// + /// @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.visionai.v1.UpdateApplicationRequest]. + /// 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.visionai.v1.Application] 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.visionai.v1.Application]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1249} + /// [google.cloud.visionai.v1.UpdateApplicationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L632} + /// + // clang-format on + future> UpdateApplication( + google::cloud::visionai::v1::UpdateApplicationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateApplication + /// + /// 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 UpdateApplication( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateApplication + /// + /// 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> UpdateApplication( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Application. + /// + /// @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.visionai.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.visionai.v1.DeleteApplicationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L661} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> + DeleteApplication(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteApplication + /// + /// 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 DeleteApplication( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Application. + /// + /// @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.visionai.v1.DeleteApplicationRequest]. + /// 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.visionai.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.visionai.v1.DeleteApplicationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L661} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> + DeleteApplication( + google::cloud::visionai::v1::DeleteApplicationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteApplication + /// + /// 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 DeleteApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteApplication + /// + /// 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> + DeleteApplication(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deploys a single Application. + /// + /// @param name Required. the name of the application to retrieve. + /// Format: + /// "projects/{project}/locations/{location}/applications/{application}" + /// @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.visionai.v1.DeployApplicationResponse] 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.visionai.v1.DeployApplicationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L692} + /// [google.cloud.visionai.v1.DeployApplicationResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L538} + /// + // clang-format on + future> + DeployApplication(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeployApplication + /// + /// 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 DeployApplication( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deploys a single Application. + /// + /// @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.visionai.v1.DeployApplicationRequest]. + /// 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.visionai.v1.DeployApplicationResponse] 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.visionai.v1.DeployApplicationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L692} + /// [google.cloud.visionai.v1.DeployApplicationResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L538} + /// + // clang-format on + future> + DeployApplication( + google::cloud::visionai::v1::DeployApplicationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeployApplication + /// + /// 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 DeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeployApplicationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeployApplication + /// + /// 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> + DeployApplication(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Undeploys a single Application. + /// + /// @param name Required. the name of the application to retrieve. + /// Format: + /// "projects/{project}/locations/{location}/applications/{application}" + /// @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.visionai.v1.UndeployApplicationResponse] 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.visionai.v1.UndeployApplicationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L728} + /// [google.cloud.visionai.v1.UndeployApplicationResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L541} + /// + // clang-format on + future> + UndeployApplication(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief UndeployApplication + /// + /// 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 UndeployApplication( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Undeploys a single Application. + /// + /// @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.visionai.v1.UndeployApplicationRequest]. + /// 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.visionai.v1.UndeployApplicationResponse] 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.visionai.v1.UndeployApplicationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L728} + /// [google.cloud.visionai.v1.UndeployApplicationResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L541} + /// + // clang-format on + future> + UndeployApplication( + google::cloud::visionai::v1::UndeployApplicationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UndeployApplication + /// + /// 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 UndeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::UndeployApplicationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UndeployApplication + /// + /// 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> + UndeployApplication(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Adds target stream input to the Application. + /// If the Application is deployed, the corresponding new Application instance + /// will be created. If the stream has already been in the Application, the RPC + /// will fail. + /// + /// @param name Required. the name of the application to retrieve. + /// Format: + /// "projects/{project}/locations/{location}/applications/{application}" + /// @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.visionai.v1.AddApplicationStreamInputResponse] 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.visionai.v1.AddApplicationStreamInputRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L761} + /// [google.cloud.visionai.v1.AddApplicationStreamInputResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L547} + /// + // clang-format on + future< + StatusOr> + AddApplicationStreamInput(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief AddApplicationStreamInput + /// + /// 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 AddApplicationStreamInput( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Adds target stream input to the Application. + /// If the Application is deployed, the corresponding new Application instance + /// will be created. If the stream has already been in the Application, the RPC + /// will fail. + /// + /// @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.visionai.v1.AddApplicationStreamInputRequest]. + /// 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.visionai.v1.AddApplicationStreamInputResponse] 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.visionai.v1.AddApplicationStreamInputRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L761} + /// [google.cloud.visionai.v1.AddApplicationStreamInputResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L547} + /// + // clang-format on + future< + StatusOr> + AddApplicationStreamInput( + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief AddApplicationStreamInput + /// + /// 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 AddApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief AddApplicationStreamInput + /// + /// 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< + StatusOr> + AddApplicationStreamInput(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Remove target stream input to the Application, if the Application is + /// deployed, the corresponding instance based will be deleted. If the stream + /// is not in the Application, the RPC will fail. + /// + /// @param name Required. the name of the application to retrieve. + /// Format: + /// "projects/{project}/locations/{location}/applications/{application}" + /// @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.visionai.v1.RemoveApplicationStreamInputResponse] 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.visionai.v1.RemoveApplicationStreamInputRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L829} + /// [google.cloud.visionai.v1.RemoveApplicationStreamInputResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L544} + /// + // clang-format on + future> + RemoveApplicationStreamInput(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief RemoveApplicationStreamInput + /// + /// 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 RemoveApplicationStreamInput( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Remove target stream input to the Application, if the Application is + /// deployed, the corresponding instance based will be deleted. If the stream + /// is not in the Application, the RPC will fail. + /// + /// @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.visionai.v1.RemoveApplicationStreamInputRequest]. + /// 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.visionai.v1.RemoveApplicationStreamInputResponse] 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.visionai.v1.RemoveApplicationStreamInputRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L829} + /// [google.cloud.visionai.v1.RemoveApplicationStreamInputResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L544} + /// + // clang-format on + future> + RemoveApplicationStreamInput( + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief RemoveApplicationStreamInput + /// + /// 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 RemoveApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief RemoveApplicationStreamInput + /// + /// 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> + RemoveApplicationStreamInput(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Update target stream input to the Application, if the Application is + /// deployed, the corresponding instance based will be deployed. For + /// CreateOrUpdate behavior, set allow_missing to true. + /// + /// @param name Required. the name of the application to retrieve. + /// Format: + /// "projects/{project}/locations/{location}/applications/{application}" + /// @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.visionai.v1.UpdateApplicationStreamInputResponse] 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.visionai.v1.UpdateApplicationStreamInputRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L793} + /// [google.cloud.visionai.v1.UpdateApplicationStreamInputResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L550} + /// + // clang-format on + future> + UpdateApplicationStreamInput(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateApplicationStreamInput + /// + /// 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 UpdateApplicationStreamInput( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Update target stream input to the Application, if the Application is + /// deployed, the corresponding instance based will be deployed. For + /// CreateOrUpdate behavior, set allow_missing to true. + /// + /// @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.visionai.v1.UpdateApplicationStreamInputRequest]. + /// 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.visionai.v1.UpdateApplicationStreamInputResponse] 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.visionai.v1.UpdateApplicationStreamInputRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L793} + /// [google.cloud.visionai.v1.UpdateApplicationStreamInputResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L550} + /// + // clang-format on + future> + UpdateApplicationStreamInput( + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateApplicationStreamInput + /// + /// 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 UpdateApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateApplicationStreamInput + /// + /// 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> + UpdateApplicationStreamInput(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists Instances in a given project and location. + /// + /// @param parent Required. Parent value for ListInstancesRequest. + /// @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.visionai.v1.Instance], 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.visionai.v1.Instance]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1488} + /// [google.cloud.visionai.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L867} + /// + // clang-format on + StreamRange ListInstances( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Instances 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.visionai.v1.ListInstancesRequest]. + /// 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.visionai.v1.Instance], 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.visionai.v1.Instance]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1488} + /// [google.cloud.visionai.v1.ListInstancesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L867} + /// + // clang-format on + StreamRange ListInstances( + google::cloud::visionai::v1::ListInstancesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Instance. + /// + /// @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.visionai.v1.Instance]) + /// 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.visionai.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L903} + /// [google.cloud.visionai.v1.Instance]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1488} + /// + // clang-format on + StatusOr GetInstance( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Instance. + /// + /// @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.visionai.v1.GetInstanceRequest]. + /// 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.visionai.v1.Instance]) + /// 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.visionai.v1.GetInstanceRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L903} + /// [google.cloud.visionai.v1.Instance]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1488} + /// + // clang-format on + StatusOr GetInstance( + google::cloud::visionai::v1::GetInstanceRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Adds target stream input to the Application. + /// If the Application is deployed, the corresponding new Application instance + /// will be created. If the stream has already been in the Application, the RPC + /// will fail. + /// + /// @param name Required. the name of the application to retrieve. + /// Format: + /// "projects/{project}/locations/{location}/applications/{application}" + /// @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.visionai.v1.CreateApplicationInstancesResponse] 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.visionai.v1.CreateApplicationInstancesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L469} + /// [google.cloud.visionai.v1.CreateApplicationInstancesResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L463} + /// + // clang-format on + future< + StatusOr> + CreateApplicationInstances(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateApplicationInstances + /// + /// 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 CreateApplicationInstances( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Adds target stream input to the Application. + /// If the Application is deployed, the corresponding new Application instance + /// will be created. If the stream has already been in the Application, the RPC + /// will fail. + /// + /// @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.visionai.v1.CreateApplicationInstancesRequest]. + /// 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.visionai.v1.CreateApplicationInstancesResponse] 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.visionai.v1.CreateApplicationInstancesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L469} + /// [google.cloud.visionai.v1.CreateApplicationInstancesResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L463} + /// + // clang-format on + future< + StatusOr> + CreateApplicationInstances( + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateApplicationInstances + /// + /// 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 CreateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateApplicationInstances + /// + /// 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< + StatusOr> + CreateApplicationInstances(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Remove target stream input to the Application, if the Application is + /// deployed, the corresponding instance based will be deleted. If the stream + /// is not in the Application, the RPC will fail. + /// + /// @param name Required. the name of the application to retrieve. + /// Format: + /// "projects/{project}/locations/{location}/applications/{application}" + /// @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.visionai.v1.Instance] 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.visionai.v1.DeleteApplicationInstancesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L501} + /// [google.cloud.visionai.v1.Instance]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1488} + /// + // clang-format on + future> + DeleteApplicationInstances(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteApplicationInstances + /// + /// 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 DeleteApplicationInstances( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Remove target stream input to the Application, if the Application is + /// deployed, the corresponding instance based will be deleted. If the stream + /// is not in the Application, the RPC will fail. + /// + /// @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.visionai.v1.DeleteApplicationInstancesRequest]. + /// 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.visionai.v1.Instance] 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.visionai.v1.DeleteApplicationInstancesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L501} + /// [google.cloud.visionai.v1.Instance]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1488} + /// + // clang-format on + future> + DeleteApplicationInstances( + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteApplicationInstances + /// + /// 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 DeleteApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteApplicationInstances + /// + /// 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> + DeleteApplicationInstances(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Adds target stream input to the Application. + /// If the Application is deployed, the corresponding new Application instance + /// will be created. If the stream has already been in the Application, the RPC + /// will fail. + /// + /// @param name Required. the name of the application to retrieve. + /// Format: + /// "projects/{project}/locations/{location}/applications/{application}" + /// @param application_instances + /// @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.visionai.v1.UpdateApplicationInstancesResponse] 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.visionai.v1.UpdateApplicationInstancesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1024} + /// [google.cloud.visionai.v1.UpdateApplicationInstancesResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L466} + /// + // clang-format on + future< + StatusOr> + UpdateApplicationInstances( + std::string const& name, + std::vector< + google::cloud::visionai::v1::UpdateApplicationInstancesRequest:: + UpdateApplicationInstance> const& application_instances, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateApplicationInstances + /// + /// 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 UpdateApplicationInstances( + NoAwaitTag, std::string const& name, + std::vector< + google::cloud::visionai::v1::UpdateApplicationInstancesRequest:: + UpdateApplicationInstance> const& application_instances, + Options opts = {}); + + // clang-format off + /// + /// Adds target stream input to the Application. + /// If the Application is deployed, the corresponding new Application instance + /// will be created. If the stream has already been in the Application, the RPC + /// will fail. + /// + /// @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.visionai.v1.UpdateApplicationInstancesRequest]. + /// 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.visionai.v1.UpdateApplicationInstancesResponse] 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.visionai.v1.UpdateApplicationInstancesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1024} + /// [google.cloud.visionai.v1.UpdateApplicationInstancesResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L466} + /// + // clang-format on + future< + StatusOr> + UpdateApplicationInstances( + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateApplicationInstances + /// + /// 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 UpdateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateApplicationInstances + /// + /// 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< + StatusOr> + UpdateApplicationInstances(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists Drafts in a given project and location. + /// + /// @param parent Required. Parent value for ListDraftsRequest. + /// @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.visionai.v1.Draft], 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.visionai.v1.Draft]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1455} + /// [google.cloud.visionai.v1.ListDraftsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L914} + /// + // clang-format on + StreamRange ListDrafts( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Drafts 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.visionai.v1.ListDraftsRequest]. + /// 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.visionai.v1.Draft], 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.visionai.v1.Draft]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1455} + /// [google.cloud.visionai.v1.ListDraftsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L914} + /// + // clang-format on + StreamRange ListDrafts( + google::cloud::visionai::v1::ListDraftsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Draft. + /// + /// @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.visionai.v1.Draft]) + /// 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.visionai.v1.Draft]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1455} + /// [google.cloud.visionai.v1.GetDraftRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L950} + /// + // clang-format on + StatusOr GetDraft(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Draft. + /// + /// @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.visionai.v1.GetDraftRequest]. + /// 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.visionai.v1.Draft]) + /// 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.visionai.v1.Draft]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1455} + /// [google.cloud.visionai.v1.GetDraftRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L950} + /// + // clang-format on + StatusOr GetDraft( + google::cloud::visionai::v1::GetDraftRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Draft in a given project and location. + /// + /// @param parent Required. Value for parent. + /// @param draft Required. The resource being created. + /// @param draft_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.visionai.v1.Draft] 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.visionai.v1.CreateDraftRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L959} + /// [google.cloud.visionai.v1.Draft]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1455} + /// + // clang-format on + future> CreateDraft( + std::string const& parent, + google::cloud::visionai::v1::Draft const& draft, + std::string const& draft_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateDraft + /// + /// 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 CreateDraft( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Draft const& draft, + std::string const& draft_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Draft 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.visionai.v1.CreateDraftRequest]. + /// 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.visionai.v1.Draft] 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.visionai.v1.CreateDraftRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L959} + /// [google.cloud.visionai.v1.Draft]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1455} + /// + // clang-format on + future> CreateDraft( + google::cloud::visionai::v1::CreateDraftRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateDraft + /// + /// 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 CreateDraft( + NoAwaitTag, + google::cloud::visionai::v1::CreateDraftRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateDraft + /// + /// 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> CreateDraft( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Draft. + /// + /// @param draft Required. The resource being updated. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// Draft 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.visionai.v1.Draft] 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.visionai.v1.Draft]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1455} + /// [google.cloud.visionai.v1.UpdateDraftRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L991} + /// + // clang-format on + future> UpdateDraft( + google::cloud::visionai::v1::Draft const& draft, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateDraft + /// + /// 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 UpdateDraft( + NoAwaitTag, google::cloud::visionai::v1::Draft const& draft, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Draft. + /// + /// @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.visionai.v1.UpdateDraftRequest]. + /// 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.visionai.v1.Draft] 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.visionai.v1.Draft]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1455} + /// [google.cloud.visionai.v1.UpdateDraftRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L991} + /// + // clang-format on + future> UpdateDraft( + google::cloud::visionai::v1::UpdateDraftRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateDraft + /// + /// 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 UpdateDraft( + NoAwaitTag, + google::cloud::visionai::v1::UpdateDraftRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateDraft + /// + /// 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> UpdateDraft( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Draft. + /// + /// @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.visionai.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.visionai.v1.DeleteDraftRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1074} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> DeleteDraft( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteDraft + /// + /// 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 DeleteDraft(NoAwaitTag, + std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single Draft. + /// + /// @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.visionai.v1.DeleteDraftRequest]. + /// 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.visionai.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.visionai.v1.DeleteDraftRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1074} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> DeleteDraft( + google::cloud::visionai::v1::DeleteDraftRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteDraft + /// + /// 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 DeleteDraft( + NoAwaitTag, + google::cloud::visionai::v1::DeleteDraftRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteDraft + /// + /// 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> DeleteDraft( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Lists Processors in a given project and location. + /// + /// @param parent Required. Parent value for ListProcessorsRequest. + /// @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.visionai.v1.Processor], 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.visionai.v1.ListProcessorsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1098} + /// [google.cloud.visionai.v1.Processor]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1659} + /// + // clang-format on + StreamRange ListProcessors( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Processors 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.visionai.v1.ListProcessorsRequest]. + /// 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.visionai.v1.Processor], 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.visionai.v1.ListProcessorsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1098} + /// [google.cloud.visionai.v1.Processor]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1659} + /// + // clang-format on + StreamRange ListProcessors( + google::cloud::visionai::v1::ListProcessorsRequest request, + Options opts = {}); + + // clang-format off + /// + /// ListPrebuiltProcessors is a custom pass-through verb that Lists Prebuilt + /// Processors. + /// + /// @param parent Required. Parent path. + /// @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.visionai.v1.ListPrebuiltProcessorsResponse]) + /// 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.visionai.v1.ListPrebuiltProcessorsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1134} + /// [google.cloud.visionai.v1.ListPrebuiltProcessorsResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1145} + /// + // clang-format on + StatusOr + ListPrebuiltProcessors(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// ListPrebuiltProcessors is a custom pass-through verb that Lists Prebuilt + /// Processors. + /// + /// @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.visionai.v1.ListPrebuiltProcessorsRequest]. + /// 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.visionai.v1.ListPrebuiltProcessorsResponse]) + /// 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.visionai.v1.ListPrebuiltProcessorsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1134} + /// [google.cloud.visionai.v1.ListPrebuiltProcessorsResponse]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1145} + /// + // clang-format on + StatusOr + ListPrebuiltProcessors( + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Processor. + /// + /// @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.visionai.v1.Processor]) + /// 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.visionai.v1.GetProcessorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1151} + /// [google.cloud.visionai.v1.Processor]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1659} + /// + // clang-format on + StatusOr GetProcessor( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Processor. + /// + /// @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.visionai.v1.GetProcessorRequest]. + /// 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.visionai.v1.Processor]) + /// 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.visionai.v1.GetProcessorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1151} + /// [google.cloud.visionai.v1.Processor]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1659} + /// + // clang-format on + StatusOr GetProcessor( + google::cloud::visionai::v1::GetProcessorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Processor in a given project and location. + /// + /// @param parent Required. Value for parent. + /// @param processor Required. The resource being created. + /// @param processor_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.visionai.v1.Processor] 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.visionai.v1.CreateProcessorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1162} + /// [google.cloud.visionai.v1.Processor]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1659} + /// + // clang-format on + future> CreateProcessor( + std::string const& parent, + google::cloud::visionai::v1::Processor const& processor, + std::string const& processor_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateProcessor + /// + /// 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 CreateProcessor( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Processor const& processor, + std::string const& processor_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Processor 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.visionai.v1.CreateProcessorRequest]. + /// 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.visionai.v1.Processor] 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.visionai.v1.CreateProcessorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1162} + /// [google.cloud.visionai.v1.Processor]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1659} + /// + // clang-format on + future> CreateProcessor( + google::cloud::visionai::v1::CreateProcessorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateProcessor + /// + /// 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 CreateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateProcessor + /// + /// 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> CreateProcessor( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Processor. + /// + /// @param processor Required. The resource being updated. + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// Processor 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.visionai.v1.Processor] 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.visionai.v1.Processor]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1659} + /// [google.cloud.visionai.v1.UpdateProcessorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1194} + /// + // clang-format on + future> UpdateProcessor( + google::cloud::visionai::v1::Processor const& processor, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateProcessor + /// + /// 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 UpdateProcessor( + NoAwaitTag, google::cloud::visionai::v1::Processor const& processor, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Processor. + /// + /// @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.visionai.v1.UpdateProcessorRequest]. + /// 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.visionai.v1.Processor] 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.visionai.v1.Processor]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1659} + /// [google.cloud.visionai.v1.UpdateProcessorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1194} + /// + // clang-format on + future> UpdateProcessor( + google::cloud::visionai::v1::UpdateProcessorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateProcessor + /// + /// 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 UpdateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateProcessor + /// + /// 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> UpdateProcessor( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Processor. + /// + /// @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.visionai.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.visionai.v1.DeleteProcessorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1223} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> + DeleteProcessor(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteProcessor + /// + /// 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 DeleteProcessor( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Processor. + /// + /// @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.visionai.v1.DeleteProcessorRequest]. + /// 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.visionai.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.visionai.v1.DeleteProcessorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/platform.proto#L1223} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> + DeleteProcessor( + google::cloud::visionai::v1::DeleteProcessorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteProcessor + /// + /// 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 DeleteProcessor( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteProcessor + /// + /// 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> + DeleteProcessor(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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_APP_PLATFORM_CLIENT_H diff --git a/google/cloud/visionai/v1/app_platform_connection.cc b/google/cloud/visionai/v1/app_platform_connection.cc new file mode 100644 index 0000000000000..c353287da9b21 --- /dev/null +++ b/google/cloud/visionai/v1/app_platform_connection.cc @@ -0,0 +1,551 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#include "google/cloud/visionai/v1/app_platform_connection.h" +#include "google/cloud/visionai/v1/app_platform_options.h" +#include "google/cloud/visionai/v1/internal/app_platform_connection_impl.h" +#include "google/cloud/visionai/v1/internal/app_platform_option_defaults.h" +#include "google/cloud/visionai/v1/internal/app_platform_stub_factory.h" +#include "google/cloud/visionai/v1/internal/app_platform_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 visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AppPlatformConnection::~AppPlatformConnection() = default; + +StreamRange +AppPlatformConnection::ListApplications( + google::cloud::visionai::v1:: + ListApplicationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +AppPlatformConnection::GetApplication( + google::cloud::visionai::v1::GetApplicationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +AppPlatformConnection::CreateApplication( + google::cloud::visionai::v1::CreateApplicationRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AppPlatformConnection::CreateApplication( + NoAwaitTag, google::cloud::visionai::v1::CreateApplicationRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::CreateApplication( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::UpdateApplication( + google::cloud::visionai::v1::UpdateApplicationRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AppPlatformConnection::UpdateApplication( + NoAwaitTag, google::cloud::visionai::v1::UpdateApplicationRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::UpdateApplication( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::DeleteApplication( + google::cloud::visionai::v1::DeleteApplicationRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AppPlatformConnection::DeleteApplication( + NoAwaitTag, google::cloud::visionai::v1::DeleteApplicationRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::DeleteApplication( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::DeployApplication( + google::cloud::visionai::v1::DeployApplicationRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AppPlatformConnection::DeployApplication( + NoAwaitTag, google::cloud::visionai::v1::DeployApplicationRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::DeployApplication( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::UndeployApplication( + google::cloud::visionai::v1::UndeployApplicationRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AppPlatformConnection::UndeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::UndeployApplicationRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::UndeployApplication( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::AddApplicationStreamInput( + google::cloud::visionai::v1::AddApplicationStreamInputRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AppPlatformConnection::AddApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::AddApplicationStreamInput( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future< + StatusOr> +AppPlatformConnection::RemoveApplicationStreamInput( + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AppPlatformConnection::RemoveApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future< + StatusOr> +AppPlatformConnection::RemoveApplicationStreamInput( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future< + StatusOr> +AppPlatformConnection::UpdateApplicationStreamInput( + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AppPlatformConnection::UpdateApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future< + StatusOr> +AppPlatformConnection::UpdateApplicationStreamInput( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +AppPlatformConnection::ListInstances( + google::cloud::visionai::v1:: + ListInstancesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +AppPlatformConnection::GetInstance( + google::cloud::visionai::v1::GetInstanceRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future< + StatusOr> +AppPlatformConnection::CreateApplicationInstances( + google::cloud::visionai::v1::CreateApplicationInstancesRequest const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AppPlatformConnection::CreateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future< + StatusOr> +AppPlatformConnection::CreateApplicationInstances( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::DeleteApplicationInstances( + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AppPlatformConnection::DeleteApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::DeleteApplicationInstances( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future< + StatusOr> +AppPlatformConnection::UpdateApplicationInstances( + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +AppPlatformConnection::UpdateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future< + StatusOr> +AppPlatformConnection::UpdateApplicationInstances( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +AppPlatformConnection::ListDrafts( + google::cloud::visionai::v1:: + ListDraftsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr AppPlatformConnection::GetDraft( + google::cloud::visionai::v1::GetDraftRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +AppPlatformConnection::CreateDraft( + google::cloud::visionai::v1::CreateDraftRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AppPlatformConnection::CreateDraft( + NoAwaitTag, google::cloud::visionai::v1::CreateDraftRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::CreateDraft(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::UpdateDraft( + google::cloud::visionai::v1::UpdateDraftRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AppPlatformConnection::UpdateDraft( + NoAwaitTag, google::cloud::visionai::v1::UpdateDraftRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::UpdateDraft(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::DeleteDraft( + google::cloud::visionai::v1::DeleteDraftRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AppPlatformConnection::DeleteDraft( + NoAwaitTag, google::cloud::visionai::v1::DeleteDraftRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::DeleteDraft(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +AppPlatformConnection::ListProcessors( + google::cloud::visionai::v1:: + ListProcessorsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +AppPlatformConnection::ListPrebuiltProcessors( + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +AppPlatformConnection::GetProcessor( + google::cloud::visionai::v1::GetProcessorRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +AppPlatformConnection::CreateProcessor( + google::cloud::visionai::v1::CreateProcessorRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AppPlatformConnection::CreateProcessor( + NoAwaitTag, google::cloud::visionai::v1::CreateProcessorRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::CreateProcessor(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::UpdateProcessor( + google::cloud::visionai::v1::UpdateProcessorRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AppPlatformConnection::UpdateProcessor( + NoAwaitTag, google::cloud::visionai::v1::UpdateProcessorRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::UpdateProcessor(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::DeleteProcessor( + google::cloud::visionai::v1::DeleteProcessorRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr AppPlatformConnection::DeleteProcessor( + NoAwaitTag, google::cloud::visionai::v1::DeleteProcessorRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +AppPlatformConnection::DeleteProcessor(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +AppPlatformConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr AppPlatformConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +AppPlatformConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr AppPlatformConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AppPlatformConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status AppPlatformConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeAppPlatformConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = visionai_v1_internal::AppPlatformDefaultOptions(std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = visionai_v1_internal::CreateDefaultAppPlatformStub( + std::move(auth), options); + return visionai_v1_internal::MakeAppPlatformTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/app_platform_connection.h b/google/cloud/visionai/v1/app_platform_connection.h new file mode 100644 index 0000000000000..a40cb32cdd532 --- /dev/null +++ b/google/cloud/visionai/v1/app_platform_connection.h @@ -0,0 +1,476 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_APP_PLATFORM_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_APP_PLATFORM_CONNECTION_H + +#include "google/cloud/visionai/v1/app_platform_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/internal/app_platform_retry_traits.h" +#include "google/cloud/visionai/v1/platform.pb.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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `AppPlatformConnection`. +class AppPlatformRetryPolicy : 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 `AppPlatformConnection` 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 AppPlatformLimitedErrorCountRetryPolicy : public AppPlatformRetryPolicy { + 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 AppPlatformLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + AppPlatformLimitedErrorCountRetryPolicy( + AppPlatformLimitedErrorCountRetryPolicy&& rhs) noexcept + : AppPlatformLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + AppPlatformLimitedErrorCountRetryPolicy( + AppPlatformLimitedErrorCountRetryPolicy const& rhs) noexcept + : AppPlatformLimitedErrorCountRetryPolicy(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 = AppPlatformRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + visionai_v1_internal::AppPlatformRetryTraits> + impl_; +}; + +/** + * A retry policy for `AppPlatformConnection` 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 AppPlatformLimitedTimeRetryPolicy : public AppPlatformRetryPolicy { + 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 AppPlatformLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + AppPlatformLimitedTimeRetryPolicy( + AppPlatformLimitedTimeRetryPolicy&& rhs) noexcept + : AppPlatformLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + AppPlatformLimitedTimeRetryPolicy( + AppPlatformLimitedTimeRetryPolicy const& rhs) noexcept + : AppPlatformLimitedTimeRetryPolicy(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 = AppPlatformRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + visionai_v1_internal::AppPlatformRetryTraits> + impl_; +}; + +/** + * The `AppPlatformConnection` object for `AppPlatformClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `AppPlatformClient`. This allows users to inject custom behavior + * (e.g., with a Google Mock object) when writing tests that use objects of type + * `AppPlatformClient`. + * + * To create a concrete instance, see `MakeAppPlatformConnection()`. + * + * For mocking, see `visionai_v1_mocks::MockAppPlatformConnection`. + */ +class AppPlatformConnection { + public: + virtual ~AppPlatformConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StreamRange + ListApplications( + google::cloud::visionai::v1::ListApplicationsRequest request); + + virtual StatusOr GetApplication( + google::cloud::visionai::v1::GetApplicationRequest const& request); + + virtual future> + CreateApplication( + google::cloud::visionai::v1::CreateApplicationRequest const& request); + + virtual StatusOr CreateApplication( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationRequest const& request); + + virtual future> + CreateApplication(google::longrunning::Operation const& operation); + + virtual future> + UpdateApplication( + google::cloud::visionai::v1::UpdateApplicationRequest const& request); + + virtual StatusOr UpdateApplication( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationRequest const& request); + + virtual future> + UpdateApplication(google::longrunning::Operation const& operation); + + virtual future> + DeleteApplication( + google::cloud::visionai::v1::DeleteApplicationRequest const& request); + + virtual StatusOr DeleteApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationRequest const& request); + + virtual future> + DeleteApplication(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeployApplication( + google::cloud::visionai::v1::DeployApplicationRequest const& request); + + virtual StatusOr DeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeployApplicationRequest const& request); + + virtual future< + StatusOr> + DeployApplication(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + UndeployApplication( + google::cloud::visionai::v1::UndeployApplicationRequest const& request); + + virtual StatusOr UndeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::UndeployApplicationRequest const& request); + + virtual future< + StatusOr> + UndeployApplication(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + AddApplicationStreamInput( + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request); + + virtual StatusOr AddApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request); + + virtual future< + StatusOr> + AddApplicationStreamInput(google::longrunning::Operation const& operation); + + virtual future> + RemoveApplicationStreamInput( + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request); + + virtual StatusOr RemoveApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request); + + virtual future> + RemoveApplicationStreamInput(google::longrunning::Operation const& operation); + + virtual future> + UpdateApplicationStreamInput( + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request); + + virtual StatusOr UpdateApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request); + + virtual future> + UpdateApplicationStreamInput(google::longrunning::Operation const& operation); + + virtual StreamRange ListInstances( + google::cloud::visionai::v1::ListInstancesRequest request); + + virtual StatusOr GetInstance( + google::cloud::visionai::v1::GetInstanceRequest const& request); + + virtual future< + StatusOr> + CreateApplicationInstances( + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request); + + virtual StatusOr CreateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request); + + virtual future< + StatusOr> + CreateApplicationInstances(google::longrunning::Operation const& operation); + + virtual future> + DeleteApplicationInstances( + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request); + + virtual StatusOr DeleteApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request); + + virtual future> + DeleteApplicationInstances(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + UpdateApplicationInstances( + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request); + + virtual StatusOr UpdateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request); + + virtual future< + StatusOr> + UpdateApplicationInstances(google::longrunning::Operation const& operation); + + virtual StreamRange ListDrafts( + google::cloud::visionai::v1::ListDraftsRequest request); + + virtual StatusOr GetDraft( + google::cloud::visionai::v1::GetDraftRequest const& request); + + virtual future> CreateDraft( + google::cloud::visionai::v1::CreateDraftRequest const& request); + + virtual StatusOr CreateDraft( + NoAwaitTag, + google::cloud::visionai::v1::CreateDraftRequest const& request); + + virtual future> CreateDraft( + google::longrunning::Operation const& operation); + + virtual future> UpdateDraft( + google::cloud::visionai::v1::UpdateDraftRequest const& request); + + virtual StatusOr UpdateDraft( + NoAwaitTag, + google::cloud::visionai::v1::UpdateDraftRequest const& request); + + virtual future> UpdateDraft( + google::longrunning::Operation const& operation); + + virtual future> + DeleteDraft(google::cloud::visionai::v1::DeleteDraftRequest const& request); + + virtual StatusOr DeleteDraft( + NoAwaitTag, + google::cloud::visionai::v1::DeleteDraftRequest const& request); + + virtual future> + DeleteDraft(google::longrunning::Operation const& operation); + + virtual StreamRange ListProcessors( + google::cloud::visionai::v1::ListProcessorsRequest request); + + virtual StatusOr + ListPrebuiltProcessors( + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& + request); + + virtual StatusOr GetProcessor( + google::cloud::visionai::v1::GetProcessorRequest const& request); + + virtual future> + CreateProcessor( + google::cloud::visionai::v1::CreateProcessorRequest const& request); + + virtual StatusOr CreateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessorRequest const& request); + + virtual future> + CreateProcessor(google::longrunning::Operation const& operation); + + virtual future> + UpdateProcessor( + google::cloud::visionai::v1::UpdateProcessorRequest const& request); + + virtual StatusOr UpdateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessorRequest const& request); + + virtual future> + UpdateProcessor(google::longrunning::Operation const& operation); + + virtual future> + DeleteProcessor( + google::cloud::visionai::v1::DeleteProcessorRequest const& request); + + virtual StatusOr DeleteProcessor( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessorRequest const& request); + + virtual future> + DeleteProcessor(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 `AppPlatformConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of AppPlatformClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `AppPlatformConnection`. Expected options are any of the types in + * the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::visionai_v1::AppPlatformPolicyOptionList` + * + * @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 `AppPlatformConnection` created by + * this function. + */ +std::shared_ptr MakeAppPlatformConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_APP_PLATFORM_CONNECTION_H diff --git a/google/cloud/visionai/v1/app_platform_connection_idempotency_policy.cc b/google/cloud/visionai/v1/app_platform_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..27417224b9c62 --- /dev/null +++ b/google/cloud/visionai/v1/app_platform_connection_idempotency_policy.cc @@ -0,0 +1,207 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#include "google/cloud/visionai/v1/app_platform_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +AppPlatformConnectionIdempotencyPolicy:: + ~AppPlatformConnectionIdempotencyPolicy() = default; + +std::unique_ptr +AppPlatformConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::ListApplications( + google::cloud::visionai::v1::ListApplicationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::GetApplication( + google::cloud::visionai::v1::GetApplicationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::CreateApplication( + google::cloud::visionai::v1::CreateApplicationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::UpdateApplication( + google::cloud::visionai::v1::UpdateApplicationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::DeleteApplication( + google::cloud::visionai::v1::DeleteApplicationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::DeployApplication( + google::cloud::visionai::v1::DeployApplicationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::UndeployApplication( + google::cloud::visionai::v1::UndeployApplicationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::AddApplicationStreamInput( + google::cloud::visionai::v1::AddApplicationStreamInputRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +AppPlatformConnectionIdempotencyPolicy::RemoveApplicationStreamInput( + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency +AppPlatformConnectionIdempotencyPolicy::UpdateApplicationStreamInput( + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::ListInstances( + google::cloud::visionai::v1::ListInstancesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::GetInstance( + google::cloud::visionai::v1::GetInstanceRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::CreateApplicationInstances( + google::cloud::visionai::v1::CreateApplicationInstancesRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::DeleteApplicationInstances( + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::UpdateApplicationInstances( + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::ListDrafts( + google::cloud::visionai::v1::ListDraftsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::GetDraft( + google::cloud::visionai::v1::GetDraftRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::CreateDraft( + google::cloud::visionai::v1::CreateDraftRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::UpdateDraft( + google::cloud::visionai::v1::UpdateDraftRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::DeleteDraft( + google::cloud::visionai::v1::DeleteDraftRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::ListProcessors( + google::cloud::visionai::v1::ListProcessorsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::ListPrebuiltProcessors( + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::GetProcessor( + google::cloud::visionai::v1::GetProcessorRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::CreateProcessor( + google::cloud::visionai::v1::CreateProcessorRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::UpdateProcessor( + google::cloud::visionai::v1::UpdateProcessorRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::DeleteProcessor( + google::cloud::visionai::v1::DeleteProcessorRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency AppPlatformConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultAppPlatformConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/app_platform_connection_idempotency_policy.h b/google/cloud/visionai/v1/app_platform_connection_idempotency_policy.h new file mode 100644 index 0000000000000..4aecf287096b4 --- /dev/null +++ b/google/cloud/visionai/v1/app_platform_connection_idempotency_policy.h @@ -0,0 +1,153 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_APP_PLATFORM_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_APP_PLATFORM_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/platform.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AppPlatformConnectionIdempotencyPolicy { + public: + virtual ~AppPlatformConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() const; + + virtual google::cloud::Idempotency ListApplications( + google::cloud::visionai::v1::ListApplicationsRequest request); + + virtual google::cloud::Idempotency GetApplication( + google::cloud::visionai::v1::GetApplicationRequest const& request); + + virtual google::cloud::Idempotency CreateApplication( + google::cloud::visionai::v1::CreateApplicationRequest const& request); + + virtual google::cloud::Idempotency UpdateApplication( + google::cloud::visionai::v1::UpdateApplicationRequest const& request); + + virtual google::cloud::Idempotency DeleteApplication( + google::cloud::visionai::v1::DeleteApplicationRequest const& request); + + virtual google::cloud::Idempotency DeployApplication( + google::cloud::visionai::v1::DeployApplicationRequest const& request); + + virtual google::cloud::Idempotency UndeployApplication( + google::cloud::visionai::v1::UndeployApplicationRequest const& request); + + virtual google::cloud::Idempotency AddApplicationStreamInput( + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request); + + virtual google::cloud::Idempotency RemoveApplicationStreamInput( + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request); + + virtual google::cloud::Idempotency UpdateApplicationStreamInput( + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request); + + virtual google::cloud::Idempotency ListInstances( + google::cloud::visionai::v1::ListInstancesRequest request); + + virtual google::cloud::Idempotency GetInstance( + google::cloud::visionai::v1::GetInstanceRequest const& request); + + virtual google::cloud::Idempotency CreateApplicationInstances( + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request); + + virtual google::cloud::Idempotency DeleteApplicationInstances( + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request); + + virtual google::cloud::Idempotency UpdateApplicationInstances( + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request); + + virtual google::cloud::Idempotency ListDrafts( + google::cloud::visionai::v1::ListDraftsRequest request); + + virtual google::cloud::Idempotency GetDraft( + google::cloud::visionai::v1::GetDraftRequest const& request); + + virtual google::cloud::Idempotency CreateDraft( + google::cloud::visionai::v1::CreateDraftRequest const& request); + + virtual google::cloud::Idempotency UpdateDraft( + google::cloud::visionai::v1::UpdateDraftRequest const& request); + + virtual google::cloud::Idempotency DeleteDraft( + google::cloud::visionai::v1::DeleteDraftRequest const& request); + + virtual google::cloud::Idempotency ListProcessors( + google::cloud::visionai::v1::ListProcessorsRequest request); + + virtual google::cloud::Idempotency ListPrebuiltProcessors( + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& + request); + + virtual google::cloud::Idempotency GetProcessor( + google::cloud::visionai::v1::GetProcessorRequest const& request); + + virtual google::cloud::Idempotency CreateProcessor( + google::cloud::visionai::v1::CreateProcessorRequest const& request); + + virtual google::cloud::Idempotency UpdateProcessor( + google::cloud::visionai::v1::UpdateProcessorRequest const& request); + + virtual google::cloud::Idempotency DeleteProcessor( + google::cloud::visionai::v1::DeleteProcessorRequest 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 +MakeDefaultAppPlatformConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_APP_PLATFORM_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/visionai/v1/app_platform_options.h b/google/cloud/visionai/v1/app_platform_options.h new file mode 100644 index 0000000000000..83061faa420e1 --- /dev/null +++ b/google/cloud/visionai/v1/app_platform_options.h @@ -0,0 +1,86 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_APP_PLATFORM_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_APP_PLATFORM_OPTIONS_H + +#include "google/cloud/visionai/v1/app_platform_connection.h" +#include "google/cloud/visionai/v1/app_platform_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 visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-visionai-options + */ +struct AppPlatformRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-visionai-options + */ +struct AppPlatformBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-visionai-options + */ +struct AppPlatformConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-visionai-options + */ +struct AppPlatformPollingPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to AppPlatform. + * + * @ingroup google-cloud-visionai-options + */ +using AppPlatformPolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_APP_PLATFORM_OPTIONS_H diff --git a/google/cloud/visionai/v1/health_check_client.cc b/google/cloud/visionai/v1/health_check_client.cc new file mode 100644 index 0000000000000..c6282369fd9e0 --- /dev/null +++ b/google/cloud/visionai/v1/health_check_client.cc @@ -0,0 +1,120 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#include "google/cloud/visionai/v1/health_check_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HealthCheckServiceClient::HealthCheckServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +HealthCheckServiceClient::~HealthCheckServiceClient() = default; + +StatusOr +HealthCheckServiceClient::HealthCheck( + google::cloud::visionai::v1::HealthCheckRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->HealthCheck(request); +} + +StreamRange +HealthCheckServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr +HealthCheckServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange +HealthCheckServiceClient::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 +HealthCheckServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr HealthCheckServiceClient::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 HealthCheckServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status HealthCheckServiceClient::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 HealthCheckServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status HealthCheckServiceClient::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 HealthCheckServiceClient::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 visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/health_check_client.h b/google/cloud/visionai/v1/health_check_client.h new file mode 100644 index 0000000000000..23b624cc9d7eb --- /dev/null +++ b/google/cloud/visionai/v1/health_check_client.h @@ -0,0 +1,469 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_HEALTH_CHECK_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_HEALTH_CHECK_CLIENT_H + +#include "google/cloud/visionai/v1/health_check_connection.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/version.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// HealthCheckService provides an interface for Vertex AI Vision Cluster Health +/// Check. +/// +/// @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 HealthCheckServiceClient { + public: + explicit HealthCheckServiceClient( + std::shared_ptr connection, + Options opts = {}); + ~HealthCheckServiceClient(); + + ///@{ + /// @name Copy and move support + HealthCheckServiceClient(HealthCheckServiceClient const&) = default; + HealthCheckServiceClient& operator=(HealthCheckServiceClient const&) = + default; + HealthCheckServiceClient(HealthCheckServiceClient&&) = default; + HealthCheckServiceClient& operator=(HealthCheckServiceClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(HealthCheckServiceClient const& a, + HealthCheckServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(HealthCheckServiceClient const& a, + HealthCheckServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// HealthCheck method checks the health status of the cluster. + /// + /// @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.visionai.v1.HealthCheckRequest]. + /// 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.visionai.v1.HealthCheckResponse]) + /// 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.visionai.v1.HealthCheckRequest]: @googleapis_reference_link{google/cloud/visionai/v1/health_service.proto#L47} + /// [google.cloud.visionai.v1.HealthCheckResponse]: @googleapis_reference_link{google/cloud/visionai/v1/health_service.proto#L55} + /// + // clang-format on + StatusOr HealthCheck( + google::cloud::visionai::v1::HealthCheckRequest const& request, + 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_HEALTH_CHECK_CLIENT_H diff --git a/google/cloud/visionai/v1/health_check_connection.cc b/google/cloud/visionai/v1/health_check_connection.cc new file mode 100644 index 0000000000000..4a3d927a29b2e --- /dev/null +++ b/google/cloud/visionai/v1/health_check_connection.cc @@ -0,0 +1,105 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#include "google/cloud/visionai/v1/health_check_connection.h" +#include "google/cloud/visionai/v1/health_check_options.h" +#include "google/cloud/visionai/v1/internal/health_check_connection_impl.h" +#include "google/cloud/visionai/v1/internal/health_check_option_defaults.h" +#include "google/cloud/visionai/v1/internal/health_check_stub_factory.h" +#include "google/cloud/visionai/v1/internal/health_check_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 visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HealthCheckServiceConnection::~HealthCheckServiceConnection() = default; + +StatusOr +HealthCheckServiceConnection::HealthCheck( + google::cloud::visionai::v1::HealthCheckRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +HealthCheckServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +HealthCheckServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +HealthCheckServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +HealthCheckServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status HealthCheckServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status HealthCheckServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeHealthCheckServiceConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = visionai_v1_internal::HealthCheckServiceDefaultOptions( + std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = visionai_v1_internal::CreateDefaultHealthCheckServiceStub( + std::move(auth), options); + return visionai_v1_internal::MakeHealthCheckServiceTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/health_check_connection.h b/google/cloud/visionai/v1/health_check_connection.h new file mode 100644 index 0000000000000..e8be8ed1e37dd --- /dev/null +++ b/google/cloud/visionai/v1/health_check_connection.h @@ -0,0 +1,241 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_HEALTH_CHECK_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_HEALTH_CHECK_CONNECTION_H + +#include "google/cloud/visionai/v1/health_check_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/health_service.pb.h" +#include "google/cloud/visionai/v1/internal/health_check_retry_traits.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/internal/retry_policy_impl.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `HealthCheckServiceConnection`. +class HealthCheckServiceRetryPolicy : 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 `HealthCheckServiceConnection` 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 HealthCheckServiceLimitedErrorCountRetryPolicy + : public HealthCheckServiceRetryPolicy { + 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 HealthCheckServiceLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + HealthCheckServiceLimitedErrorCountRetryPolicy( + HealthCheckServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : HealthCheckServiceLimitedErrorCountRetryPolicy(rhs.maximum_failures()) { + } + HealthCheckServiceLimitedErrorCountRetryPolicy( + HealthCheckServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : HealthCheckServiceLimitedErrorCountRetryPolicy(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 = HealthCheckServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + visionai_v1_internal::HealthCheckServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `HealthCheckServiceConnection` 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 HealthCheckServiceLimitedTimeRetryPolicy + : public HealthCheckServiceRetryPolicy { + 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 HealthCheckServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + HealthCheckServiceLimitedTimeRetryPolicy( + HealthCheckServiceLimitedTimeRetryPolicy&& rhs) noexcept + : HealthCheckServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + HealthCheckServiceLimitedTimeRetryPolicy( + HealthCheckServiceLimitedTimeRetryPolicy const& rhs) noexcept + : HealthCheckServiceLimitedTimeRetryPolicy(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 = HealthCheckServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + visionai_v1_internal::HealthCheckServiceRetryTraits> + impl_; +}; + +/** + * The `HealthCheckServiceConnection` object for `HealthCheckServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `HealthCheckServiceClient`. This allows users to inject custom + * behavior (e.g., with a Google Mock object) when writing tests that use + * objects of type `HealthCheckServiceClient`. + * + * To create a concrete instance, see `MakeHealthCheckServiceConnection()`. + * + * For mocking, see `visionai_v1_mocks::MockHealthCheckServiceConnection`. + */ +class HealthCheckServiceConnection { + public: + virtual ~HealthCheckServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StatusOr + HealthCheck(google::cloud::visionai::v1::HealthCheckRequest const& request); + + 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 + * `HealthCheckServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of + * HealthCheckServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `HealthCheckServiceConnection`. Expected options are any of the + * types in the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::visionai_v1::HealthCheckServicePolicyOptionList` + * + * @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 `HealthCheckServiceConnection` + * created by this function. + */ +std::shared_ptr MakeHealthCheckServiceConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_HEALTH_CHECK_CONNECTION_H diff --git a/google/cloud/visionai/v1/health_check_connection_idempotency_policy.cc b/google/cloud/visionai/v1/health_check_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..8060c2ae69757 --- /dev/null +++ b/google/cloud/visionai/v1/health_check_connection_idempotency_policy.cc @@ -0,0 +1,80 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#include "google/cloud/visionai/v1/health_check_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +HealthCheckServiceConnectionIdempotencyPolicy:: + ~HealthCheckServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +HealthCheckServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency HealthCheckServiceConnectionIdempotencyPolicy::HealthCheck( + google::cloud::visionai::v1::HealthCheckRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency HealthCheckServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency HealthCheckServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency HealthCheckServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency HealthCheckServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency HealthCheckServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency HealthCheckServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultHealthCheckServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/health_check_connection_idempotency_policy.h b/google/cloud/visionai/v1/health_check_connection_idempotency_policy.h new file mode 100644 index 0000000000000..f964726465e67 --- /dev/null +++ b/google/cloud/visionai/v1/health_check_connection_idempotency_policy.h @@ -0,0 +1,72 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_HEALTH_CHECK_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_HEALTH_CHECK_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/health_service.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HealthCheckServiceConnectionIdempotencyPolicy { + public: + virtual ~HealthCheckServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() + const; + + virtual google::cloud::Idempotency HealthCheck( + google::cloud::visionai::v1::HealthCheckRequest 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 +MakeDefaultHealthCheckServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_HEALTH_CHECK_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/visionai/v1/health_check_options.h b/google/cloud/visionai/v1/health_check_options.h new file mode 100644 index 0000000000000..47967615df327 --- /dev/null +++ b/google/cloud/visionai/v1/health_check_options.h @@ -0,0 +1,76 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_HEALTH_CHECK_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_HEALTH_CHECK_OPTIONS_H + +#include "google/cloud/visionai/v1/health_check_connection.h" +#include "google/cloud/visionai/v1/health_check_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 visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-visionai-options + */ +struct HealthCheckServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-visionai-options + */ +struct HealthCheckServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-visionai-options + */ +struct HealthCheckServiceConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to HealthCheckService. + * + * @ingroup google-cloud-visionai-options + */ +using HealthCheckServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_HEALTH_CHECK_OPTIONS_H diff --git a/google/cloud/visionai/v1/internal/app_platform_auth_decorator.cc b/google/cloud/visionai/v1/internal/app_platform_auth_decorator.cc new file mode 100644 index 0000000000000..15c451a361517 --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_auth_decorator.cc @@ -0,0 +1,700 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#include "google/cloud/visionai/v1/internal/app_platform_auth_decorator.h" +#include "google/cloud/visionai/v1/platform.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AppPlatformAuth::AppPlatformAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +AppPlatformAuth::ListApplications( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListApplicationsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListApplications(context, options, request); +} + +StatusOr +AppPlatformAuth::GetApplication( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetApplicationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetApplication(context, options, request); +} + +future> +AppPlatformAuth::AsyncCreateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationRequest 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->AsyncCreateApplication(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AppPlatformAuth::CreateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateApplication(context, options, request); +} + +future> +AppPlatformAuth::AsyncUpdateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationRequest 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->AsyncUpdateApplication(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AppPlatformAuth::UpdateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateApplication(context, options, request); +} + +future> +AppPlatformAuth::AsyncDeleteApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationRequest 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->AsyncDeleteApplication(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AppPlatformAuth::DeleteApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteApplication(context, options, request); +} + +future> +AppPlatformAuth::AsyncDeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployApplicationRequest 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->AsyncDeployApplication(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AppPlatformAuth::DeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeployApplication(context, options, request); +} + +future> +AppPlatformAuth::AsyncUndeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployApplicationRequest 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->AsyncUndeployApplication(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AppPlatformAuth::UndeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UndeployApplication(context, options, request); +} + +future> +AppPlatformAuth::AsyncAddApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest 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->AsyncAddApplicationStreamInput( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +AppPlatformAuth::AddApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->AddApplicationStreamInput(context, options, request); +} + +future> +AppPlatformAuth::AsyncRemoveApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest 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->AsyncRemoveApplicationStreamInput( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +AppPlatformAuth::RemoveApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->RemoveApplicationStreamInput(context, options, request); +} + +future> +AppPlatformAuth::AsyncUpdateApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest 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->AsyncUpdateApplicationStreamInput( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +AppPlatformAuth::UpdateApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateApplicationStreamInput(context, options, request); +} + +StatusOr +AppPlatformAuth::ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListInstancesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListInstances(context, options, request); +} + +StatusOr AppPlatformAuth::GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetInstanceRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetInstance(context, options, request); +} + +future> +AppPlatformAuth::AsyncCreateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest 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->AsyncCreateApplicationInstances( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +AppPlatformAuth::CreateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateApplicationInstances(context, options, request); +} + +future> +AppPlatformAuth::AsyncDeleteApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest 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->AsyncDeleteApplicationInstances( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +AppPlatformAuth::DeleteApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteApplicationInstances(context, options, request); +} + +future> +AppPlatformAuth::AsyncUpdateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest 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->AsyncUpdateApplicationInstances( + cq, *std::move(context), std::move(options), request); + }); +} + +StatusOr +AppPlatformAuth::UpdateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateApplicationInstances(context, options, request); +} + +StatusOr +AppPlatformAuth::ListDrafts( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDraftsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListDrafts(context, options, request); +} + +StatusOr AppPlatformAuth::GetDraft( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDraftRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetDraft(context, options, request); +} + +future> +AppPlatformAuth::AsyncCreateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateDraftRequest 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->AsyncCreateDraft(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AppPlatformAuth::CreateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateDraft(context, options, request); +} + +future> +AppPlatformAuth::AsyncUpdateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateDraftRequest 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->AsyncUpdateDraft(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AppPlatformAuth::UpdateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateDraft(context, options, request); +} + +future> +AppPlatformAuth::AsyncDeleteDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteDraftRequest 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->AsyncDeleteDraft(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AppPlatformAuth::DeleteDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteDraft(context, options, request); +} + +StatusOr +AppPlatformAuth::ListProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessorsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListProcessors(context, options, request); +} + +StatusOr +AppPlatformAuth::ListPrebuiltProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListPrebuiltProcessors(context, options, request); +} + +StatusOr AppPlatformAuth::GetProcessor( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessorRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetProcessor(context, options, request); +} + +future> +AppPlatformAuth::AsyncCreateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessorRequest 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->AsyncCreateProcessor(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AppPlatformAuth::CreateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateProcessor(context, options, request); +} + +future> +AppPlatformAuth::AsyncUpdateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessorRequest 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->AsyncUpdateProcessor(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AppPlatformAuth::UpdateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateProcessor(context, options, request); +} + +future> +AppPlatformAuth::AsyncDeleteProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessorRequest 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->AsyncDeleteProcessor(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr AppPlatformAuth::DeleteProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteProcessor(context, options, request); +} + +StatusOr +AppPlatformAuth::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 AppPlatformAuth::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 +AppPlatformAuth::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 AppPlatformAuth::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 AppPlatformAuth::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 AppPlatformAuth::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> +AppPlatformAuth::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 AppPlatformAuth::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/app_platform_auth_decorator.h b/google/cloud/visionai/v1/internal/app_platform_auth_decorator.h new file mode 100644 index 0000000000000..18ec2120fb7bf --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_auth_decorator.h @@ -0,0 +1,339 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_AUTH_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/app_platform_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AppPlatformAuth : public AppPlatformStub { + public: + ~AppPlatformAuth() override = default; + AppPlatformAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr + ListApplications(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListApplicationsRequest const& + request) override; + + StatusOr GetApplication( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetApplicationRequest const& request) + override; + + future> AsyncCreateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + StatusOr CreateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + future> AsyncUpdateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + StatusOr UpdateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + future> AsyncDeleteApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) + override; + + StatusOr DeleteApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) + override; + + future> AsyncDeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) + override; + + StatusOr DeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) + override; + + future> AsyncUndeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + StatusOr UndeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + future> + AsyncAddApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + StatusOr AddApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + future> + AsyncRemoveApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + StatusOr RemoveApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + future> + AsyncUpdateApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + StatusOr UpdateApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + StatusOr ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListInstancesRequest const& request) + override; + + StatusOr GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetInstanceRequest const& request) override; + + future> + AsyncCreateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + StatusOr CreateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + future> + AsyncDeleteApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + StatusOr DeleteApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + future> + AsyncUpdateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + StatusOr UpdateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + StatusOr ListDrafts( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDraftsRequest const& request) override; + + StatusOr GetDraft( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDraftRequest const& request) override; + + future> AsyncCreateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + StatusOr CreateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + future> AsyncUpdateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + StatusOr UpdateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + future> AsyncDeleteDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + StatusOr DeleteDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + StatusOr ListProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessorsRequest const& request) + override; + + StatusOr + ListPrebuiltProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) + override; + + StatusOr GetProcessor( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessorRequest const& request) override; + + future> AsyncCreateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + StatusOr CreateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + future> AsyncUpdateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + StatusOr UpdateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + future> AsyncDeleteProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) + override; + + StatusOr DeleteProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessorRequest 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_AUTH_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/app_platform_connection_impl.cc b/google/cloud/visionai/v1/internal/app_platform_connection_impl.cc new file mode 100644 index 0000000000000..d0be1ec7e08ae --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_connection_impl.cc @@ -0,0 +1,1985 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#include "google/cloud/visionai/v1/internal/app_platform_connection_impl.h" +#include "google/cloud/visionai/v1/internal/app_platform_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 visionai_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 + +AppPlatformConnectionImpl::AppPlatformConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions(std::move(options), + AppPlatformConnection::options())) {} + +StreamRange +AppPlatformConnectionImpl::ListApplications( + google::cloud::visionai::v1::ListApplicationsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListApplications(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::visionai::v1::ListApplicationsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListApplicationsRequest const& + request) { + return stub->ListApplications(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListApplicationsResponse r) { + std::vector result( + r.applications().size()); + auto& messages = *r.mutable_applications(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AppPlatformConnectionImpl::GetApplication( + google::cloud::visionai::v1::GetApplicationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetApplication(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetApplicationRequest const& request) { + return stub_->GetApplication(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::CreateApplication( + google::cloud::visionai::v1::CreateApplicationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateApplication(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Application>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationRequest const& + request) { + return stub->AsyncCreateApplication(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::visionai::v1::Application>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::CreateApplication( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateApplication(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateApplicationRequest const& + request) { + return stub_->CreateApplication(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::CreateApplication( + 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 CreateApplication", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Application>( + 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::visionai::v1::Application>, + polling_policy(*current), __func__); +} + +future> +AppPlatformConnectionImpl::UpdateApplication( + google::cloud::visionai::v1::UpdateApplicationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateApplication(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Application>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationRequest const& + request) { + return stub->AsyncUpdateApplication(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::visionai::v1::Application>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::UpdateApplication( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateApplication(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateApplicationRequest const& + request) { + return stub_->UpdateApplication(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::UpdateApplication( + 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 UpdateApplication", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Application>( + 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::visionai::v1::Application>, + polling_policy(*current), __func__); +} + +future> +AppPlatformConnectionImpl::DeleteApplication( + google::cloud::visionai::v1::DeleteApplicationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteApplication(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::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::visionai::v1::DeleteApplicationRequest const& + request) { + return stub->AsyncDeleteApplication(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::visionai::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::DeleteApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteApplication(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteApplicationRequest const& + request) { + return stub_->DeleteApplication(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::DeleteApplication( + 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 DeleteApplication", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::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::visionai::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +future> +AppPlatformConnectionImpl::DeployApplication( + google::cloud::visionai::v1::DeployApplicationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeployApplication(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::DeployApplicationResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployApplicationRequest const& + request) { + return stub->AsyncDeployApplication(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::visionai::v1::DeployApplicationResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::DeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeployApplicationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeployApplication(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeployApplicationRequest const& + request) { + return stub_->DeployApplication(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::DeployApplication( + 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 DeployApplication", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::DeployApplicationResponse>( + 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::visionai::v1::DeployApplicationResponse>, + polling_policy(*current), __func__); +} + +future> +AppPlatformConnectionImpl::UndeployApplication( + google::cloud::visionai::v1::UndeployApplicationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UndeployApplication(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::UndeployApplicationResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployApplicationRequest const& + request) { + return stub->AsyncUndeployApplication(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::visionai::v1::UndeployApplicationResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::UndeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UndeployApplication(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UndeployApplicationRequest const& + request) { + return stub_->UndeployApplication(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::UndeployApplication( + 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 UndeployApplication", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::UndeployApplicationResponse>( + 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::visionai::v1::UndeployApplicationResponse>, + polling_policy(*current), __func__); +} + +future> +AppPlatformConnectionImpl::AddApplicationStreamInput( + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->AddApplicationStreamInput(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::AddApplicationStreamInputResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + return stub->AsyncAddApplicationStreamInput( + 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::visionai::v1::AddApplicationStreamInputResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::AddApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->AddApplicationStreamInput(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + return stub_->AddApplicationStreamInput(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::AddApplicationStreamInput( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to AddApplicationStreamInput", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::AddApplicationStreamInputResponse>( + 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::visionai::v1::AddApplicationStreamInputResponse>, + polling_policy(*current), __func__); +} + +future< + StatusOr> +AppPlatformConnectionImpl::RemoveApplicationStreamInput( + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->RemoveApplicationStreamInput(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::RemoveApplicationStreamInputResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1:: + RemoveApplicationStreamInputRequest const& request) { + return stub->AsyncRemoveApplicationStreamInput( + 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::visionai::v1::RemoveApplicationStreamInputResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::RemoveApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->RemoveApplicationStreamInput(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1:: + RemoveApplicationStreamInputRequest const& request) { + return stub_->RemoveApplicationStreamInput(context, options, request); + }, + *current, request, __func__); +} + +future< + StatusOr> +AppPlatformConnectionImpl::RemoveApplicationStreamInput( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to RemoveApplicationStreamInput", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::RemoveApplicationStreamInputResponse>( + 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::visionai::v1::RemoveApplicationStreamInputResponse>, + polling_policy(*current), __func__); +} + +future< + StatusOr> +AppPlatformConnectionImpl::UpdateApplicationStreamInput( + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateApplicationStreamInput(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::UpdateApplicationStreamInputResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1:: + UpdateApplicationStreamInputRequest const& request) { + return stub->AsyncUpdateApplicationStreamInput( + 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::visionai::v1::UpdateApplicationStreamInputResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::UpdateApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateApplicationStreamInput(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1:: + UpdateApplicationStreamInputRequest const& request) { + return stub_->UpdateApplicationStreamInput(context, options, request); + }, + *current, request, __func__); +} + +future< + StatusOr> +AppPlatformConnectionImpl::UpdateApplicationStreamInput( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateApplicationStreamInput", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::UpdateApplicationStreamInputResponse>( + 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::visionai::v1::UpdateApplicationStreamInputResponse>, + polling_policy(*current), __func__); +} + +StreamRange +AppPlatformConnectionImpl::ListInstances( + google::cloud::visionai::v1::ListInstancesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListInstances(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::visionai::v1::ListInstancesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListInstancesRequest const& + request) { + return stub->ListInstances(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListInstancesResponse r) { + std::vector result( + r.instances().size()); + auto& messages = *r.mutable_instances(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AppPlatformConnectionImpl::GetInstance( + google::cloud::visionai::v1::GetInstanceRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetInstance(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetInstanceRequest const& request) { + return stub_->GetInstance(context, options, request); + }, + *current, request, __func__); +} + +future< + StatusOr> +AppPlatformConnectionImpl::CreateApplicationInstances( + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateApplicationInstances(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::CreateApplicationInstancesResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + return stub->AsyncCreateApplicationInstances( + 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::visionai::v1::CreateApplicationInstancesResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::CreateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateApplicationInstances(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + return stub_->CreateApplicationInstances(context, options, request); + }, + *current, request, __func__); +} + +future< + StatusOr> +AppPlatformConnectionImpl::CreateApplicationInstances( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateApplicationInstances", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::CreateApplicationInstancesResponse>( + 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::visionai::v1::CreateApplicationInstancesResponse>, + polling_policy(*current), __func__); +} + +future> +AppPlatformConnectionImpl::DeleteApplicationInstances( + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteApplicationInstances(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Instance>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + return stub->AsyncDeleteApplicationInstances( + 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::visionai::v1::Instance>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::DeleteApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteApplicationInstances(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + return stub_->DeleteApplicationInstances(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::DeleteApplicationInstances( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to DeleteApplicationInstances", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Instance>( + 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::visionai::v1::Instance>, + polling_policy(*current), __func__); +} + +future< + StatusOr> +AppPlatformConnectionImpl::UpdateApplicationInstances( + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateApplicationInstances(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::UpdateApplicationInstancesResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + return stub->AsyncUpdateApplicationInstances( + 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::visionai::v1::UpdateApplicationInstancesResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::UpdateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateApplicationInstances(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + return stub_->UpdateApplicationInstances(context, options, request); + }, + *current, request, __func__); +} + +future< + StatusOr> +AppPlatformConnectionImpl::UpdateApplicationInstances( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateApplicationInstances", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::UpdateApplicationInstancesResponse>( + 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::visionai::v1::UpdateApplicationInstancesResponse>, + polling_policy(*current), __func__); +} + +StreamRange +AppPlatformConnectionImpl::ListDrafts( + google::cloud::visionai::v1::ListDraftsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListDrafts(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::visionai::v1::ListDraftsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDraftsRequest const& request) { + return stub->ListDrafts(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListDraftsResponse r) { + std::vector result( + r.drafts().size()); + auto& messages = *r.mutable_drafts(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AppPlatformConnectionImpl::GetDraft( + google::cloud::visionai::v1::GetDraftRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetDraft(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDraftRequest const& request) { + return stub_->GetDraft(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::CreateDraft( + google::cloud::visionai::v1::CreateDraftRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateDraft(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Draft>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + return stub->AsyncCreateDraft(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::visionai::v1::Draft>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AppPlatformConnectionImpl::CreateDraft( + NoAwaitTag, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateDraft(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + return stub_->CreateDraft(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::CreateDraft( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateDraft", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Draft>( + 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::visionai::v1::Draft>, + polling_policy(*current), __func__); +} + +future> +AppPlatformConnectionImpl::UpdateDraft( + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateDraft(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Draft>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + return stub->AsyncUpdateDraft(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::visionai::v1::Draft>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AppPlatformConnectionImpl::UpdateDraft( + NoAwaitTag, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateDraft(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + return stub_->UpdateDraft(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::UpdateDraft( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateDraft", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Draft>( + 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::visionai::v1::Draft>, + polling_policy(*current), __func__); +} + +future> +AppPlatformConnectionImpl::DeleteDraft( + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteDraft(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::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::visionai::v1::DeleteDraftRequest const& request) { + return stub->AsyncDeleteDraft(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::visionai::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr AppPlatformConnectionImpl::DeleteDraft( + NoAwaitTag, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteDraft(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + return stub_->DeleteDraft(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::DeleteDraft( + 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 DeleteDraft", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::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::visionai::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +AppPlatformConnectionImpl::ListProcessors( + google::cloud::visionai::v1::ListProcessorsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListProcessors(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::visionai::v1::ListProcessorsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessorsRequest const& + request) { + return stub->ListProcessors(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListProcessorsResponse r) { + std::vector result( + r.processors().size()); + auto& messages = *r.mutable_processors(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +AppPlatformConnectionImpl::ListPrebuiltProcessors( + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ListPrebuiltProcessors(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& + request) { + return stub_->ListPrebuiltProcessors(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +AppPlatformConnectionImpl::GetProcessor( + google::cloud::visionai::v1::GetProcessorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetProcessor(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessorRequest const& request) { + return stub_->GetProcessor(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::CreateProcessor( + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateProcessor(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Processor>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + return stub->AsyncCreateProcessor(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::visionai::v1::Processor>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::CreateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateProcessor(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + return stub_->CreateProcessor(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::CreateProcessor( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateProcessor", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Processor>( + 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::visionai::v1::Processor>, + polling_policy(*current), __func__); +} + +future> +AppPlatformConnectionImpl::UpdateProcessor( + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateProcessor(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Processor>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + return stub->AsyncUpdateProcessor(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::visionai::v1::Processor>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::UpdateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateProcessor(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + return stub_->UpdateProcessor(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::UpdateProcessor( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateProcessor", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Processor>( + 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::visionai::v1::Processor>, + polling_policy(*current), __func__); +} + +future> +AppPlatformConnectionImpl::DeleteProcessor( + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteProcessor(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::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::visionai::v1::DeleteProcessorRequest const& request) { + return stub->AsyncDeleteProcessor(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::visionai::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +AppPlatformConnectionImpl::DeleteProcessor( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteProcessor(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + return stub_->DeleteProcessor(context, options, request); + }, + *current, request, __func__); +} + +future> +AppPlatformConnectionImpl::DeleteProcessor( + 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 DeleteProcessor", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::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::visionai::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +AppPlatformConnectionImpl::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 +AppPlatformConnectionImpl::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 +AppPlatformConnectionImpl::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 +AppPlatformConnectionImpl::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 AppPlatformConnectionImpl::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 AppPlatformConnectionImpl::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 visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/app_platform_connection_impl.h b/google/cloud/visionai/v1/internal/app_platform_connection_impl.h new file mode 100644 index 0000000000000..cb9e52070ca3e --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_connection_impl.h @@ -0,0 +1,334 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_CONNECTION_IMPL_H + +#include "google/cloud/visionai/v1/app_platform_connection.h" +#include "google/cloud/visionai/v1/app_platform_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/app_platform_options.h" +#include "google/cloud/visionai/v1/internal/app_platform_retry_traits.h" +#include "google/cloud/visionai/v1/internal/app_platform_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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AppPlatformConnectionImpl : public visionai_v1::AppPlatformConnection { + public: + ~AppPlatformConnectionImpl() override = default; + + AppPlatformConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + StreamRange ListApplications( + google::cloud::visionai::v1::ListApplicationsRequest request) override; + + StatusOr GetApplication( + google::cloud::visionai::v1::GetApplicationRequest const& request) + override; + + future> CreateApplication( + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + StatusOr CreateApplication( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + future> CreateApplication( + google::longrunning::Operation const& operation) override; + + future> UpdateApplication( + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + StatusOr UpdateApplication( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + future> UpdateApplication( + google::longrunning::Operation const& operation) override; + + future> + DeleteApplication(google::cloud::visionai::v1::DeleteApplicationRequest const& + request) override; + + StatusOr DeleteApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) + override; + + future> + DeleteApplication(google::longrunning::Operation const& operation) override; + + future> + DeployApplication(google::cloud::visionai::v1::DeployApplicationRequest const& + request) override; + + StatusOr DeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeployApplicationRequest const& request) + override; + + future> + DeployApplication(google::longrunning::Operation const& operation) override; + + future> + UndeployApplication( + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + StatusOr UndeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + future> + UndeployApplication(google::longrunning::Operation const& operation) override; + + future< + StatusOr> + AddApplicationStreamInput( + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + StatusOr AddApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + future< + StatusOr> + AddApplicationStreamInput( + google::longrunning::Operation const& operation) override; + + future> + RemoveApplicationStreamInput( + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + StatusOr RemoveApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + future> + RemoveApplicationStreamInput( + google::longrunning::Operation const& operation) override; + + future> + UpdateApplicationStreamInput( + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + StatusOr UpdateApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + future> + UpdateApplicationStreamInput( + google::longrunning::Operation const& operation) override; + + StreamRange ListInstances( + google::cloud::visionai::v1::ListInstancesRequest request) override; + + StatusOr GetInstance( + google::cloud::visionai::v1::GetInstanceRequest const& request) override; + + future< + StatusOr> + CreateApplicationInstances( + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + StatusOr CreateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + future< + StatusOr> + CreateApplicationInstances( + google::longrunning::Operation const& operation) override; + + future> + DeleteApplicationInstances( + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + StatusOr DeleteApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + future> + DeleteApplicationInstances( + google::longrunning::Operation const& operation) override; + + future< + StatusOr> + UpdateApplicationInstances( + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + StatusOr UpdateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + future< + StatusOr> + UpdateApplicationInstances( + google::longrunning::Operation const& operation) override; + + StreamRange ListDrafts( + google::cloud::visionai::v1::ListDraftsRequest request) override; + + StatusOr GetDraft( + google::cloud::visionai::v1::GetDraftRequest const& request) override; + + future> CreateDraft( + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + StatusOr CreateDraft( + NoAwaitTag, + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + future> CreateDraft( + google::longrunning::Operation const& operation) override; + + future> UpdateDraft( + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + StatusOr UpdateDraft( + NoAwaitTag, + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + future> UpdateDraft( + google::longrunning::Operation const& operation) override; + + future> DeleteDraft( + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + StatusOr DeleteDraft( + NoAwaitTag, + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + future> DeleteDraft( + google::longrunning::Operation const& operation) override; + + StreamRange ListProcessors( + google::cloud::visionai::v1::ListProcessorsRequest request) override; + + StatusOr + ListPrebuiltProcessors( + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) + override; + + StatusOr GetProcessor( + google::cloud::visionai::v1::GetProcessorRequest const& request) override; + + future> CreateProcessor( + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + StatusOr CreateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + future> CreateProcessor( + google::longrunning::Operation const& operation) override; + + future> UpdateProcessor( + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + StatusOr UpdateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + future> UpdateProcessor( + google::longrunning::Operation const& operation) override; + + future> + DeleteProcessor(google::cloud::visionai::v1::DeleteProcessorRequest const& + request) override; + + StatusOr DeleteProcessor( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) + override; + + future> + DeleteProcessor(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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_CONNECTION_IMPL_H diff --git a/google/cloud/visionai/v1/internal/app_platform_logging_decorator.cc b/google/cloud/visionai/v1/internal/app_platform_logging_decorator.cc new file mode 100644 index 0000000000000..092d923db8335 --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_logging_decorator.cc @@ -0,0 +1,807 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#include "google/cloud/visionai/v1/internal/app_platform_logging_decorator.h" +#include "google/cloud/visionai/v1/platform.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AppPlatformLogging::AppPlatformLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +AppPlatformLogging::ListApplications( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListApplicationsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListApplicationsRequest const& request) { + return child_->ListApplications(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AppPlatformLogging::GetApplication( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetApplicationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetApplicationRequest const& request) { + return child_->GetApplication(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncCreateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationRequest const& + request) { + return child_->AsyncCreateApplication(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AppPlatformLogging::CreateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateApplicationRequest const& + request) { + return child_->CreateApplication(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncUpdateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationRequest const& + request) { + return child_->AsyncUpdateApplication(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AppPlatformLogging::UpdateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateApplicationRequest const& + request) { + return child_->UpdateApplication(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncDeleteApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationRequest const& + request) { + return child_->AsyncDeleteApplication(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AppPlatformLogging::DeleteApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteApplicationRequest const& + request) { + return child_->DeleteApplication(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncDeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployApplicationRequest const& + request) { + return child_->AsyncDeployApplication(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AppPlatformLogging::DeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeployApplicationRequest const& + request) { + return child_->DeployApplication(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncUndeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployApplicationRequest const& + request) { + return child_->AsyncUndeployApplication(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +AppPlatformLogging::UndeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UndeployApplicationRequest const& + request) { + return child_->UndeployApplication(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncAddApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + return child_->AsyncAddApplicationStreamInput( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +AppPlatformLogging::AddApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + return child_->AddApplicationStreamInput(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncRemoveApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1:: + RemoveApplicationStreamInputRequest const& request) { + return child_->AsyncRemoveApplicationStreamInput( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +AppPlatformLogging::RemoveApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1:: + RemoveApplicationStreamInputRequest const& request) { + return child_->RemoveApplicationStreamInput(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncUpdateApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1:: + UpdateApplicationStreamInputRequest const& request) { + return child_->AsyncUpdateApplicationStreamInput( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +AppPlatformLogging::UpdateApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1:: + UpdateApplicationStreamInputRequest const& request) { + return child_->UpdateApplicationStreamInput(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AppPlatformLogging::ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListInstancesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListInstancesRequest const& request) { + return child_->ListInstances(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AppPlatformLogging::GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetInstanceRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetInstanceRequest const& request) { + return child_->GetInstance(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncCreateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + return child_->AsyncCreateApplicationInstances( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +AppPlatformLogging::CreateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + return child_->CreateApplicationInstances(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncDeleteApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + return child_->AsyncDeleteApplicationInstances( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +AppPlatformLogging::DeleteApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + return child_->DeleteApplicationInstances(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncUpdateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + return child_->AsyncUpdateApplicationInstances( + cq, std::move(context), std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +AppPlatformLogging::UpdateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + return child_->UpdateApplicationInstances(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AppPlatformLogging::ListDrafts( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDraftsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDraftsRequest const& request) { + return child_->ListDrafts(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr AppPlatformLogging::GetDraft( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDraftRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDraftRequest const& request) { + return child_->GetDraft(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncCreateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + return child_->AsyncCreateDraft(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AppPlatformLogging::CreateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + return child_->CreateDraft(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncUpdateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + return child_->AsyncUpdateDraft(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AppPlatformLogging::UpdateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + return child_->UpdateDraft(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncDeleteDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + return child_->AsyncDeleteDraft(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AppPlatformLogging::DeleteDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + return child_->DeleteDraft(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AppPlatformLogging::ListProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessorsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessorsRequest const& request) { + return child_->ListProcessors(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AppPlatformLogging::ListPrebuiltProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& + request) { + return child_->ListPrebuiltProcessors(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AppPlatformLogging::GetProcessor( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessorRequest const& request) { + return child_->GetProcessor(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncCreateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + return child_->AsyncCreateProcessor(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AppPlatformLogging::CreateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + return child_->CreateProcessor(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncUpdateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + return child_->AsyncUpdateProcessor(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AppPlatformLogging::UpdateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + return child_->UpdateProcessor(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +AppPlatformLogging::AsyncDeleteProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + return child_->AsyncDeleteProcessor(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr AppPlatformLogging::DeleteProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + return child_->DeleteProcessor(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +AppPlatformLogging::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 AppPlatformLogging::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 +AppPlatformLogging::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 AppPlatformLogging::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 AppPlatformLogging::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 AppPlatformLogging::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> +AppPlatformLogging::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 AppPlatformLogging::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/app_platform_logging_decorator.h b/google/cloud/visionai/v1/internal/app_platform_logging_decorator.h new file mode 100644 index 0000000000000..4b219e5afaa8a --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_logging_decorator.h @@ -0,0 +1,339 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_LOGGING_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/app_platform_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AppPlatformLogging : public AppPlatformStub { + public: + ~AppPlatformLogging() override = default; + AppPlatformLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr + ListApplications(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListApplicationsRequest const& + request) override; + + StatusOr GetApplication( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetApplicationRequest const& request) + override; + + future> AsyncCreateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + StatusOr CreateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + future> AsyncUpdateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + StatusOr UpdateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + future> AsyncDeleteApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) + override; + + StatusOr DeleteApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) + override; + + future> AsyncDeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) + override; + + StatusOr DeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) + override; + + future> AsyncUndeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + StatusOr UndeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + future> + AsyncAddApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + StatusOr AddApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + future> + AsyncRemoveApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + StatusOr RemoveApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + future> + AsyncUpdateApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + StatusOr UpdateApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + StatusOr ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListInstancesRequest const& request) + override; + + StatusOr GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetInstanceRequest const& request) override; + + future> + AsyncCreateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + StatusOr CreateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + future> + AsyncDeleteApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + StatusOr DeleteApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + future> + AsyncUpdateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + StatusOr UpdateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + StatusOr ListDrafts( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDraftsRequest const& request) override; + + StatusOr GetDraft( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDraftRequest const& request) override; + + future> AsyncCreateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + StatusOr CreateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + future> AsyncUpdateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + StatusOr UpdateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + future> AsyncDeleteDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + StatusOr DeleteDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + StatusOr ListProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessorsRequest const& request) + override; + + StatusOr + ListPrebuiltProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) + override; + + StatusOr GetProcessor( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessorRequest const& request) override; + + future> AsyncCreateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + StatusOr CreateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + future> AsyncUpdateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + StatusOr UpdateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + future> AsyncDeleteProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) + override; + + StatusOr DeleteProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessorRequest 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_; +}; // AppPlatformLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_LOGGING_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/app_platform_metadata_decorator.cc b/google/cloud/visionai/v1/internal/app_platform_metadata_decorator.cc new file mode 100644 index 0000000000000..8c96f0b095739 --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_metadata_decorator.cc @@ -0,0 +1,587 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#include "google/cloud/visionai/v1/internal/app_platform_metadata_decorator.h" +#include "google/cloud/visionai/v1/platform.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AppPlatformMetadata::AppPlatformMetadata( + 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 +AppPlatformMetadata::ListApplications( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListApplicationsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListApplications(context, options, request); +} + +StatusOr +AppPlatformMetadata::GetApplication( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetApplicationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetApplication(context, options, request); +} + +future> +AppPlatformMetadata::AsyncCreateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateApplication(cq, std::move(context), + std::move(options), request); +} + +StatusOr AppPlatformMetadata::CreateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateApplication(context, options, request); +} + +future> +AppPlatformMetadata::AsyncUpdateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("application.name=", + internal::UrlEncode(request.application().name()))); + return child_->AsyncUpdateApplication(cq, std::move(context), + std::move(options), request); +} + +StatusOr AppPlatformMetadata::UpdateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("application.name=", + internal::UrlEncode(request.application().name()))); + return child_->UpdateApplication(context, options, request); +} + +future> +AppPlatformMetadata::AsyncDeleteApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteApplication(cq, std::move(context), + std::move(options), request); +} + +StatusOr AppPlatformMetadata::DeleteApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteApplication(context, options, request); +} + +future> +AppPlatformMetadata::AsyncDeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeployApplication(cq, std::move(context), + std::move(options), request); +} + +StatusOr AppPlatformMetadata::DeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeployApplication(context, options, request); +} + +future> +AppPlatformMetadata::AsyncUndeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncUndeployApplication(cq, std::move(context), + std::move(options), request); +} + +StatusOr +AppPlatformMetadata::UndeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->UndeployApplication(context, options, request); +} + +future> +AppPlatformMetadata::AsyncAddApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncAddApplicationStreamInput(cq, std::move(context), + std::move(options), request); +} + +StatusOr +AppPlatformMetadata::AddApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AddApplicationStreamInput(context, options, request); +} + +future> +AppPlatformMetadata::AsyncRemoveApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncRemoveApplicationStreamInput(cq, std::move(context), + std::move(options), request); +} + +StatusOr +AppPlatformMetadata::RemoveApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->RemoveApplicationStreamInput(context, options, request); +} + +future> +AppPlatformMetadata::AsyncUpdateApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncUpdateApplicationStreamInput(cq, std::move(context), + std::move(options), request); +} + +StatusOr +AppPlatformMetadata::UpdateApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->UpdateApplicationStreamInput(context, options, request); +} + +StatusOr +AppPlatformMetadata::ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListInstancesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListInstances(context, options, request); +} + +StatusOr +AppPlatformMetadata::GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetInstanceRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetInstance(context, options, request); +} + +future> +AppPlatformMetadata::AsyncCreateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncCreateApplicationInstances(cq, std::move(context), + std::move(options), request); +} + +StatusOr +AppPlatformMetadata::CreateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->CreateApplicationInstances(context, options, request); +} + +future> +AppPlatformMetadata::AsyncDeleteApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteApplicationInstances(cq, std::move(context), + std::move(options), request); +} + +StatusOr +AppPlatformMetadata::DeleteApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteApplicationInstances(context, options, request); +} + +future> +AppPlatformMetadata::AsyncUpdateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncUpdateApplicationInstances(cq, std::move(context), + std::move(options), request); +} + +StatusOr +AppPlatformMetadata::UpdateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->UpdateApplicationInstances(context, options, request); +} + +StatusOr +AppPlatformMetadata::ListDrafts( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDraftsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListDrafts(context, options, request); +} + +StatusOr AppPlatformMetadata::GetDraft( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDraftRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetDraft(context, options, request); +} + +future> +AppPlatformMetadata::AsyncCreateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateDraft(cq, std::move(context), std::move(options), + request); +} + +StatusOr AppPlatformMetadata::CreateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateDraft(context, options, request); +} + +future> +AppPlatformMetadata::AsyncUpdateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + SetMetadata( + *context, *options, + absl::StrCat("draft.name=", internal::UrlEncode(request.draft().name()))); + return child_->AsyncUpdateDraft(cq, std::move(context), std::move(options), + request); +} + +StatusOr AppPlatformMetadata::UpdateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("draft.name=", internal::UrlEncode(request.draft().name()))); + return child_->UpdateDraft(context, options, request); +} + +future> +AppPlatformMetadata::AsyncDeleteDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteDraft(cq, std::move(context), std::move(options), + request); +} + +StatusOr AppPlatformMetadata::DeleteDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteDraft(context, options, request); +} + +StatusOr +AppPlatformMetadata::ListProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessorsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListProcessors(context, options, request); +} + +StatusOr +AppPlatformMetadata::ListPrebuiltProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListPrebuiltProcessors(context, options, request); +} + +StatusOr +AppPlatformMetadata::GetProcessor( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessorRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetProcessor(context, options, request); +} + +future> +AppPlatformMetadata::AsyncCreateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateProcessor(cq, std::move(context), + std::move(options), request); +} + +StatusOr AppPlatformMetadata::CreateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateProcessor(context, options, request); +} + +future> +AppPlatformMetadata::AsyncUpdateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("processor.name=", + internal::UrlEncode(request.processor().name()))); + return child_->AsyncUpdateProcessor(cq, std::move(context), + std::move(options), request); +} + +StatusOr AppPlatformMetadata::UpdateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + SetMetadata(context, options, + absl::StrCat("processor.name=", + internal::UrlEncode(request.processor().name()))); + return child_->UpdateProcessor(context, options, request); +} + +future> +AppPlatformMetadata::AsyncDeleteProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteProcessor(cq, std::move(context), + std::move(options), request); +} + +StatusOr AppPlatformMetadata::DeleteProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteProcessor(context, options, request); +} + +StatusOr +AppPlatformMetadata::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 AppPlatformMetadata::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 +AppPlatformMetadata::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 AppPlatformMetadata::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 AppPlatformMetadata::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 AppPlatformMetadata::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> +AppPlatformMetadata::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 AppPlatformMetadata::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 AppPlatformMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void AppPlatformMetadata::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/app_platform_metadata_decorator.h b/google/cloud/visionai/v1/internal/app_platform_metadata_decorator.h new file mode 100644 index 0000000000000..2cb50c47d3a8b --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_metadata_decorator.h @@ -0,0 +1,344 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_METADATA_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/app_platform_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AppPlatformMetadata : public AppPlatformStub { + public: + ~AppPlatformMetadata() override = default; + AppPlatformMetadata(std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr + ListApplications(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListApplicationsRequest const& + request) override; + + StatusOr GetApplication( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetApplicationRequest const& request) + override; + + future> AsyncCreateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + StatusOr CreateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + future> AsyncUpdateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + StatusOr UpdateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + future> AsyncDeleteApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) + override; + + StatusOr DeleteApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) + override; + + future> AsyncDeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) + override; + + StatusOr DeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) + override; + + future> AsyncUndeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + StatusOr UndeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + future> + AsyncAddApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + StatusOr AddApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + future> + AsyncRemoveApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + StatusOr RemoveApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + future> + AsyncUpdateApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + StatusOr UpdateApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + StatusOr ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListInstancesRequest const& request) + override; + + StatusOr GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetInstanceRequest const& request) override; + + future> + AsyncCreateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + StatusOr CreateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + future> + AsyncDeleteApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + StatusOr DeleteApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + future> + AsyncUpdateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + StatusOr UpdateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + StatusOr ListDrafts( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDraftsRequest const& request) override; + + StatusOr GetDraft( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDraftRequest const& request) override; + + future> AsyncCreateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + StatusOr CreateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + future> AsyncUpdateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + StatusOr UpdateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + future> AsyncDeleteDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + StatusOr DeleteDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + StatusOr ListProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessorsRequest const& request) + override; + + StatusOr + ListPrebuiltProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) + override; + + StatusOr GetProcessor( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessorRequest const& request) override; + + future> AsyncCreateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + StatusOr CreateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + future> AsyncUpdateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + StatusOr UpdateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + future> AsyncDeleteProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) + override; + + StatusOr DeleteProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessorRequest 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_METADATA_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/app_platform_option_defaults.cc b/google/cloud/visionai/v1/internal/app_platform_option_defaults.cc new file mode 100644 index 0000000000000..e1b0bfb8db8e6 --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_option_defaults.cc @@ -0,0 +1,75 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#include "google/cloud/visionai/v1/internal/app_platform_option_defaults.h" +#include "google/cloud/visionai/v1/app_platform_connection.h" +#include "google/cloud/visionai/v1/app_platform_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 visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options AppPlatformDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_APP_PLATFORM_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_APP_PLATFORM_AUTHORITY", "visionai.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + visionai_v1::AppPlatformLimitedTimeRetryPolicy(std::chrono::minutes(10)) + .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( + options.get()->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } + if (!options + .has()) { + options.set( + visionai_v1::MakeDefaultAppPlatformConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/app_platform_option_defaults.h b/google/cloud/visionai/v1/internal/app_platform_option_defaults.h new file mode 100644 index 0000000000000..74508ac3e0472 --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options AppPlatformDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_OPTION_DEFAULTS_H diff --git a/google/cloud/visionai/v1/internal/app_platform_retry_traits.h b/google/cloud/visionai/v1/internal/app_platform_retry_traits.h new file mode 100644 index 0000000000000..1a45089528c8e --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct AppPlatformRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_RETRY_TRAITS_H diff --git a/google/cloud/visionai/v1/internal/app_platform_sources.cc b/google/cloud/visionai/v1/internal/app_platform_sources.cc new file mode 100644 index 0000000000000..4c1462d0cc4d1 --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/visionai/v1/app_platform_client.cc" +#include "google/cloud/visionai/v1/app_platform_connection.cc" +#include "google/cloud/visionai/v1/app_platform_connection_idempotency_policy.cc" +#include "google/cloud/visionai/v1/internal/app_platform_auth_decorator.cc" +#include "google/cloud/visionai/v1/internal/app_platform_connection_impl.cc" +#include "google/cloud/visionai/v1/internal/app_platform_logging_decorator.cc" +#include "google/cloud/visionai/v1/internal/app_platform_metadata_decorator.cc" +#include "google/cloud/visionai/v1/internal/app_platform_option_defaults.cc" +#include "google/cloud/visionai/v1/internal/app_platform_stub.cc" +#include "google/cloud/visionai/v1/internal/app_platform_stub_factory.cc" +#include "google/cloud/visionai/v1/internal/app_platform_tracing_connection.cc" +#include "google/cloud/visionai/v1/internal/app_platform_tracing_stub.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/visionai/v1/internal/app_platform_stub.cc b/google/cloud/visionai/v1/internal/app_platform_stub.cc new file mode 100644 index 0000000000000..ce18cadfe9dee --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_stub.cc @@ -0,0 +1,802 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#include "google/cloud/visionai/v1/internal/app_platform_stub.h" +#include "google/cloud/visionai/v1/platform.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AppPlatformStub::~AppPlatformStub() = default; + +StatusOr +DefaultAppPlatformStub::ListApplications( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListApplicationsRequest const& request) { + google::cloud::visionai::v1::ListApplicationsResponse response; + auto status = grpc_stub_->ListApplications(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAppPlatformStub::GetApplication( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetApplicationRequest const& request) { + google::cloud::visionai::v1::Application response; + auto status = grpc_stub_->GetApplication(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncCreateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateApplicationRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateApplicationRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::visionai::v1::CreateApplicationRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateApplication(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::CreateApplication( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateApplication(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncUpdateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateApplicationRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::visionai::v1::UpdateApplicationRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateApplication(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::UpdateApplication( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateApplication(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncDeleteApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteApplicationRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteApplicationRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteApplication(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::DeleteApplication( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteApplication(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncDeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeployApplicationRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeployApplicationRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::visionai::v1::DeployApplicationRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeployApplication(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::DeployApplication( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeployApplication(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncUndeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UndeployApplicationRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UndeployApplicationRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUndeployApplication(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::UndeployApplication( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UndeployApplication(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncAddApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::AddApplicationStreamInputRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncAddApplicationStreamInput(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::AddApplicationStreamInput( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->AddApplicationStreamInput(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncRemoveApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1:: + RemoveApplicationStreamInputRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncRemoveApplicationStreamInput(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::RemoveApplicationStreamInput( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->RemoveApplicationStreamInput(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncUpdateApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1:: + UpdateApplicationStreamInputRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateApplicationStreamInput(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::UpdateApplicationStreamInput( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->UpdateApplicationStreamInput(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAppPlatformStub::ListInstances( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListInstancesRequest const& request) { + google::cloud::visionai::v1::ListInstancesResponse response; + auto status = grpc_stub_->ListInstances(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAppPlatformStub::GetInstance( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetInstanceRequest const& request) { + google::cloud::visionai::v1::Instance response; + auto status = grpc_stub_->GetInstance(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncCreateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateApplicationInstancesRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateApplicationInstances(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::CreateApplicationInstances( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->CreateApplicationInstances(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncDeleteApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteApplicationInstancesRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteApplicationInstances(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::DeleteApplicationInstances( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->DeleteApplicationInstances(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncUpdateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateApplicationInstancesRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateApplicationInstances(context, request, + cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::UpdateApplicationInstances( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + google::longrunning::Operation response; + auto status = + grpc_stub_->UpdateApplicationInstances(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAppPlatformStub::ListDrafts( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListDraftsRequest const& request) { + google::cloud::visionai::v1::ListDraftsResponse response; + auto status = grpc_stub_->ListDrafts(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultAppPlatformStub::GetDraft( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetDraftRequest const& request) { + google::cloud::visionai::v1::Draft response; + auto status = grpc_stub_->GetDraft(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncCreateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateDraftRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::CreateDraftRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateDraft(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAppPlatformStub::CreateDraft( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateDraft(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncUpdateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateDraftRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UpdateDraftRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateDraft(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAppPlatformStub::UpdateDraft( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateDraft(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncDeleteDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteDraftRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteDraftRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteDraft(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultAppPlatformStub::DeleteDraft( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteDraft(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAppPlatformStub::ListProcessors( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListProcessorsRequest const& request) { + google::cloud::visionai::v1::ListProcessorsResponse response; + auto status = grpc_stub_->ListProcessors(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAppPlatformStub::ListPrebuiltProcessors( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) { + google::cloud::visionai::v1::ListPrebuiltProcessorsResponse response; + auto status = + grpc_stub_->ListPrebuiltProcessors(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAppPlatformStub::GetProcessor( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetProcessorRequest const& request) { + google::cloud::visionai::v1::Processor response; + auto status = grpc_stub_->GetProcessor(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncCreateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateProcessorRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::CreateProcessorRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateProcessor(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::CreateProcessor( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateProcessor(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncUpdateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateProcessorRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UpdateProcessorRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateProcessor(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::UpdateProcessor( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateProcessor(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultAppPlatformStub::AsyncDeleteProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteProcessorRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteProcessorRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteProcessor(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultAppPlatformStub::DeleteProcessor( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteProcessor(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultAppPlatformStub::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 DefaultAppPlatformStub::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 +DefaultAppPlatformStub::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 DefaultAppPlatformStub::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 DefaultAppPlatformStub::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 DefaultAppPlatformStub::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> +DefaultAppPlatformStub::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 DefaultAppPlatformStub::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/app_platform_stub.h b/google/cloud/visionai/v1/internal/app_platform_stub.h new file mode 100644 index 0000000000000..cefe0b12bf062 --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_stub.h @@ -0,0 +1,630 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_STUB_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/platform.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AppPlatformStub { + public: + virtual ~AppPlatformStub() = 0; + + virtual StatusOr + ListApplications( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListApplicationsRequest const& request) = 0; + + virtual StatusOr GetApplication( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetApplicationRequest const& request) = 0; + + virtual future> + AsyncCreateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) = 0; + + virtual StatusOr CreateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) = 0; + + virtual future> + AsyncUpdateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) = 0; + + virtual StatusOr UpdateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) = 0; + + virtual future> + AsyncDeleteApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) = 0; + + virtual StatusOr DeleteApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) = 0; + + virtual future> + AsyncDeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) = 0; + + virtual StatusOr DeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) = 0; + + virtual future> + AsyncUndeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployApplicationRequest const& + request) = 0; + + virtual StatusOr UndeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployApplicationRequest const& + request) = 0; + + virtual future> + AsyncAddApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) = 0; + + virtual StatusOr AddApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) = 0; + + virtual future> + AsyncRemoveApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) = 0; + + virtual StatusOr RemoveApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) = 0; + + virtual future> + AsyncUpdateApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) = 0; + + virtual StatusOr UpdateApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) = 0; + + virtual StatusOr + ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListInstancesRequest const& request) = 0; + + virtual StatusOr GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetInstanceRequest const& request) = 0; + + virtual future> + AsyncCreateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) = 0; + + virtual StatusOr CreateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) = 0; + + virtual future> + AsyncDeleteApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) = 0; + + virtual StatusOr DeleteApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) = 0; + + virtual future> + AsyncUpdateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) = 0; + + virtual StatusOr UpdateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) = 0; + + virtual StatusOr ListDrafts( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDraftsRequest const& request) = 0; + + virtual StatusOr GetDraft( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDraftRequest const& request) = 0; + + virtual future> AsyncCreateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateDraftRequest const& request) = 0; + + virtual StatusOr CreateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateDraftRequest const& request) = 0; + + virtual future> AsyncUpdateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) = 0; + + virtual StatusOr UpdateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) = 0; + + virtual future> AsyncDeleteDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) = 0; + + virtual StatusOr DeleteDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) = 0; + + virtual StatusOr + ListProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessorsRequest const& request) = 0; + + virtual StatusOr + ListPrebuiltProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& + request) = 0; + + virtual StatusOr GetProcessor( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessorRequest const& request) = 0; + + virtual future> AsyncCreateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) = 0; + + virtual StatusOr CreateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) = 0; + + virtual future> AsyncUpdateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) = 0; + + virtual StatusOr UpdateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) = 0; + + virtual future> AsyncDeleteProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) = 0; + + virtual StatusOr DeleteProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessorRequest 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 DefaultAppPlatformStub : public AppPlatformStub { + public: + DefaultAppPlatformStub( + std::unique_ptr + 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 + ListApplications(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListApplicationsRequest const& + request) override; + + StatusOr GetApplication( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetApplicationRequest const& request) + override; + + future> AsyncCreateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + StatusOr CreateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + future> AsyncUpdateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + StatusOr UpdateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + future> AsyncDeleteApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) + override; + + StatusOr DeleteApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) + override; + + future> AsyncDeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) + override; + + StatusOr DeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) + override; + + future> AsyncUndeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + StatusOr UndeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + future> + AsyncAddApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + StatusOr AddApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + future> + AsyncRemoveApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + StatusOr RemoveApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + future> + AsyncUpdateApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + StatusOr UpdateApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + StatusOr ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListInstancesRequest const& request) + override; + + StatusOr GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetInstanceRequest const& request) override; + + future> + AsyncCreateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + StatusOr CreateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + future> + AsyncDeleteApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + StatusOr DeleteApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + future> + AsyncUpdateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + StatusOr UpdateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + StatusOr ListDrafts( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDraftsRequest const& request) override; + + StatusOr GetDraft( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDraftRequest const& request) override; + + future> AsyncCreateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + StatusOr CreateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + future> AsyncUpdateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + StatusOr UpdateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + future> AsyncDeleteDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + StatusOr DeleteDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + StatusOr ListProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessorsRequest const& request) + override; + + StatusOr + ListPrebuiltProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) + override; + + StatusOr GetProcessor( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessorRequest const& request) override; + + future> AsyncCreateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + StatusOr CreateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + future> AsyncUpdateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + StatusOr UpdateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + future> AsyncDeleteProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) + override; + + StatusOr DeleteProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessorRequest 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 + grpc_stub_; + std::unique_ptr + locations_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_STUB_H diff --git a/google/cloud/visionai/v1/internal/app_platform_stub_factory.cc b/google/cloud/visionai/v1/internal/app_platform_stub_factory.cc new file mode 100644 index 0000000000000..f8faf452a658e --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_stub_factory.cc @@ -0,0 +1,81 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#include "google/cloud/visionai/v1/internal/app_platform_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/internal/app_platform_auth_decorator.h" +#include "google/cloud/visionai/v1/internal/app_platform_logging_decorator.h" +#include "google/cloud/visionai/v1/internal/app_platform_metadata_decorator.h" +#include "google/cloud/visionai/v1/internal/app_platform_stub.h" +#include "google/cloud/visionai/v1/internal/app_platform_tracing_stub.h" +#include "google/cloud/visionai/v1/platform.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultAppPlatformStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::visionai::v1::AppPlatform::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 = MakeAppPlatformTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/app_platform_stub_factory.h b/google/cloud/visionai/v1/internal/app_platform_stub_factory.h new file mode 100644 index 0000000000000..6625a432911a2 --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_STUB_FACTORY_H + +#include "google/cloud/visionai/v1/internal/app_platform_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultAppPlatformStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_STUB_FACTORY_H diff --git a/google/cloud/visionai/v1/internal/app_platform_tracing_connection.cc b/google/cloud/visionai/v1/internal/app_platform_tracing_connection.cc new file mode 100644 index 0000000000000..a0db1b19e1d06 --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_tracing_connection.cc @@ -0,0 +1,719 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#include "google/cloud/visionai/v1/internal/app_platform_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AppPlatformTracingConnection::AppPlatformTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StreamRange +AppPlatformTracingConnection::ListApplications( + google::cloud::visionai::v1::ListApplicationsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::ListApplications"); + internal::OTelScope scope(span); + auto sr = child_->ListApplications(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::visionai::v1::Application>(std::move(span), std::move(sr)); +} + +StatusOr +AppPlatformTracingConnection::GetApplication( + google::cloud::visionai::v1::GetApplicationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::GetApplication"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetApplication(request)); +} + +future> +AppPlatformTracingConnection::CreateApplication( + google::cloud::visionai::v1::CreateApplicationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::CreateApplication"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateApplication(request)); +} + +StatusOr +AppPlatformTracingConnection::CreateApplication( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::CreateApplication"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateApplication(NoAwaitTag{}, request)); +} + +future> +AppPlatformTracingConnection::CreateApplication( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::CreateApplication"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateApplication(operation)); +} + +future> +AppPlatformTracingConnection::UpdateApplication( + google::cloud::visionai::v1::UpdateApplicationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::UpdateApplication"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateApplication(request)); +} + +StatusOr +AppPlatformTracingConnection::UpdateApplication( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::UpdateApplication"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateApplication(NoAwaitTag{}, request)); +} + +future> +AppPlatformTracingConnection::UpdateApplication( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::UpdateApplication"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateApplication(operation)); +} + +future> +AppPlatformTracingConnection::DeleteApplication( + google::cloud::visionai::v1::DeleteApplicationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::DeleteApplication"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteApplication(request)); +} + +StatusOr +AppPlatformTracingConnection::DeleteApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::DeleteApplication"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteApplication(NoAwaitTag{}, request)); +} + +future> +AppPlatformTracingConnection::DeleteApplication( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::DeleteApplication"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteApplication(operation)); +} + +future> +AppPlatformTracingConnection::DeployApplication( + google::cloud::visionai::v1::DeployApplicationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::DeployApplication"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeployApplication(request)); +} + +StatusOr +AppPlatformTracingConnection::DeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeployApplicationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::DeployApplication"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeployApplication(NoAwaitTag{}, request)); +} + +future> +AppPlatformTracingConnection::DeployApplication( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::DeployApplication"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeployApplication(operation)); +} + +future> +AppPlatformTracingConnection::UndeployApplication( + google::cloud::visionai::v1::UndeployApplicationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::UndeployApplication"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UndeployApplication(request)); +} + +StatusOr +AppPlatformTracingConnection::UndeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::UndeployApplication"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UndeployApplication(NoAwaitTag{}, request)); +} + +future> +AppPlatformTracingConnection::UndeployApplication( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::UndeployApplication"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UndeployApplication(operation)); +} + +future> +AppPlatformTracingConnection::AddApplicationStreamInput( + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::AddApplicationStreamInput"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->AddApplicationStreamInput(request)); +} + +StatusOr +AppPlatformTracingConnection::AddApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::AddApplicationStreamInput"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->AddApplicationStreamInput(NoAwaitTag{}, request)); +} + +future> +AppPlatformTracingConnection::AddApplicationStreamInput( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::AddApplicationStreamInput"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->AddApplicationStreamInput(operation)); +} + +future< + StatusOr> +AppPlatformTracingConnection::RemoveApplicationStreamInput( + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::RemoveApplicationStreamInput"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->RemoveApplicationStreamInput(request)); +} + +StatusOr +AppPlatformTracingConnection::RemoveApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::RemoveApplicationStreamInput"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->RemoveApplicationStreamInput(NoAwaitTag{}, request)); +} + +future< + StatusOr> +AppPlatformTracingConnection::RemoveApplicationStreamInput( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::RemoveApplicationStreamInput"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->RemoveApplicationStreamInput(operation)); +} + +future< + StatusOr> +AppPlatformTracingConnection::UpdateApplicationStreamInput( + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::UpdateApplicationStreamInput"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateApplicationStreamInput(request)); +} + +StatusOr +AppPlatformTracingConnection::UpdateApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::UpdateApplicationStreamInput"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->UpdateApplicationStreamInput(NoAwaitTag{}, request)); +} + +future< + StatusOr> +AppPlatformTracingConnection::UpdateApplicationStreamInput( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::UpdateApplicationStreamInput"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateApplicationStreamInput(operation)); +} + +StreamRange +AppPlatformTracingConnection::ListInstances( + google::cloud::visionai::v1::ListInstancesRequest request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::ListInstances"); + internal::OTelScope scope(span); + auto sr = child_->ListInstances(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +AppPlatformTracingConnection::GetInstance( + google::cloud::visionai::v1::GetInstanceRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::GetInstance"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetInstance(request)); +} + +future< + StatusOr> +AppPlatformTracingConnection::CreateApplicationInstances( + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::CreateApplicationInstances"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateApplicationInstances(request)); +} + +StatusOr +AppPlatformTracingConnection::CreateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::CreateApplicationInstances"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->CreateApplicationInstances(NoAwaitTag{}, request)); +} + +future< + StatusOr> +AppPlatformTracingConnection::CreateApplicationInstances( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::CreateApplicationInstances"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateApplicationInstances(operation)); +} + +future> +AppPlatformTracingConnection::DeleteApplicationInstances( + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::DeleteApplicationInstances"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteApplicationInstances(request)); +} + +StatusOr +AppPlatformTracingConnection::DeleteApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::DeleteApplicationInstances"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->DeleteApplicationInstances(NoAwaitTag{}, request)); +} + +future> +AppPlatformTracingConnection::DeleteApplicationInstances( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::DeleteApplicationInstances"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteApplicationInstances(operation)); +} + +future< + StatusOr> +AppPlatformTracingConnection::UpdateApplicationInstances( + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::UpdateApplicationInstances"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateApplicationInstances(request)); +} + +StatusOr +AppPlatformTracingConnection::UpdateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::UpdateApplicationInstances"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan( + *span, child_->UpdateApplicationInstances(NoAwaitTag{}, request)); +} + +future< + StatusOr> +AppPlatformTracingConnection::UpdateApplicationInstances( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::UpdateApplicationInstances"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateApplicationInstances(operation)); +} + +StreamRange +AppPlatformTracingConnection::ListDrafts( + google::cloud::visionai::v1::ListDraftsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::ListDrafts"); + internal::OTelScope scope(span); + auto sr = child_->ListDrafts(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +AppPlatformTracingConnection::GetDraft( + google::cloud::visionai::v1::GetDraftRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::GetDraft"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetDraft(request)); +} + +future> +AppPlatformTracingConnection::CreateDraft( + google::cloud::visionai::v1::CreateDraftRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::CreateDraft"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateDraft(request)); +} + +StatusOr +AppPlatformTracingConnection::CreateDraft( + NoAwaitTag, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::CreateDraft"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateDraft(NoAwaitTag{}, request)); +} + +future> +AppPlatformTracingConnection::CreateDraft( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::CreateDraft"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateDraft(operation)); +} + +future> +AppPlatformTracingConnection::UpdateDraft( + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::UpdateDraft"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateDraft(request)); +} + +StatusOr +AppPlatformTracingConnection::UpdateDraft( + NoAwaitTag, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::UpdateDraft"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateDraft(NoAwaitTag{}, request)); +} + +future> +AppPlatformTracingConnection::UpdateDraft( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::UpdateDraft"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateDraft(operation)); +} + +future> +AppPlatformTracingConnection::DeleteDraft( + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::DeleteDraft"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteDraft(request)); +} + +StatusOr +AppPlatformTracingConnection::DeleteDraft( + NoAwaitTag, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::DeleteDraft"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteDraft(NoAwaitTag{}, request)); +} + +future> +AppPlatformTracingConnection::DeleteDraft( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::DeleteDraft"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteDraft(operation)); +} + +StreamRange +AppPlatformTracingConnection::ListProcessors( + google::cloud::visionai::v1::ListProcessorsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::ListProcessors"); + internal::OTelScope scope(span); + auto sr = child_->ListProcessors(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::visionai::v1::Processor>(std::move(span), std::move(sr)); +} + +StatusOr +AppPlatformTracingConnection::ListPrebuiltProcessors( + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::AppPlatformConnection::ListPrebuiltProcessors"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->ListPrebuiltProcessors(request)); +} + +StatusOr +AppPlatformTracingConnection::GetProcessor( + google::cloud::visionai::v1::GetProcessorRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::GetProcessor"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetProcessor(request)); +} + +future> +AppPlatformTracingConnection::CreateProcessor( + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::CreateProcessor"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateProcessor(request)); +} + +StatusOr +AppPlatformTracingConnection::CreateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::CreateProcessor"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateProcessor(NoAwaitTag{}, request)); +} + +future> +AppPlatformTracingConnection::CreateProcessor( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::CreateProcessor"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateProcessor(operation)); +} + +future> +AppPlatformTracingConnection::UpdateProcessor( + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::UpdateProcessor"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateProcessor(request)); +} + +StatusOr +AppPlatformTracingConnection::UpdateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::UpdateProcessor"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateProcessor(NoAwaitTag{}, request)); +} + +future> +AppPlatformTracingConnection::UpdateProcessor( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::UpdateProcessor"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateProcessor(operation)); +} + +future> +AppPlatformTracingConnection::DeleteProcessor( + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::DeleteProcessor"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteProcessor(request)); +} + +StatusOr +AppPlatformTracingConnection::DeleteProcessor( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::DeleteProcessor"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteProcessor(NoAwaitTag{}, request)); +} + +future> +AppPlatformTracingConnection::DeleteProcessor( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::DeleteProcessor"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteProcessor(operation)); +} + +StreamRange +AppPlatformTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +AppPlatformTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +AppPlatformTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +AppPlatformTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status AppPlatformTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status AppPlatformTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::AppPlatformConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeAppPlatformTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/app_platform_tracing_connection.h b/google/cloud/visionai/v1/internal/app_platform_tracing_connection.h new file mode 100644 index 0000000000000..bd939be4e0977 --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_tracing_connection.h @@ -0,0 +1,328 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_TRACING_CONNECTION_H + +#include "google/cloud/visionai/v1/app_platform_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AppPlatformTracingConnection : public visionai_v1::AppPlatformConnection { + public: + ~AppPlatformTracingConnection() override = default; + + explicit AppPlatformTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StreamRange ListApplications( + google::cloud::visionai::v1::ListApplicationsRequest request) override; + + StatusOr GetApplication( + google::cloud::visionai::v1::GetApplicationRequest const& request) + override; + + future> CreateApplication( + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + StatusOr CreateApplication( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + future> CreateApplication( + google::longrunning::Operation const& operation) override; + + future> UpdateApplication( + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + StatusOr UpdateApplication( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + future> UpdateApplication( + google::longrunning::Operation const& operation) override; + + future> + DeleteApplication(google::cloud::visionai::v1::DeleteApplicationRequest const& + request) override; + + StatusOr DeleteApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) + override; + + future> + DeleteApplication(google::longrunning::Operation const& operation) override; + + future> + DeployApplication(google::cloud::visionai::v1::DeployApplicationRequest const& + request) override; + + StatusOr DeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::DeployApplicationRequest const& request) + override; + + future> + DeployApplication(google::longrunning::Operation const& operation) override; + + future> + UndeployApplication( + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + StatusOr UndeployApplication( + NoAwaitTag, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + future> + UndeployApplication(google::longrunning::Operation const& operation) override; + + future< + StatusOr> + AddApplicationStreamInput( + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + StatusOr AddApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + future< + StatusOr> + AddApplicationStreamInput( + google::longrunning::Operation const& operation) override; + + future> + RemoveApplicationStreamInput( + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + StatusOr RemoveApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + future> + RemoveApplicationStreamInput( + google::longrunning::Operation const& operation) override; + + future> + UpdateApplicationStreamInput( + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + StatusOr UpdateApplicationStreamInput( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + future> + UpdateApplicationStreamInput( + google::longrunning::Operation const& operation) override; + + StreamRange ListInstances( + google::cloud::visionai::v1::ListInstancesRequest request) override; + + StatusOr GetInstance( + google::cloud::visionai::v1::GetInstanceRequest const& request) override; + + future< + StatusOr> + CreateApplicationInstances( + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + StatusOr CreateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + future< + StatusOr> + CreateApplicationInstances( + google::longrunning::Operation const& operation) override; + + future> + DeleteApplicationInstances( + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + StatusOr DeleteApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + future> + DeleteApplicationInstances( + google::longrunning::Operation const& operation) override; + + future< + StatusOr> + UpdateApplicationInstances( + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + StatusOr UpdateApplicationInstances( + NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + future< + StatusOr> + UpdateApplicationInstances( + google::longrunning::Operation const& operation) override; + + StreamRange ListDrafts( + google::cloud::visionai::v1::ListDraftsRequest request) override; + + StatusOr GetDraft( + google::cloud::visionai::v1::GetDraftRequest const& request) override; + + future> CreateDraft( + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + StatusOr CreateDraft( + NoAwaitTag, + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + future> CreateDraft( + google::longrunning::Operation const& operation) override; + + future> UpdateDraft( + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + StatusOr UpdateDraft( + NoAwaitTag, + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + future> UpdateDraft( + google::longrunning::Operation const& operation) override; + + future> DeleteDraft( + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + StatusOr DeleteDraft( + NoAwaitTag, + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + future> DeleteDraft( + google::longrunning::Operation const& operation) override; + + StreamRange ListProcessors( + google::cloud::visionai::v1::ListProcessorsRequest request) override; + + StatusOr + ListPrebuiltProcessors( + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) + override; + + StatusOr GetProcessor( + google::cloud::visionai::v1::GetProcessorRequest const& request) override; + + future> CreateProcessor( + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + StatusOr CreateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + future> CreateProcessor( + google::longrunning::Operation const& operation) override; + + future> UpdateProcessor( + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + StatusOr UpdateProcessor( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + future> UpdateProcessor( + google::longrunning::Operation const& operation) override; + + future> + DeleteProcessor(google::cloud::visionai::v1::DeleteProcessorRequest const& + request) override; + + StatusOr DeleteProcessor( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) + override; + + future> + DeleteProcessor(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_; +}; + +/** + * 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 +MakeAppPlatformTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_TRACING_CONNECTION_H diff --git a/google/cloud/visionai/v1/internal/app_platform_tracing_stub.cc b/google/cloud/visionai/v1/internal/app_platform_tracing_stub.cc new file mode 100644 index 0000000000000..6d695bbb5587f --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_tracing_stub.cc @@ -0,0 +1,721 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#include "google/cloud/visionai/v1/internal/app_platform_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +AppPlatformTracingStub::AppPlatformTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +AppPlatformTracingStub::ListApplications( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListApplicationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "ListApplications"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListApplications(context, options, request)); +} + +StatusOr +AppPlatformTracingStub::GetApplication( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetApplicationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "GetApplication"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetApplication(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncCreateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "CreateApplication"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateApplication(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::CreateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "CreateApplication"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->CreateApplication(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncUpdateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "UpdateApplication"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateApplication(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::UpdateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "UpdateApplication"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UpdateApplication(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncDeleteApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "DeleteApplication"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteApplication(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::DeleteApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "DeleteApplication"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteApplication(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncDeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "DeployApplication"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeployApplication(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::DeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "DeployApplication"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeployApplication(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncUndeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "UndeployApplication"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUndeployApplication(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::UndeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "UndeployApplication"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UndeployApplication(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncAddApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "AddApplicationStreamInput"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncAddApplicationStreamInput(cq, context, + std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::AddApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "AddApplicationStreamInput"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->AddApplicationStreamInput(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncRemoveApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "RemoveApplicationStreamInput"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncRemoveApplicationStreamInput( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::RemoveApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "RemoveApplicationStreamInput"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->RemoveApplicationStreamInput(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncUpdateApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "UpdateApplicationStreamInput"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateApplicationStreamInput( + cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::UpdateApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "UpdateApplicationStreamInput"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->UpdateApplicationStreamInput(context, options, request)); +} + +StatusOr +AppPlatformTracingStub::ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListInstancesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "ListInstances"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListInstances(context, options, request)); +} + +StatusOr +AppPlatformTracingStub::GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetInstanceRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "GetInstance"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetInstance(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncCreateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "CreateApplicationInstances"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateApplicationInstances(cq, context, + std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::CreateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "CreateApplicationInstances"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->CreateApplicationInstances(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncDeleteApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "DeleteApplicationInstances"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteApplicationInstances(cq, context, + std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::DeleteApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "DeleteApplicationInstances"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->DeleteApplicationInstances(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncUpdateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "UpdateApplicationInstances"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateApplicationInstances(cq, context, + std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::UpdateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "UpdateApplicationInstances"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->UpdateApplicationInstances(context, options, request)); +} + +StatusOr +AppPlatformTracingStub::ListDrafts( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDraftsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "ListDrafts"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListDrafts(context, options, request)); +} + +StatusOr AppPlatformTracingStub::GetDraft( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDraftRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "GetDraft"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetDraft(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncCreateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "CreateDraft"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateDraft(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AppPlatformTracingStub::CreateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateDraftRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "CreateDraft"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateDraft(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncUpdateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "UpdateDraft"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateDraft(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AppPlatformTracingStub::UpdateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "UpdateDraft"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateDraft(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncDeleteDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "DeleteDraft"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteDraft(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr AppPlatformTracingStub::DeleteDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "DeleteDraft"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteDraft(context, options, request)); +} + +StatusOr +AppPlatformTracingStub::ListProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessorsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "ListProcessors"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListProcessors(context, options, request)); +} + +StatusOr +AppPlatformTracingStub::ListPrebuiltProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "ListPrebuiltProcessors"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->ListPrebuiltProcessors(context, options, request)); +} + +StatusOr +AppPlatformTracingStub::GetProcessor( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessorRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "GetProcessor"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetProcessor(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncCreateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "CreateProcessor"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateProcessor(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::CreateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "CreateProcessor"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateProcessor(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncUpdateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "UpdateProcessor"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateProcessor(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::UpdateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "UpdateProcessor"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateProcessor(context, options, request)); +} + +future> +AppPlatformTracingStub::AsyncDeleteProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "DeleteProcessor"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteProcessor(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +AppPlatformTracingStub::DeleteProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "DeleteProcessor"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteProcessor(context, options, request)); +} + +StatusOr +AppPlatformTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr AppPlatformTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +AppPlatformTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr AppPlatformTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status AppPlatformTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status AppPlatformTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.AppPlatform", + "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +AppPlatformTracingStub::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 AppPlatformTracingStub::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)); +} + +std::shared_ptr MakeAppPlatformTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/app_platform_tracing_stub.h b/google/cloud/visionai/v1/internal/app_platform_tracing_stub.h new file mode 100644 index 0000000000000..c6a3ef3e7ad38 --- /dev/null +++ b/google/cloud/visionai/v1/internal/app_platform_tracing_stub.h @@ -0,0 +1,346 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_TRACING_STUB_H + +#include "google/cloud/visionai/v1/internal/app_platform_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class AppPlatformTracingStub : public AppPlatformStub { + public: + ~AppPlatformTracingStub() override = default; + + explicit AppPlatformTracingStub(std::shared_ptr child); + + StatusOr + ListApplications(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListApplicationsRequest const& + request) override; + + StatusOr GetApplication( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetApplicationRequest const& request) + override; + + future> AsyncCreateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + StatusOr CreateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationRequest const& request) + override; + + future> AsyncUpdateApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + StatusOr UpdateApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationRequest const& request) + override; + + future> AsyncDeleteApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) + override; + + StatusOr DeleteApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationRequest const& request) + override; + + future> AsyncDeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) + override; + + StatusOr DeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployApplicationRequest const& request) + override; + + future> AsyncUndeployApplication( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + StatusOr UndeployApplication( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployApplicationRequest const& request) + override; + + future> + AsyncAddApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + StatusOr AddApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request) override; + + future> + AsyncRemoveApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + StatusOr RemoveApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request) override; + + future> + AsyncUpdateApplicationStreamInput( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + StatusOr UpdateApplicationStreamInput( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request) override; + + StatusOr ListInstances( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListInstancesRequest const& request) + override; + + StatusOr GetInstance( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetInstanceRequest const& request) override; + + future> + AsyncCreateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + StatusOr CreateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request) override; + + future> + AsyncDeleteApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + StatusOr DeleteApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request) override; + + future> + AsyncUpdateApplicationInstances( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + StatusOr UpdateApplicationInstances( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request) override; + + StatusOr ListDrafts( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDraftsRequest const& request) override; + + StatusOr GetDraft( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDraftRequest const& request) override; + + future> AsyncCreateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + StatusOr CreateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateDraftRequest const& request) override; + + future> AsyncUpdateDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + StatusOr UpdateDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateDraftRequest const& request) override; + + future> AsyncDeleteDraft( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + StatusOr DeleteDraft( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteDraftRequest const& request) override; + + StatusOr ListProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessorsRequest const& request) + override; + + StatusOr + ListPrebuiltProcessors( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& request) + override; + + StatusOr GetProcessor( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessorRequest const& request) override; + + future> AsyncCreateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + StatusOr CreateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessorRequest const& request) + override; + + future> AsyncUpdateProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + StatusOr UpdateProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessorRequest const& request) + override; + + future> AsyncDeleteProcessor( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessorRequest const& request) + override; + + StatusOr DeleteProcessor( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessorRequest 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_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeAppPlatformTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_APP_PLATFORM_TRACING_STUB_H diff --git a/google/cloud/visionai/v1/internal/health_check_auth_decorator.cc b/google/cloud/visionai/v1/internal/health_check_auth_decorator.cc new file mode 100644 index 0000000000000..6a2ccd6ea41b5 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_auth_decorator.cc @@ -0,0 +1,101 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#include "google/cloud/visionai/v1/internal/health_check_auth_decorator.h" +#include "google/cloud/visionai/v1/health_service.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HealthCheckServiceAuth::HealthCheckServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +HealthCheckServiceAuth::HealthCheck( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::HealthCheckRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->HealthCheck(context, options, request); +} + +StatusOr +HealthCheckServiceAuth::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 HealthCheckServiceAuth::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 +HealthCheckServiceAuth::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 HealthCheckServiceAuth::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 HealthCheckServiceAuth::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 HealthCheckServiceAuth::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); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/health_check_auth_decorator.h b/google/cloud/visionai/v1/internal/health_check_auth_decorator.h new file mode 100644 index 0000000000000..233c43e66f9ee --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_auth_decorator.h @@ -0,0 +1,84 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_AUTH_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/health_check_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HealthCheckServiceAuth : public HealthCheckServiceStub { + public: + ~HealthCheckServiceAuth() override = default; + HealthCheckServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr HealthCheck( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::HealthCheckRequest 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; + + private: + std::shared_ptr auth_; + std::shared_ptr child_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_AUTH_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/health_check_connection_impl.cc b/google/cloud/visionai/v1/internal/health_check_connection_impl.cc new file mode 100644 index 0000000000000..00dbd0d1ad5e7 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_connection_impl.cc @@ -0,0 +1,202 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#include "google/cloud/visionai/v1/internal/health_check_connection_impl.h" +#include "google/cloud/visionai/v1/internal/health_check_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/pagination_range.h" +#include "google/cloud/internal/retry_loop.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_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(); +} + +} // namespace + +HealthCheckServiceConnectionImpl::HealthCheckServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions( + std::move(options), HealthCheckServiceConnection::options())) {} + +StatusOr +HealthCheckServiceConnectionImpl::HealthCheck( + google::cloud::visionai::v1::HealthCheckRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->HealthCheck(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::HealthCheckRequest const& request) { + return stub_->HealthCheck(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +HealthCheckServiceConnectionImpl::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 +HealthCheckServiceConnectionImpl::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 +HealthCheckServiceConnectionImpl::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 +HealthCheckServiceConnectionImpl::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 HealthCheckServiceConnectionImpl::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 HealthCheckServiceConnectionImpl::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 visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/health_check_connection_impl.h b/google/cloud/visionai/v1/internal/health_check_connection_impl.h new file mode 100644 index 0000000000000..90193993de17b --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_connection_impl.h @@ -0,0 +1,84 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_CONNECTION_IMPL_H + +#include "google/cloud/visionai/v1/health_check_connection.h" +#include "google/cloud/visionai/v1/health_check_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/health_check_options.h" +#include "google/cloud/visionai/v1/internal/health_check_retry_traits.h" +#include "google/cloud/visionai/v1/internal/health_check_stub.h" +#include "google/cloud/background_threads.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HealthCheckServiceConnectionImpl + : public visionai_v1::HealthCheckServiceConnection { + public: + ~HealthCheckServiceConnectionImpl() override = default; + + HealthCheckServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + StatusOr HealthCheck( + google::cloud::visionai::v1::HealthCheckRequest const& request) 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_CONNECTION_IMPL_H diff --git a/google/cloud/visionai/v1/internal/health_check_logging_decorator.cc b/google/cloud/visionai/v1/internal/health_check_logging_decorator.cc new file mode 100644 index 0000000000000..b0d85f3645815 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_logging_decorator.cc @@ -0,0 +1,128 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#include "google/cloud/visionai/v1/internal/health_check_logging_decorator.h" +#include "google/cloud/visionai/v1/health_service.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HealthCheckServiceLogging::HealthCheckServiceLogging( + std::shared_ptr child, + TracingOptions tracing_options, std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +HealthCheckServiceLogging::HealthCheck( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::HealthCheckRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::HealthCheckRequest const& request) { + return child_->HealthCheck(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +HealthCheckServiceLogging::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 +HealthCheckServiceLogging::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 +HealthCheckServiceLogging::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 +HealthCheckServiceLogging::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 HealthCheckServiceLogging::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 HealthCheckServiceLogging::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_); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/health_check_logging_decorator.h b/google/cloud/visionai/v1/internal/health_check_logging_decorator.h new file mode 100644 index 0000000000000..f18034edb3187 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_logging_decorator.h @@ -0,0 +1,84 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_LOGGING_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/health_check_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HealthCheckServiceLogging : public HealthCheckServiceStub { + public: + ~HealthCheckServiceLogging() override = default; + HealthCheckServiceLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr HealthCheck( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::HealthCheckRequest 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; + + private: + std::shared_ptr child_; + TracingOptions tracing_options_; +}; // HealthCheckServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_LOGGING_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/health_check_metadata_decorator.cc b/google/cloud/visionai/v1/internal/health_check_metadata_decorator.cc new file mode 100644 index 0000000000000..7f920e385983a --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_metadata_decorator.cc @@ -0,0 +1,130 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#include "google/cloud/visionai/v1/internal/health_check_metadata_decorator.h" +#include "google/cloud/visionai/v1/health_service.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HealthCheckServiceMetadata::HealthCheckServiceMetadata( + 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 +HealthCheckServiceMetadata::HealthCheck( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::HealthCheckRequest const& request) { + SetMetadata(context, options, + absl::StrCat("cluster=", internal::UrlEncode(request.cluster()))); + return child_->HealthCheck(context, options, request); +} + +StatusOr +HealthCheckServiceMetadata::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 +HealthCheckServiceMetadata::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 +HealthCheckServiceMetadata::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 +HealthCheckServiceMetadata::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 HealthCheckServiceMetadata::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 HealthCheckServiceMetadata::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); +} + +void HealthCheckServiceMetadata::SetMetadata( + grpc::ClientContext& context, Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void HealthCheckServiceMetadata::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/health_check_metadata_decorator.h b/google/cloud/visionai/v1/internal/health_check_metadata_decorator.h new file mode 100644 index 0000000000000..1d7129bb3afc6 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_metadata_decorator.h @@ -0,0 +1,90 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_METADATA_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/health_check_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HealthCheckServiceMetadata : public HealthCheckServiceStub { + public: + ~HealthCheckServiceMetadata() override = default; + HealthCheckServiceMetadata( + std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr HealthCheck( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::HealthCheckRequest 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; + + 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_METADATA_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/health_check_option_defaults.cc b/google/cloud/visionai/v1/internal/health_check_option_defaults.cc new file mode 100644 index 0000000000000..d653f3632cec6 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_option_defaults.cc @@ -0,0 +1,69 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#include "google/cloud/visionai/v1/internal/health_check_option_defaults.h" +#include "google/cloud/visionai/v1/health_check_connection.h" +#include "google/cloud/visionai/v1/health_check_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 visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options HealthCheckServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_HEALTH_CHECK_SERVICE_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_HEALTH_CHECK_SERVICE_AUTHORITY", + "visionai.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + visionai_v1::HealthCheckServiceLimitedTimeRetryPolicy( + std::chrono::minutes(10)) + .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< + visionai_v1::HealthCheckServiceConnectionIdempotencyPolicyOption>()) { + options + .set( + visionai_v1:: + MakeDefaultHealthCheckServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/health_check_option_defaults.h b/google/cloud/visionai/v1/internal/health_check_option_defaults.h new file mode 100644 index 0000000000000..02596efb279bd --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options HealthCheckServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_OPTION_DEFAULTS_H diff --git a/google/cloud/visionai/v1/internal/health_check_retry_traits.h b/google/cloud/visionai/v1/internal/health_check_retry_traits.h new file mode 100644 index 0000000000000..ec65b5f80f968 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct HealthCheckServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_RETRY_TRAITS_H diff --git a/google/cloud/visionai/v1/internal/health_check_sources.cc b/google/cloud/visionai/v1/internal/health_check_sources.cc new file mode 100644 index 0000000000000..3819438ae8eb2 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/visionai/v1/health_check_client.cc" +#include "google/cloud/visionai/v1/health_check_connection.cc" +#include "google/cloud/visionai/v1/health_check_connection_idempotency_policy.cc" +#include "google/cloud/visionai/v1/internal/health_check_auth_decorator.cc" +#include "google/cloud/visionai/v1/internal/health_check_connection_impl.cc" +#include "google/cloud/visionai/v1/internal/health_check_logging_decorator.cc" +#include "google/cloud/visionai/v1/internal/health_check_metadata_decorator.cc" +#include "google/cloud/visionai/v1/internal/health_check_option_defaults.cc" +#include "google/cloud/visionai/v1/internal/health_check_stub.cc" +#include "google/cloud/visionai/v1/internal/health_check_stub_factory.cc" +#include "google/cloud/visionai/v1/internal/health_check_tracing_connection.cc" +#include "google/cloud/visionai/v1/internal/health_check_tracing_stub.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/visionai/v1/internal/health_check_stub.cc b/google/cloud/visionai/v1/internal/health_check_stub.cc new file mode 100644 index 0000000000000..29396e5122c81 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_stub.cc @@ -0,0 +1,123 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#include "google/cloud/visionai/v1/internal/health_check_stub.h" +#include "google/cloud/visionai/v1/health_service.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HealthCheckServiceStub::~HealthCheckServiceStub() = default; + +StatusOr +DefaultHealthCheckServiceStub::HealthCheck( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::HealthCheckRequest const& request) { + google::cloud::visionai::v1::HealthCheckResponse response; + auto status = grpc_stub_->HealthCheck(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultHealthCheckServiceStub::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 +DefaultHealthCheckServiceStub::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 +DefaultHealthCheckServiceStub::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 +DefaultHealthCheckServiceStub::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 DefaultHealthCheckServiceStub::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 DefaultHealthCheckServiceStub::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(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/health_check_stub.h b/google/cloud/visionai/v1/internal/health_check_stub.h new file mode 100644 index 0000000000000..90f8dc51da994 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_stub.h @@ -0,0 +1,133 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_STUB_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/health_service.grpc.pb.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HealthCheckServiceStub { + public: + virtual ~HealthCheckServiceStub() = 0; + + virtual StatusOr + HealthCheck( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::HealthCheckRequest 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; +}; + +class DefaultHealthCheckServiceStub : public HealthCheckServiceStub { + public: + explicit DefaultHealthCheckServiceStub( + std::unique_ptr< + google::cloud::visionai::v1::HealthCheckService::StubInterface> + grpc_stub, + std::unique_ptr + operations_stub, + std::unique_ptr + locations_stub) + : grpc_stub_(std::move(grpc_stub)), + operations_stub_(std::move(operations_stub)), + locations_stub_(std::move(locations_stub)) {} + + StatusOr HealthCheck( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::HealthCheckRequest 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; + + private: + std::unique_ptr< + google::cloud::visionai::v1::HealthCheckService::StubInterface> + grpc_stub_; + std::unique_ptr + operations_stub_; + std::unique_ptr + locations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_STUB_H diff --git a/google/cloud/visionai/v1/internal/health_check_stub_factory.cc b/google/cloud/visionai/v1/internal/health_check_stub_factory.cc new file mode 100644 index 0000000000000..2b2cf2cb16fcc --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_stub_factory.cc @@ -0,0 +1,84 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#include "google/cloud/visionai/v1/internal/health_check_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/health_service.grpc.pb.h" +#include "google/cloud/visionai/v1/internal/health_check_auth_decorator.h" +#include "google/cloud/visionai/v1/internal/health_check_logging_decorator.h" +#include "google/cloud/visionai/v1/internal/health_check_metadata_decorator.h" +#include "google/cloud/visionai/v1/internal/health_check_stub.h" +#include "google/cloud/visionai/v1/internal/health_check_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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultHealthCheckServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::visionai::v1::HealthCheckService::NewStub(channel); + auto service_operations_stub = + google::longrunning::Operations::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_operations_stub), + std::move(service_locations_stub)); + + 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 = MakeHealthCheckServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/health_check_stub_factory.h b/google/cloud/visionai/v1/internal/health_check_stub_factory.h new file mode 100644 index 0000000000000..bea5f402fe150 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_STUB_FACTORY_H + +#include "google/cloud/visionai/v1/internal/health_check_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultHealthCheckServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_STUB_FACTORY_H diff --git a/google/cloud/visionai/v1/internal/health_check_tracing_connection.cc b/google/cloud/visionai/v1/internal/health_check_tracing_connection.cc new file mode 100644 index 0000000000000..32aec101e4a0e --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_tracing_connection.cc @@ -0,0 +1,112 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#include "google/cloud/visionai/v1/internal/health_check_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HealthCheckServiceTracingConnection::HealthCheckServiceTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StatusOr +HealthCheckServiceTracingConnection::HealthCheck( + google::cloud::visionai::v1::HealthCheckRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::HealthCheckServiceConnection::HealthCheck"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->HealthCheck(request)); +} + +StreamRange +HealthCheckServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::HealthCheckServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +HealthCheckServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::HealthCheckServiceConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +HealthCheckServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::HealthCheckServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +HealthCheckServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::HealthCheckServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status HealthCheckServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::HealthCheckServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status HealthCheckServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::HealthCheckServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeHealthCheckServiceTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = + std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/health_check_tracing_connection.h b/google/cloud/visionai/v1/internal/health_check_tracing_connection.h new file mode 100644 index 0000000000000..5f3ec2f120d27 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_tracing_connection.h @@ -0,0 +1,81 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_TRACING_CONNECTION_H + +#include "google/cloud/visionai/v1/health_check_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HealthCheckServiceTracingConnection + : public visionai_v1::HealthCheckServiceConnection { + public: + ~HealthCheckServiceTracingConnection() override = default; + + explicit HealthCheckServiceTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StatusOr HealthCheck( + google::cloud::visionai::v1::HealthCheckRequest const& request) 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_; +}; + +/** + * 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 +MakeHealthCheckServiceTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_TRACING_CONNECTION_H diff --git a/google/cloud/visionai/v1/internal/health_check_tracing_stub.cc b/google/cloud/visionai/v1/internal/health_check_tracing_stub.cc new file mode 100644 index 0000000000000..c07705443f421 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_tracing_stub.cc @@ -0,0 +1,128 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#include "google/cloud/visionai/v1/internal/health_check_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +HealthCheckServiceTracingStub::HealthCheckServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +HealthCheckServiceTracingStub::HealthCheck( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::HealthCheckRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.HealthCheckService", "HealthCheck"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->HealthCheck(context, options, request)); +} + +StatusOr +HealthCheckServiceTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.HealthCheckService", "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +HealthCheckServiceTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.HealthCheckService", "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +HealthCheckServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.HealthCheckService", "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +HealthCheckServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.HealthCheckService", "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status HealthCheckServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.HealthCheckService", "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status HealthCheckServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.HealthCheckService", "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +std::shared_ptr MakeHealthCheckServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/health_check_tracing_stub.h b/google/cloud/visionai/v1/internal/health_check_tracing_stub.h new file mode 100644 index 0000000000000..a2d607ded3f21 --- /dev/null +++ b/google/cloud/visionai/v1/internal/health_check_tracing_stub.h @@ -0,0 +1,93 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_TRACING_STUB_H + +#include "google/cloud/visionai/v1/internal/health_check_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class HealthCheckServiceTracingStub : public HealthCheckServiceStub { + public: + ~HealthCheckServiceTracingStub() override = default; + + explicit HealthCheckServiceTracingStub( + std::shared_ptr child); + + StatusOr HealthCheck( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::HealthCheckRequest 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; + + private: + std::shared_ptr child_; + std::shared_ptr + propagator_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeHealthCheckServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_HEALTH_CHECK_TRACING_STUB_H diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_auth_decorator.cc b/google/cloud/visionai/v1/internal/live_video_analytics_auth_decorator.cc new file mode 100644 index 0000000000000..543c94d8901d3 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_auth_decorator.cc @@ -0,0 +1,481 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#include "google/cloud/visionai/v1/internal/live_video_analytics_auth_decorator.h" +#include "google/cloud/visionai/v1/lva_service.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +LiveVideoAnalyticsAuth::LiveVideoAnalyticsAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +LiveVideoAnalyticsAuth::ListPublicOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPublicOperatorsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListPublicOperators(context, options, request); +} + +StatusOr +LiveVideoAnalyticsAuth::ResolveOperatorInfo( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ResolveOperatorInfo(context, options, request); +} + +StatusOr +LiveVideoAnalyticsAuth::ListOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListOperatorsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListOperators(context, options, request); +} + +StatusOr +LiveVideoAnalyticsAuth::GetOperator( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetOperatorRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetOperator(context, options, request); +} + +future> +LiveVideoAnalyticsAuth::AsyncCreateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateOperatorRequest 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->AsyncCreateOperator(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr LiveVideoAnalyticsAuth::CreateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateOperator(context, options, request); +} + +future> +LiveVideoAnalyticsAuth::AsyncUpdateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateOperatorRequest 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->AsyncUpdateOperator(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr LiveVideoAnalyticsAuth::UpdateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateOperator(context, options, request); +} + +future> +LiveVideoAnalyticsAuth::AsyncDeleteOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteOperatorRequest 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->AsyncDeleteOperator(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr LiveVideoAnalyticsAuth::DeleteOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteOperator(context, options, request); +} + +StatusOr +LiveVideoAnalyticsAuth::ListAnalyses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnalysesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListAnalyses(context, options, request); +} + +StatusOr +LiveVideoAnalyticsAuth::GetAnalysis( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnalysisRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetAnalysis(context, options, request); +} + +future> +LiveVideoAnalyticsAuth::AsyncCreateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateAnalysisRequest 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->AsyncCreateAnalysis(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr LiveVideoAnalyticsAuth::CreateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateAnalysis(context, options, request); +} + +future> +LiveVideoAnalyticsAuth::AsyncUpdateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateAnalysisRequest 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->AsyncUpdateAnalysis(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr LiveVideoAnalyticsAuth::UpdateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateAnalysis(context, options, request); +} + +future> +LiveVideoAnalyticsAuth::AsyncDeleteAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAnalysisRequest 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->AsyncDeleteAnalysis(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr LiveVideoAnalyticsAuth::DeleteAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteAnalysis(context, options, request); +} + +StatusOr +LiveVideoAnalyticsAuth::ListProcesses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListProcesses(context, options, request); +} + +StatusOr +LiveVideoAnalyticsAuth::GetProcess( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetProcess(context, options, request); +} + +future> +LiveVideoAnalyticsAuth::AsyncCreateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessRequest 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->AsyncCreateProcess(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr LiveVideoAnalyticsAuth::CreateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateProcess(context, options, request); +} + +future> +LiveVideoAnalyticsAuth::AsyncUpdateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessRequest 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->AsyncUpdateProcess(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr LiveVideoAnalyticsAuth::UpdateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateProcess(context, options, request); +} + +future> +LiveVideoAnalyticsAuth::AsyncDeleteProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessRequest 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->AsyncDeleteProcess(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr LiveVideoAnalyticsAuth::DeleteProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteProcess(context, options, request); +} + +future> +LiveVideoAnalyticsAuth::AsyncBatchRunProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::BatchRunProcessRequest 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->AsyncBatchRunProcess(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +LiveVideoAnalyticsAuth::BatchRunProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->BatchRunProcess(context, options, request); +} + +StatusOr +LiveVideoAnalyticsAuth::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 LiveVideoAnalyticsAuth::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 +LiveVideoAnalyticsAuth::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 LiveVideoAnalyticsAuth::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 LiveVideoAnalyticsAuth::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 LiveVideoAnalyticsAuth::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> +LiveVideoAnalyticsAuth::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 LiveVideoAnalyticsAuth::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_auth_decorator.h b/google/cloud/visionai/v1/internal/live_video_analytics_auth_decorator.h new file mode 100644 index 0000000000000..e052706aee327 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_auth_decorator.h @@ -0,0 +1,251 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_AUTH_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/live_video_analytics_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class LiveVideoAnalyticsAuth : public LiveVideoAnalyticsStub { + public: + ~LiveVideoAnalyticsAuth() override = default; + LiveVideoAnalyticsAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr + ListPublicOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPublicOperatorsRequest const& request) + override; + + StatusOr + ResolveOperatorInfo( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) + override; + + StatusOr ListOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListOperatorsRequest const& request) + override; + + StatusOr GetOperator( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetOperatorRequest const& request) override; + + future> AsyncCreateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + StatusOr CreateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + future> AsyncUpdateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + StatusOr UpdateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + future> AsyncDeleteOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) + override; + + StatusOr DeleteOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) + override; + + StatusOr ListAnalyses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnalysesRequest const& request) override; + + StatusOr GetAnalysis( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnalysisRequest const& request) override; + + future> AsyncCreateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + StatusOr CreateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + future> AsyncUpdateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + StatusOr UpdateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + future> AsyncDeleteAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) + override; + + StatusOr DeleteAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) + override; + + StatusOr ListProcesses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessesRequest const& request) + override; + + StatusOr GetProcess( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessRequest const& request) override; + + future> AsyncCreateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + StatusOr CreateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + future> AsyncUpdateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + StatusOr UpdateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + future> AsyncDeleteProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) + override; + + StatusOr DeleteProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) + override; + + future> AsyncBatchRunProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) + override; + + StatusOr BatchRunProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::BatchRunProcessRequest 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_AUTH_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_connection_impl.cc b/google/cloud/visionai/v1/internal/live_video_analytics_connection_impl.cc new file mode 100644 index 0000000000000..7d85e2da34f18 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_connection_impl.cc @@ -0,0 +1,1299 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#include "google/cloud/visionai/v1/internal/live_video_analytics_connection_impl.h" +#include "google/cloud/visionai/v1/internal/live_video_analytics_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 visionai_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 + +LiveVideoAnalyticsConnectionImpl::LiveVideoAnalyticsConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions( + std::move(options), LiveVideoAnalyticsConnection::options())) {} + +StreamRange +LiveVideoAnalyticsConnectionImpl::ListPublicOperators( + google::cloud::visionai::v1::ListPublicOperatorsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListPublicOperators(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::visionai::v1::ListPublicOperatorsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPublicOperatorsRequest const& + request) { + return stub->ListPublicOperators(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListPublicOperatorsResponse r) { + std::vector result( + r.operators().size()); + auto& messages = *r.mutable_operators(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::ResolveOperatorInfo( + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ResolveOperatorInfo(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& + request) { + return stub_->ResolveOperatorInfo(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +LiveVideoAnalyticsConnectionImpl::ListOperators( + google::cloud::visionai::v1::ListOperatorsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListOperators(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::visionai::v1::ListOperatorsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListOperatorsRequest const& + request) { + return stub->ListOperators(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListOperatorsResponse r) { + std::vector result( + r.operators().size()); + auto& messages = *r.mutable_operators(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::GetOperator( + google::cloud::visionai::v1::GetOperatorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetOperator(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetOperatorRequest const& request) { + return stub_->GetOperator(context, options, request); + }, + *current, request, __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::CreateOperator( + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateOperator(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Operator>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + return stub->AsyncCreateOperator(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::visionai::v1::Operator>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::CreateOperator( + NoAwaitTag, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateOperator(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + return stub_->CreateOperator(context, options, request); + }, + *current, request, __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::CreateOperator( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateOperator", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Operator>( + 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::visionai::v1::Operator>, + polling_policy(*current), __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::UpdateOperator( + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateOperator(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Operator>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + return stub->AsyncUpdateOperator(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::visionai::v1::Operator>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::UpdateOperator( + NoAwaitTag, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateOperator(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + return stub_->UpdateOperator(context, options, request); + }, + *current, request, __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::UpdateOperator( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateOperator", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Operator>( + 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::visionai::v1::Operator>, + polling_policy(*current), __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::DeleteOperator( + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteOperator(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::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::visionai::v1::DeleteOperatorRequest const& request) { + return stub->AsyncDeleteOperator(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::visionai::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::DeleteOperator( + NoAwaitTag, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteOperator(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + return stub_->DeleteOperator(context, options, request); + }, + *current, request, __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::DeleteOperator( + 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 DeleteOperator", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::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::visionai::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +LiveVideoAnalyticsConnectionImpl::ListAnalyses( + google::cloud::visionai::v1::ListAnalysesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListAnalyses(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::visionai::v1::ListAnalysesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnalysesRequest const& + request) { + return stub->ListAnalyses(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListAnalysesResponse r) { + std::vector result( + r.analyses().size()); + auto& messages = *r.mutable_analyses(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::GetAnalysis( + google::cloud::visionai::v1::GetAnalysisRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetAnalysis(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnalysisRequest const& request) { + return stub_->GetAnalysis(context, options, request); + }, + *current, request, __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::CreateAnalysis( + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateAnalysis(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Analysis>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + return stub->AsyncCreateAnalysis(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::visionai::v1::Analysis>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::CreateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateAnalysis(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + return stub_->CreateAnalysis(context, options, request); + }, + *current, request, __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::CreateAnalysis( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateAnalysis", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Analysis>( + 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::visionai::v1::Analysis>, + polling_policy(*current), __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::UpdateAnalysis( + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateAnalysis(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Analysis>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + return stub->AsyncUpdateAnalysis(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::visionai::v1::Analysis>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::UpdateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateAnalysis(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + return stub_->UpdateAnalysis(context, options, request); + }, + *current, request, __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::UpdateAnalysis( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateAnalysis", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Analysis>( + 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::visionai::v1::Analysis>, + polling_policy(*current), __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::DeleteAnalysis( + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteAnalysis(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::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::visionai::v1::DeleteAnalysisRequest const& request) { + return stub->AsyncDeleteAnalysis(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::visionai::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::DeleteAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteAnalysis(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + return stub_->DeleteAnalysis(context, options, request); + }, + *current, request, __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::DeleteAnalysis( + 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 DeleteAnalysis", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::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::visionai::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +LiveVideoAnalyticsConnectionImpl::ListProcesses( + google::cloud::visionai::v1::ListProcessesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListProcesses(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::visionai::v1::ListProcessesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessesRequest const& + request) { + return stub->ListProcesses(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListProcessesResponse r) { + std::vector result( + r.processes().size()); + auto& messages = *r.mutable_processes(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::GetProcess( + google::cloud::visionai::v1::GetProcessRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetProcess(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessRequest const& request) { + return stub_->GetProcess(context, options, request); + }, + *current, request, __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::CreateProcess( + google::cloud::visionai::v1::CreateProcessRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateProcess(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Process>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + return stub->AsyncCreateProcess(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::visionai::v1::Process>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::CreateProcess( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateProcess(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + return stub_->CreateProcess(context, options, request); + }, + *current, request, __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::CreateProcess( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateProcess", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Process>( + 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::visionai::v1::Process>, + polling_policy(*current), __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::UpdateProcess( + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateProcess(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Process>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + return stub->AsyncUpdateProcess(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::visionai::v1::Process>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::UpdateProcess( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateProcess(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + return stub_->UpdateProcess(context, options, request); + }, + *current, request, __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::UpdateProcess( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateProcess", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Process>( + 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::visionai::v1::Process>, + polling_policy(*current), __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::DeleteProcess( + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteProcess(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::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::visionai::v1::DeleteProcessRequest const& request) { + return stub->AsyncDeleteProcess(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::visionai::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::DeleteProcess( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteProcess(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + return stub_->DeleteProcess(context, options, request); + }, + *current, request, __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::DeleteProcess( + 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 DeleteProcess", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::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::visionai::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::BatchRunProcess( + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->BatchRunProcess(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::BatchRunProcessResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + return stub->AsyncBatchRunProcess(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::visionai::v1::BatchRunProcessResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +LiveVideoAnalyticsConnectionImpl::BatchRunProcess( + NoAwaitTag, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->BatchRunProcess(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + return stub_->BatchRunProcess(context, options, request); + }, + *current, request, __func__); +} + +future> +LiveVideoAnalyticsConnectionImpl::BatchRunProcess( + 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 BatchRunProcess", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::BatchRunProcessResponse>( + 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::visionai::v1::BatchRunProcessResponse>, + polling_policy(*current), __func__); +} + +StreamRange +LiveVideoAnalyticsConnectionImpl::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 +LiveVideoAnalyticsConnectionImpl::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 +LiveVideoAnalyticsConnectionImpl::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 +LiveVideoAnalyticsConnectionImpl::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 LiveVideoAnalyticsConnectionImpl::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 LiveVideoAnalyticsConnectionImpl::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 visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_connection_impl.h b/google/cloud/visionai/v1/internal/live_video_analytics_connection_impl.h new file mode 100644 index 0000000000000..94d02cbea7654 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_connection_impl.h @@ -0,0 +1,230 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_CONNECTION_IMPL_H + +#include "google/cloud/visionai/v1/internal/live_video_analytics_retry_traits.h" +#include "google/cloud/visionai/v1/internal/live_video_analytics_stub.h" +#include "google/cloud/visionai/v1/live_video_analytics_connection.h" +#include "google/cloud/visionai/v1/live_video_analytics_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/live_video_analytics_options.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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class LiveVideoAnalyticsConnectionImpl + : public visionai_v1::LiveVideoAnalyticsConnection { + public: + ~LiveVideoAnalyticsConnectionImpl() override = default; + + LiveVideoAnalyticsConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + StreamRange ListPublicOperators( + google::cloud::visionai::v1::ListPublicOperatorsRequest request) override; + + StatusOr + ResolveOperatorInfo( + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) + override; + + StreamRange ListOperators( + google::cloud::visionai::v1::ListOperatorsRequest request) override; + + StatusOr GetOperator( + google::cloud::visionai::v1::GetOperatorRequest const& request) override; + + future> CreateOperator( + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + StatusOr CreateOperator( + NoAwaitTag, + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + future> CreateOperator( + google::longrunning::Operation const& operation) override; + + future> UpdateOperator( + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + StatusOr UpdateOperator( + NoAwaitTag, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + future> UpdateOperator( + google::longrunning::Operation const& operation) override; + + future> + DeleteOperator(google::cloud::visionai::v1::DeleteOperatorRequest const& + request) override; + + StatusOr DeleteOperator( + NoAwaitTag, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) + override; + + future> + DeleteOperator(google::longrunning::Operation const& operation) override; + + StreamRange ListAnalyses( + google::cloud::visionai::v1::ListAnalysesRequest request) override; + + StatusOr GetAnalysis( + google::cloud::visionai::v1::GetAnalysisRequest const& request) override; + + future> CreateAnalysis( + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + StatusOr CreateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + future> CreateAnalysis( + google::longrunning::Operation const& operation) override; + + future> UpdateAnalysis( + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + StatusOr UpdateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + future> UpdateAnalysis( + google::longrunning::Operation const& operation) override; + + future> + DeleteAnalysis(google::cloud::visionai::v1::DeleteAnalysisRequest const& + request) override; + + StatusOr DeleteAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) + override; + + future> + DeleteAnalysis(google::longrunning::Operation const& operation) override; + + StreamRange ListProcesses( + google::cloud::visionai::v1::ListProcessesRequest request) override; + + StatusOr GetProcess( + google::cloud::visionai::v1::GetProcessRequest const& request) override; + + future> CreateProcess( + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + StatusOr CreateProcess( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + future> CreateProcess( + google::longrunning::Operation const& operation) override; + + future> UpdateProcess( + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + StatusOr UpdateProcess( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + future> UpdateProcess( + google::longrunning::Operation const& operation) override; + + future> + DeleteProcess(google::cloud::visionai::v1::DeleteProcessRequest const& + request) override; + + StatusOr DeleteProcess( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessRequest const& request) + override; + + future> + DeleteProcess(google::longrunning::Operation const& operation) override; + + future> + BatchRunProcess(google::cloud::visionai::v1::BatchRunProcessRequest const& + request) override; + + StatusOr BatchRunProcess( + NoAwaitTag, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) + override; + + future> + BatchRunProcess(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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_CONNECTION_IMPL_H diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_logging_decorator.cc b/google/cloud/visionai/v1/internal/live_video_analytics_logging_decorator.cc new file mode 100644 index 0000000000000..922e71634d243 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_logging_decorator.cc @@ -0,0 +1,563 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#include "google/cloud/visionai/v1/internal/live_video_analytics_logging_decorator.h" +#include "google/cloud/visionai/v1/lva_service.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +LiveVideoAnalyticsLogging::LiveVideoAnalyticsLogging( + std::shared_ptr child, + TracingOptions tracing_options, std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +LiveVideoAnalyticsLogging::ListPublicOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPublicOperatorsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPublicOperatorsRequest const& + request) { + return child_->ListPublicOperators(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::ResolveOperatorInfo( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& + request) { + return child_->ResolveOperatorInfo(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::ListOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListOperatorsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListOperatorsRequest const& request) { + return child_->ListOperators(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::GetOperator( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetOperatorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetOperatorRequest const& request) { + return child_->GetOperator(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +LiveVideoAnalyticsLogging::AsyncCreateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + return child_->AsyncCreateOperator(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::CreateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + return child_->CreateOperator(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +LiveVideoAnalyticsLogging::AsyncUpdateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + return child_->AsyncUpdateOperator(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::UpdateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + return child_->UpdateOperator(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +LiveVideoAnalyticsLogging::AsyncDeleteOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + return child_->AsyncDeleteOperator(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::DeleteOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + return child_->DeleteOperator(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::ListAnalyses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnalysesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnalysesRequest const& request) { + return child_->ListAnalyses(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::GetAnalysis( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnalysisRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnalysisRequest const& request) { + return child_->GetAnalysis(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +LiveVideoAnalyticsLogging::AsyncCreateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + return child_->AsyncCreateAnalysis(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::CreateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + return child_->CreateAnalysis(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +LiveVideoAnalyticsLogging::AsyncUpdateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + return child_->AsyncUpdateAnalysis(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::UpdateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + return child_->UpdateAnalysis(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +LiveVideoAnalyticsLogging::AsyncDeleteAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + return child_->AsyncDeleteAnalysis(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::DeleteAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + return child_->DeleteAnalysis(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::ListProcesses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessesRequest const& request) { + return child_->ListProcesses(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::GetProcess( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessRequest const& request) { + return child_->GetProcess(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +LiveVideoAnalyticsLogging::AsyncCreateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + return child_->AsyncCreateProcess(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::CreateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + return child_->CreateProcess(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +LiveVideoAnalyticsLogging::AsyncUpdateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + return child_->AsyncUpdateProcess(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::UpdateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + return child_->UpdateProcess(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +LiveVideoAnalyticsLogging::AsyncDeleteProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + return child_->AsyncDeleteProcess(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::DeleteProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + return child_->DeleteProcess(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +LiveVideoAnalyticsLogging::AsyncBatchRunProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + return child_->AsyncBatchRunProcess(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::BatchRunProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + return child_->BatchRunProcess(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +LiveVideoAnalyticsLogging::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 +LiveVideoAnalyticsLogging::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 +LiveVideoAnalyticsLogging::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 +LiveVideoAnalyticsLogging::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 LiveVideoAnalyticsLogging::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 LiveVideoAnalyticsLogging::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> +LiveVideoAnalyticsLogging::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 LiveVideoAnalyticsLogging::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_logging_decorator.h b/google/cloud/visionai/v1/internal/live_video_analytics_logging_decorator.h new file mode 100644 index 0000000000000..72a7edf2fbc81 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_logging_decorator.h @@ -0,0 +1,251 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_LOGGING_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/live_video_analytics_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class LiveVideoAnalyticsLogging : public LiveVideoAnalyticsStub { + public: + ~LiveVideoAnalyticsLogging() override = default; + LiveVideoAnalyticsLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr + ListPublicOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPublicOperatorsRequest const& request) + override; + + StatusOr + ResolveOperatorInfo( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) + override; + + StatusOr ListOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListOperatorsRequest const& request) + override; + + StatusOr GetOperator( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetOperatorRequest const& request) override; + + future> AsyncCreateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + StatusOr CreateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + future> AsyncUpdateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + StatusOr UpdateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + future> AsyncDeleteOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) + override; + + StatusOr DeleteOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) + override; + + StatusOr ListAnalyses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnalysesRequest const& request) override; + + StatusOr GetAnalysis( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnalysisRequest const& request) override; + + future> AsyncCreateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + StatusOr CreateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + future> AsyncUpdateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + StatusOr UpdateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + future> AsyncDeleteAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) + override; + + StatusOr DeleteAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) + override; + + StatusOr ListProcesses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessesRequest const& request) + override; + + StatusOr GetProcess( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessRequest const& request) override; + + future> AsyncCreateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + StatusOr CreateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + future> AsyncUpdateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + StatusOr UpdateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + future> AsyncDeleteProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) + override; + + StatusOr DeleteProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) + override; + + future> AsyncBatchRunProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) + override; + + StatusOr BatchRunProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::BatchRunProcessRequest 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_; +}; // LiveVideoAnalyticsLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_LOGGING_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_metadata_decorator.cc b/google/cloud/visionai/v1/internal/live_video_analytics_metadata_decorator.cc new file mode 100644 index 0000000000000..f5b07a8350212 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_metadata_decorator.cc @@ -0,0 +1,432 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#include "google/cloud/visionai/v1/internal/live_video_analytics_metadata_decorator.h" +#include "google/cloud/visionai/v1/lva_service.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +LiveVideoAnalyticsMetadata::LiveVideoAnalyticsMetadata( + 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 +LiveVideoAnalyticsMetadata::ListPublicOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPublicOperatorsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListPublicOperators(context, options, request); +} + +StatusOr +LiveVideoAnalyticsMetadata::ResolveOperatorInfo( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ResolveOperatorInfo(context, options, request); +} + +StatusOr +LiveVideoAnalyticsMetadata::ListOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListOperatorsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListOperators(context, options, request); +} + +StatusOr +LiveVideoAnalyticsMetadata::GetOperator( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetOperatorRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetOperator(context, options, request); +} + +future> +LiveVideoAnalyticsMetadata::AsyncCreateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateOperator(cq, std::move(context), std::move(options), + request); +} + +StatusOr +LiveVideoAnalyticsMetadata::CreateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateOperator(context, options, request); +} + +future> +LiveVideoAnalyticsMetadata::AsyncUpdateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("operator.name=", + internal::UrlEncode(request.operator_().name()))); + return child_->AsyncUpdateOperator(cq, std::move(context), std::move(options), + request); +} + +StatusOr +LiveVideoAnalyticsMetadata::UpdateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + SetMetadata(context, options, + absl::StrCat("operator.name=", + internal::UrlEncode(request.operator_().name()))); + return child_->UpdateOperator(context, options, request); +} + +future> +LiveVideoAnalyticsMetadata::AsyncDeleteOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteOperator(cq, std::move(context), std::move(options), + request); +} + +StatusOr +LiveVideoAnalyticsMetadata::DeleteOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteOperator(context, options, request); +} + +StatusOr +LiveVideoAnalyticsMetadata::ListAnalyses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnalysesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListAnalyses(context, options, request); +} + +StatusOr +LiveVideoAnalyticsMetadata::GetAnalysis( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnalysisRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetAnalysis(context, options, request); +} + +future> +LiveVideoAnalyticsMetadata::AsyncCreateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateAnalysis(cq, std::move(context), std::move(options), + request); +} + +StatusOr +LiveVideoAnalyticsMetadata::CreateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateAnalysis(context, options, request); +} + +future> +LiveVideoAnalyticsMetadata::AsyncUpdateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("analysis.name=", + internal::UrlEncode(request.analysis().name()))); + return child_->AsyncUpdateAnalysis(cq, std::move(context), std::move(options), + request); +} + +StatusOr +LiveVideoAnalyticsMetadata::UpdateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + SetMetadata(context, options, + absl::StrCat("analysis.name=", + internal::UrlEncode(request.analysis().name()))); + return child_->UpdateAnalysis(context, options, request); +} + +future> +LiveVideoAnalyticsMetadata::AsyncDeleteAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteAnalysis(cq, std::move(context), std::move(options), + request); +} + +StatusOr +LiveVideoAnalyticsMetadata::DeleteAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteAnalysis(context, options, request); +} + +StatusOr +LiveVideoAnalyticsMetadata::ListProcesses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListProcesses(context, options, request); +} + +StatusOr +LiveVideoAnalyticsMetadata::GetProcess( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetProcess(context, options, request); +} + +future> +LiveVideoAnalyticsMetadata::AsyncCreateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateProcess(cq, std::move(context), std::move(options), + request); +} + +StatusOr +LiveVideoAnalyticsMetadata::CreateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateProcess(context, options, request); +} + +future> +LiveVideoAnalyticsMetadata::AsyncUpdateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("process.name=", + internal::UrlEncode(request.process().name()))); + return child_->AsyncUpdateProcess(cq, std::move(context), std::move(options), + request); +} + +StatusOr +LiveVideoAnalyticsMetadata::UpdateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + SetMetadata(context, options, + absl::StrCat("process.name=", + internal::UrlEncode(request.process().name()))); + return child_->UpdateProcess(context, options, request); +} + +future> +LiveVideoAnalyticsMetadata::AsyncDeleteProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteProcess(cq, std::move(context), std::move(options), + request); +} + +StatusOr +LiveVideoAnalyticsMetadata::DeleteProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteProcess(context, options, request); +} + +future> +LiveVideoAnalyticsMetadata::AsyncBatchRunProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncBatchRunProcess(cq, std::move(context), + std::move(options), request); +} + +StatusOr +LiveVideoAnalyticsMetadata::BatchRunProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->BatchRunProcess(context, options, request); +} + +StatusOr +LiveVideoAnalyticsMetadata::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 +LiveVideoAnalyticsMetadata::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 +LiveVideoAnalyticsMetadata::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 +LiveVideoAnalyticsMetadata::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 LiveVideoAnalyticsMetadata::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 LiveVideoAnalyticsMetadata::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> +LiveVideoAnalyticsMetadata::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 LiveVideoAnalyticsMetadata::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 LiveVideoAnalyticsMetadata::SetMetadata( + grpc::ClientContext& context, Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void LiveVideoAnalyticsMetadata::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_metadata_decorator.h b/google/cloud/visionai/v1/internal/live_video_analytics_metadata_decorator.h new file mode 100644 index 0000000000000..958d465bec3e4 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_metadata_decorator.h @@ -0,0 +1,257 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_METADATA_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/live_video_analytics_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class LiveVideoAnalyticsMetadata : public LiveVideoAnalyticsStub { + public: + ~LiveVideoAnalyticsMetadata() override = default; + LiveVideoAnalyticsMetadata( + std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr + ListPublicOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPublicOperatorsRequest const& request) + override; + + StatusOr + ResolveOperatorInfo( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) + override; + + StatusOr ListOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListOperatorsRequest const& request) + override; + + StatusOr GetOperator( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetOperatorRequest const& request) override; + + future> AsyncCreateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + StatusOr CreateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + future> AsyncUpdateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + StatusOr UpdateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + future> AsyncDeleteOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) + override; + + StatusOr DeleteOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) + override; + + StatusOr ListAnalyses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnalysesRequest const& request) override; + + StatusOr GetAnalysis( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnalysisRequest const& request) override; + + future> AsyncCreateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + StatusOr CreateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + future> AsyncUpdateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + StatusOr UpdateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + future> AsyncDeleteAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) + override; + + StatusOr DeleteAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) + override; + + StatusOr ListProcesses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessesRequest const& request) + override; + + StatusOr GetProcess( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessRequest const& request) override; + + future> AsyncCreateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + StatusOr CreateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + future> AsyncUpdateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + StatusOr UpdateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + future> AsyncDeleteProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) + override; + + StatusOr DeleteProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) + override; + + future> AsyncBatchRunProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) + override; + + StatusOr BatchRunProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::BatchRunProcessRequest 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_METADATA_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_option_defaults.cc b/google/cloud/visionai/v1/internal/live_video_analytics_option_defaults.cc new file mode 100644 index 0000000000000..9166f06d8bb51 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_option_defaults.cc @@ -0,0 +1,81 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#include "google/cloud/visionai/v1/internal/live_video_analytics_option_defaults.h" +#include "google/cloud/visionai/v1/live_video_analytics_connection.h" +#include "google/cloud/visionai/v1/live_video_analytics_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 visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options LiveVideoAnalyticsDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_LIVE_VIDEO_ANALYTICS_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_LIVE_VIDEO_ANALYTICS_AUTHORITY", + "visionai.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + visionai_v1::LiveVideoAnalyticsLimitedTimeRetryPolicy( + std::chrono::minutes(10)) + .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< + visionai_v1::LiveVideoAnalyticsRetryPolicyOption::Type, + visionai_v1::LiveVideoAnalyticsBackoffPolicyOption::Type>( + options.get() + ->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } + if (!options.has< + visionai_v1::LiveVideoAnalyticsConnectionIdempotencyPolicyOption>()) { + options + .set( + visionai_v1:: + MakeDefaultLiveVideoAnalyticsConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_option_defaults.h b/google/cloud/visionai/v1/internal/live_video_analytics_option_defaults.h new file mode 100644 index 0000000000000..7f9a487c75094 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options LiveVideoAnalyticsDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_OPTION_DEFAULTS_H diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_retry_traits.h b/google/cloud/visionai/v1/internal/live_video_analytics_retry_traits.h new file mode 100644 index 0000000000000..79b0879fec195 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct LiveVideoAnalyticsRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_RETRY_TRAITS_H diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_sources.cc b/google/cloud/visionai/v1/internal/live_video_analytics_sources.cc new file mode 100644 index 0000000000000..7703539d556d0 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/visionai/v1/internal/live_video_analytics_auth_decorator.cc" +#include "google/cloud/visionai/v1/internal/live_video_analytics_connection_impl.cc" +#include "google/cloud/visionai/v1/internal/live_video_analytics_logging_decorator.cc" +#include "google/cloud/visionai/v1/internal/live_video_analytics_metadata_decorator.cc" +#include "google/cloud/visionai/v1/internal/live_video_analytics_option_defaults.cc" +#include "google/cloud/visionai/v1/internal/live_video_analytics_stub.cc" +#include "google/cloud/visionai/v1/internal/live_video_analytics_stub_factory.cc" +#include "google/cloud/visionai/v1/internal/live_video_analytics_tracing_connection.cc" +#include "google/cloud/visionai/v1/internal/live_video_analytics_tracing_stub.cc" +#include "google/cloud/visionai/v1/live_video_analytics_client.cc" +#include "google/cloud/visionai/v1/live_video_analytics_connection.cc" +#include "google/cloud/visionai/v1/live_video_analytics_connection_idempotency_policy.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_stub.cc b/google/cloud/visionai/v1/internal/live_video_analytics_stub.cc new file mode 100644 index 0000000000000..f28b50225aa99 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_stub.cc @@ -0,0 +1,547 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#include "google/cloud/visionai/v1/internal/live_video_analytics_stub.h" +#include "google/cloud/visionai/v1/lva_service.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +LiveVideoAnalyticsStub::~LiveVideoAnalyticsStub() = default; + +StatusOr +DefaultLiveVideoAnalyticsStub::ListPublicOperators( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListPublicOperatorsRequest const& request) { + google::cloud::visionai::v1::ListPublicOperatorsResponse response; + auto status = grpc_stub_->ListPublicOperators(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultLiveVideoAnalyticsStub::ResolveOperatorInfo( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) { + google::cloud::visionai::v1::ResolveOperatorInfoResponse response; + auto status = grpc_stub_->ResolveOperatorInfo(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultLiveVideoAnalyticsStub::ListOperators( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListOperatorsRequest const& request) { + google::cloud::visionai::v1::ListOperatorsResponse response; + auto status = grpc_stub_->ListOperators(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultLiveVideoAnalyticsStub::GetOperator( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetOperatorRequest const& request) { + google::cloud::visionai::v1::Operator response; + auto status = grpc_stub_->GetOperator(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultLiveVideoAnalyticsStub::AsyncCreateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateOperatorRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::CreateOperatorRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateOperator(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultLiveVideoAnalyticsStub::CreateOperator( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateOperator(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultLiveVideoAnalyticsStub::AsyncUpdateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateOperatorRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UpdateOperatorRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateOperator(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultLiveVideoAnalyticsStub::UpdateOperator( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateOperator(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultLiveVideoAnalyticsStub::AsyncDeleteOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteOperatorRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteOperatorRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteOperator(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultLiveVideoAnalyticsStub::DeleteOperator( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteOperator(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultLiveVideoAnalyticsStub::ListAnalyses( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListAnalysesRequest const& request) { + google::cloud::visionai::v1::ListAnalysesResponse response; + auto status = grpc_stub_->ListAnalyses(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultLiveVideoAnalyticsStub::GetAnalysis( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetAnalysisRequest const& request) { + google::cloud::visionai::v1::Analysis response; + auto status = grpc_stub_->GetAnalysis(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultLiveVideoAnalyticsStub::AsyncCreateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateAnalysisRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::CreateAnalysisRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateAnalysis(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultLiveVideoAnalyticsStub::CreateAnalysis( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateAnalysis(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultLiveVideoAnalyticsStub::AsyncUpdateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateAnalysisRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateAnalysis(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultLiveVideoAnalyticsStub::UpdateAnalysis( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateAnalysis(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultLiveVideoAnalyticsStub::AsyncDeleteAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteAnalysisRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteAnalysis(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultLiveVideoAnalyticsStub::DeleteAnalysis( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteAnalysis(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultLiveVideoAnalyticsStub::ListProcesses( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListProcessesRequest const& request) { + google::cloud::visionai::v1::ListProcessesResponse response; + auto status = grpc_stub_->ListProcesses(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultLiveVideoAnalyticsStub::GetProcess( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetProcessRequest const& request) { + google::cloud::visionai::v1::Process response; + auto status = grpc_stub_->GetProcess(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultLiveVideoAnalyticsStub::AsyncCreateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateProcessRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::CreateProcessRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateProcess(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultLiveVideoAnalyticsStub::CreateProcess( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateProcess(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultLiveVideoAnalyticsStub::AsyncUpdateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateProcessRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UpdateProcessRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateProcess(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultLiveVideoAnalyticsStub::UpdateProcess( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateProcess(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultLiveVideoAnalyticsStub::AsyncDeleteProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteProcessRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteProcessRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteProcess(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultLiveVideoAnalyticsStub::DeleteProcess( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteProcess(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultLiveVideoAnalyticsStub::AsyncBatchRunProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::BatchRunProcessRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::BatchRunProcessRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncBatchRunProcess(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultLiveVideoAnalyticsStub::BatchRunProcess( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->BatchRunProcess(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultLiveVideoAnalyticsStub::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 +DefaultLiveVideoAnalyticsStub::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 +DefaultLiveVideoAnalyticsStub::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 +DefaultLiveVideoAnalyticsStub::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 DefaultLiveVideoAnalyticsStub::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 DefaultLiveVideoAnalyticsStub::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> +DefaultLiveVideoAnalyticsStub::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 DefaultLiveVideoAnalyticsStub::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_stub.h b/google/cloud/visionai/v1/internal/live_video_analytics_stub.h new file mode 100644 index 0000000000000..8fb25b9314c97 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_stub.h @@ -0,0 +1,447 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_STUB_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/lva_service.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class LiveVideoAnalyticsStub { + public: + virtual ~LiveVideoAnalyticsStub() = 0; + + virtual StatusOr + ListPublicOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPublicOperatorsRequest const& + request) = 0; + + virtual StatusOr + ResolveOperatorInfo( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& + request) = 0; + + virtual StatusOr + ListOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListOperatorsRequest const& request) = 0; + + virtual StatusOr GetOperator( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetOperatorRequest const& request) = 0; + + virtual future> AsyncCreateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) = 0; + + virtual StatusOr CreateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) = 0; + + virtual future> AsyncUpdateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) = 0; + + virtual StatusOr UpdateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) = 0; + + virtual future> AsyncDeleteOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) = 0; + + virtual StatusOr DeleteOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) = 0; + + virtual StatusOr + ListAnalyses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnalysesRequest const& request) = 0; + + virtual StatusOr GetAnalysis( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnalysisRequest const& request) = 0; + + virtual future> AsyncCreateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) = 0; + + virtual StatusOr CreateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) = 0; + + virtual future> AsyncUpdateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) = 0; + + virtual StatusOr UpdateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) = 0; + + virtual future> AsyncDeleteAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) = 0; + + virtual StatusOr DeleteAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) = 0; + + virtual StatusOr + ListProcesses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessesRequest const& request) = 0; + + virtual StatusOr GetProcess( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessRequest const& request) = 0; + + virtual future> AsyncCreateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessRequest const& request) = 0; + + virtual StatusOr CreateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessRequest const& request) = 0; + + virtual future> AsyncUpdateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) = 0; + + virtual StatusOr UpdateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) = 0; + + virtual future> AsyncDeleteProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) = 0; + + virtual StatusOr DeleteProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) = 0; + + virtual future> AsyncBatchRunProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) = 0; + + virtual StatusOr BatchRunProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::BatchRunProcessRequest 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 DefaultLiveVideoAnalyticsStub : public LiveVideoAnalyticsStub { + public: + DefaultLiveVideoAnalyticsStub( + std::unique_ptr< + google::cloud::visionai::v1::LiveVideoAnalytics::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 + ListPublicOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPublicOperatorsRequest const& request) + override; + + StatusOr + ResolveOperatorInfo( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) + override; + + StatusOr ListOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListOperatorsRequest const& request) + override; + + StatusOr GetOperator( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetOperatorRequest const& request) override; + + future> AsyncCreateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + StatusOr CreateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + future> AsyncUpdateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + StatusOr UpdateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + future> AsyncDeleteOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) + override; + + StatusOr DeleteOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) + override; + + StatusOr ListAnalyses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnalysesRequest const& request) override; + + StatusOr GetAnalysis( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnalysisRequest const& request) override; + + future> AsyncCreateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + StatusOr CreateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + future> AsyncUpdateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + StatusOr UpdateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + future> AsyncDeleteAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) + override; + + StatusOr DeleteAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) + override; + + StatusOr ListProcesses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessesRequest const& request) + override; + + StatusOr GetProcess( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessRequest const& request) override; + + future> AsyncCreateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + StatusOr CreateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + future> AsyncUpdateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + StatusOr UpdateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + future> AsyncDeleteProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) + override; + + StatusOr DeleteProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) + override; + + future> AsyncBatchRunProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) + override; + + StatusOr BatchRunProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::BatchRunProcessRequest 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::visionai::v1::LiveVideoAnalytics::StubInterface> + grpc_stub_; + std::unique_ptr + locations_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_STUB_H diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_stub_factory.cc b/google/cloud/visionai/v1/internal/live_video_analytics_stub_factory.cc new file mode 100644 index 0000000000000..60929393a1bd9 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_stub_factory.cc @@ -0,0 +1,82 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#include "google/cloud/visionai/v1/internal/live_video_analytics_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/internal/live_video_analytics_auth_decorator.h" +#include "google/cloud/visionai/v1/internal/live_video_analytics_logging_decorator.h" +#include "google/cloud/visionai/v1/internal/live_video_analytics_metadata_decorator.h" +#include "google/cloud/visionai/v1/internal/live_video_analytics_stub.h" +#include "google/cloud/visionai/v1/internal/live_video_analytics_tracing_stub.h" +#include "google/cloud/visionai/v1/lva_service.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultLiveVideoAnalyticsStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::visionai::v1::LiveVideoAnalytics::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 = MakeLiveVideoAnalyticsTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_stub_factory.h b/google/cloud/visionai/v1/internal/live_video_analytics_stub_factory.h new file mode 100644 index 0000000000000..df59ae5bcf9c8 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_STUB_FACTORY_H + +#include "google/cloud/visionai/v1/internal/live_video_analytics_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultLiveVideoAnalyticsStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_STUB_FACTORY_H diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_tracing_connection.cc b/google/cloud/visionai/v1/internal/live_video_analytics_tracing_connection.cc new file mode 100644 index 0000000000000..03b0e872f78f4 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_tracing_connection.cc @@ -0,0 +1,470 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#include "google/cloud/visionai/v1/internal/live_video_analytics_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +LiveVideoAnalyticsTracingConnection::LiveVideoAnalyticsTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StreamRange +LiveVideoAnalyticsTracingConnection::ListPublicOperators( + google::cloud::visionai::v1::ListPublicOperatorsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::ListPublicOperators"); + internal::OTelScope scope(span); + auto sr = child_->ListPublicOperators(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::ResolveOperatorInfo( + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::ResolveOperatorInfo"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->ResolveOperatorInfo(request)); +} + +StreamRange +LiveVideoAnalyticsTracingConnection::ListOperators( + google::cloud::visionai::v1::ListOperatorsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::ListOperators"); + internal::OTelScope scope(span); + auto sr = child_->ListOperators(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::GetOperator( + google::cloud::visionai::v1::GetOperatorRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::GetOperator"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperator(request)); +} + +future> +LiveVideoAnalyticsTracingConnection::CreateOperator( + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::CreateOperator"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateOperator(request)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::CreateOperator( + NoAwaitTag, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::CreateOperator"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateOperator(NoAwaitTag{}, request)); +} + +future> +LiveVideoAnalyticsTracingConnection::CreateOperator( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::CreateOperator"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateOperator(operation)); +} + +future> +LiveVideoAnalyticsTracingConnection::UpdateOperator( + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::UpdateOperator"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateOperator(request)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::UpdateOperator( + NoAwaitTag, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::UpdateOperator"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateOperator(NoAwaitTag{}, request)); +} + +future> +LiveVideoAnalyticsTracingConnection::UpdateOperator( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::UpdateOperator"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateOperator(operation)); +} + +future> +LiveVideoAnalyticsTracingConnection::DeleteOperator( + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::DeleteOperator"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteOperator(request)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::DeleteOperator( + NoAwaitTag, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::DeleteOperator"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteOperator(NoAwaitTag{}, request)); +} + +future> +LiveVideoAnalyticsTracingConnection::DeleteOperator( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::DeleteOperator"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteOperator(operation)); +} + +StreamRange +LiveVideoAnalyticsTracingConnection::ListAnalyses( + google::cloud::visionai::v1::ListAnalysesRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::ListAnalyses"); + internal::OTelScope scope(span); + auto sr = child_->ListAnalyses(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::GetAnalysis( + google::cloud::visionai::v1::GetAnalysisRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::GetAnalysis"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetAnalysis(request)); +} + +future> +LiveVideoAnalyticsTracingConnection::CreateAnalysis( + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::CreateAnalysis"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateAnalysis(request)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::CreateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::CreateAnalysis"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateAnalysis(NoAwaitTag{}, request)); +} + +future> +LiveVideoAnalyticsTracingConnection::CreateAnalysis( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::CreateAnalysis"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateAnalysis(operation)); +} + +future> +LiveVideoAnalyticsTracingConnection::UpdateAnalysis( + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::UpdateAnalysis"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateAnalysis(request)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::UpdateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::UpdateAnalysis"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateAnalysis(NoAwaitTag{}, request)); +} + +future> +LiveVideoAnalyticsTracingConnection::UpdateAnalysis( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::UpdateAnalysis"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateAnalysis(operation)); +} + +future> +LiveVideoAnalyticsTracingConnection::DeleteAnalysis( + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::DeleteAnalysis"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteAnalysis(request)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::DeleteAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::DeleteAnalysis"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteAnalysis(NoAwaitTag{}, request)); +} + +future> +LiveVideoAnalyticsTracingConnection::DeleteAnalysis( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::DeleteAnalysis"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteAnalysis(operation)); +} + +StreamRange +LiveVideoAnalyticsTracingConnection::ListProcesses( + google::cloud::visionai::v1::ListProcessesRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::ListProcesses"); + internal::OTelScope scope(span); + auto sr = child_->ListProcesses(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::GetProcess( + google::cloud::visionai::v1::GetProcessRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::GetProcess"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetProcess(request)); +} + +future> +LiveVideoAnalyticsTracingConnection::CreateProcess( + google::cloud::visionai::v1::CreateProcessRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::CreateProcess"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateProcess(request)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::CreateProcess( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::CreateProcess"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateProcess(NoAwaitTag{}, request)); +} + +future> +LiveVideoAnalyticsTracingConnection::CreateProcess( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::CreateProcess"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateProcess(operation)); +} + +future> +LiveVideoAnalyticsTracingConnection::UpdateProcess( + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::UpdateProcess"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateProcess(request)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::UpdateProcess( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::UpdateProcess"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateProcess(NoAwaitTag{}, request)); +} + +future> +LiveVideoAnalyticsTracingConnection::UpdateProcess( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::UpdateProcess"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateProcess(operation)); +} + +future> +LiveVideoAnalyticsTracingConnection::DeleteProcess( + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::DeleteProcess"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteProcess(request)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::DeleteProcess( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::DeleteProcess"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteProcess(NoAwaitTag{}, request)); +} + +future> +LiveVideoAnalyticsTracingConnection::DeleteProcess( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::DeleteProcess"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteProcess(operation)); +} + +future> +LiveVideoAnalyticsTracingConnection::BatchRunProcess( + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::BatchRunProcess"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->BatchRunProcess(request)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::BatchRunProcess( + NoAwaitTag, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::BatchRunProcess"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->BatchRunProcess(NoAwaitTag{}, request)); +} + +future> +LiveVideoAnalyticsTracingConnection::BatchRunProcess( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::BatchRunProcess"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->BatchRunProcess(operation)); +} + +StreamRange +LiveVideoAnalyticsTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +LiveVideoAnalyticsTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +LiveVideoAnalyticsTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status LiveVideoAnalyticsTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status LiveVideoAnalyticsTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::LiveVideoAnalyticsConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeLiveVideoAnalyticsTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = + std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_tracing_connection.h b/google/cloud/visionai/v1/internal/live_video_analytics_tracing_connection.h new file mode 100644 index 0000000000000..840d4d7522e98 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_tracing_connection.h @@ -0,0 +1,224 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_TRACING_CONNECTION_H + +#include "google/cloud/visionai/v1/live_video_analytics_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class LiveVideoAnalyticsTracingConnection + : public visionai_v1::LiveVideoAnalyticsConnection { + public: + ~LiveVideoAnalyticsTracingConnection() override = default; + + explicit LiveVideoAnalyticsTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StreamRange ListPublicOperators( + google::cloud::visionai::v1::ListPublicOperatorsRequest request) override; + + StatusOr + ResolveOperatorInfo( + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) + override; + + StreamRange ListOperators( + google::cloud::visionai::v1::ListOperatorsRequest request) override; + + StatusOr GetOperator( + google::cloud::visionai::v1::GetOperatorRequest const& request) override; + + future> CreateOperator( + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + StatusOr CreateOperator( + NoAwaitTag, + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + future> CreateOperator( + google::longrunning::Operation const& operation) override; + + future> UpdateOperator( + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + StatusOr UpdateOperator( + NoAwaitTag, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + future> UpdateOperator( + google::longrunning::Operation const& operation) override; + + future> + DeleteOperator(google::cloud::visionai::v1::DeleteOperatorRequest const& + request) override; + + StatusOr DeleteOperator( + NoAwaitTag, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) + override; + + future> + DeleteOperator(google::longrunning::Operation const& operation) override; + + StreamRange ListAnalyses( + google::cloud::visionai::v1::ListAnalysesRequest request) override; + + StatusOr GetAnalysis( + google::cloud::visionai::v1::GetAnalysisRequest const& request) override; + + future> CreateAnalysis( + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + StatusOr CreateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + future> CreateAnalysis( + google::longrunning::Operation const& operation) override; + + future> UpdateAnalysis( + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + StatusOr UpdateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + future> UpdateAnalysis( + google::longrunning::Operation const& operation) override; + + future> + DeleteAnalysis(google::cloud::visionai::v1::DeleteAnalysisRequest const& + request) override; + + StatusOr DeleteAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) + override; + + future> + DeleteAnalysis(google::longrunning::Operation const& operation) override; + + StreamRange ListProcesses( + google::cloud::visionai::v1::ListProcessesRequest request) override; + + StatusOr GetProcess( + google::cloud::visionai::v1::GetProcessRequest const& request) override; + + future> CreateProcess( + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + StatusOr CreateProcess( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + future> CreateProcess( + google::longrunning::Operation const& operation) override; + + future> UpdateProcess( + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + StatusOr UpdateProcess( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + future> UpdateProcess( + google::longrunning::Operation const& operation) override; + + future> + DeleteProcess(google::cloud::visionai::v1::DeleteProcessRequest const& + request) override; + + StatusOr DeleteProcess( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessRequest const& request) + override; + + future> + DeleteProcess(google::longrunning::Operation const& operation) override; + + future> + BatchRunProcess(google::cloud::visionai::v1::BatchRunProcessRequest const& + request) override; + + StatusOr BatchRunProcess( + NoAwaitTag, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) + override; + + future> + BatchRunProcess(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_; +}; + +/** + * 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 +MakeLiveVideoAnalyticsTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_TRACING_CONNECTION_H diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_tracing_stub.cc b/google/cloud/visionai/v1/internal/live_video_analytics_tracing_stub.cc new file mode 100644 index 0000000000000..b7b1c2fd82427 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_tracing_stub.cc @@ -0,0 +1,507 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#include "google/cloud/visionai/v1/internal/live_video_analytics_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +LiveVideoAnalyticsTracingStub::LiveVideoAnalyticsTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +LiveVideoAnalyticsTracingStub::ListPublicOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPublicOperatorsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "ListPublicOperators"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListPublicOperators(context, options, request)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::ResolveOperatorInfo( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "ResolveOperatorInfo"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ResolveOperatorInfo(context, options, request)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::ListOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListOperatorsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "ListOperators"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperators(context, options, request)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::GetOperator( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetOperatorRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "GetOperator"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperator(context, options, request)); +} + +future> +LiveVideoAnalyticsTracingStub::AsyncCreateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "CreateOperator"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateOperator(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::CreateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "CreateOperator"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateOperator(context, options, request)); +} + +future> +LiveVideoAnalyticsTracingStub::AsyncUpdateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "UpdateOperator"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateOperator(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::UpdateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "UpdateOperator"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateOperator(context, options, request)); +} + +future> +LiveVideoAnalyticsTracingStub::AsyncDeleteOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "DeleteOperator"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteOperator(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::DeleteOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "DeleteOperator"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperator(context, options, request)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::ListAnalyses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnalysesRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "ListAnalyses"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListAnalyses(context, options, request)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::GetAnalysis( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnalysisRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "GetAnalysis"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetAnalysis(context, options, request)); +} + +future> +LiveVideoAnalyticsTracingStub::AsyncCreateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "CreateAnalysis"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateAnalysis(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::CreateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "CreateAnalysis"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateAnalysis(context, options, request)); +} + +future> +LiveVideoAnalyticsTracingStub::AsyncUpdateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "UpdateAnalysis"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateAnalysis(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::UpdateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "UpdateAnalysis"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateAnalysis(context, options, request)); +} + +future> +LiveVideoAnalyticsTracingStub::AsyncDeleteAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "DeleteAnalysis"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteAnalysis(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::DeleteAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "DeleteAnalysis"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteAnalysis(context, options, request)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::ListProcesses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessesRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "ListProcesses"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListProcesses(context, options, request)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::GetProcess( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "GetProcess"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetProcess(context, options, request)); +} + +future> +LiveVideoAnalyticsTracingStub::AsyncCreateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "CreateProcess"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateProcess(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::CreateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "CreateProcess"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateProcess(context, options, request)); +} + +future> +LiveVideoAnalyticsTracingStub::AsyncUpdateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "UpdateProcess"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateProcess(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::UpdateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "UpdateProcess"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateProcess(context, options, request)); +} + +future> +LiveVideoAnalyticsTracingStub::AsyncDeleteProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "DeleteProcess"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteProcess(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::DeleteProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "DeleteProcess"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteProcess(context, options, request)); +} + +future> +LiveVideoAnalyticsTracingStub::AsyncBatchRunProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "BatchRunProcess"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncBatchRunProcess(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::BatchRunProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "BatchRunProcess"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->BatchRunProcess(context, options, request)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +LiveVideoAnalyticsTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status LiveVideoAnalyticsTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status LiveVideoAnalyticsTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.LiveVideoAnalytics", "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +LiveVideoAnalyticsTracingStub::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 LiveVideoAnalyticsTracingStub::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)); +} + +std::shared_ptr MakeLiveVideoAnalyticsTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/live_video_analytics_tracing_stub.h b/google/cloud/visionai/v1/internal/live_video_analytics_tracing_stub.h new file mode 100644 index 0000000000000..d1f86cc5d1441 --- /dev/null +++ b/google/cloud/visionai/v1/internal/live_video_analytics_tracing_stub.h @@ -0,0 +1,259 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_TRACING_STUB_H + +#include "google/cloud/visionai/v1/internal/live_video_analytics_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class LiveVideoAnalyticsTracingStub : public LiveVideoAnalyticsStub { + public: + ~LiveVideoAnalyticsTracingStub() override = default; + + explicit LiveVideoAnalyticsTracingStub( + std::shared_ptr child); + + StatusOr + ListPublicOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListPublicOperatorsRequest const& request) + override; + + StatusOr + ResolveOperatorInfo( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request) + override; + + StatusOr ListOperators( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListOperatorsRequest const& request) + override; + + StatusOr GetOperator( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetOperatorRequest const& request) override; + + future> AsyncCreateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + StatusOr CreateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateOperatorRequest const& request) + override; + + future> AsyncUpdateOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + StatusOr UpdateOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateOperatorRequest const& request) + override; + + future> AsyncDeleteOperator( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) + override; + + StatusOr DeleteOperator( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteOperatorRequest const& request) + override; + + StatusOr ListAnalyses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnalysesRequest const& request) override; + + StatusOr GetAnalysis( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnalysisRequest const& request) override; + + future> AsyncCreateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + StatusOr CreateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateAnalysisRequest const& request) + override; + + future> AsyncUpdateAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + StatusOr UpdateAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request) + override; + + future> AsyncDeleteAnalysis( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) + override; + + StatusOr DeleteAnalysis( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request) + override; + + StatusOr ListProcesses( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListProcessesRequest const& request) + override; + + StatusOr GetProcess( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetProcessRequest const& request) override; + + future> AsyncCreateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + StatusOr CreateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateProcessRequest const& request) + override; + + future> AsyncUpdateProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + StatusOr UpdateProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateProcessRequest const& request) + override; + + future> AsyncDeleteProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) + override; + + StatusOr DeleteProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteProcessRequest const& request) + override; + + future> AsyncBatchRunProcess( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::BatchRunProcessRequest const& request) + override; + + StatusOr BatchRunProcess( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::BatchRunProcessRequest 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_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeLiveVideoAnalyticsTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_LIVE_VIDEO_ANALYTICS_TRACING_STUB_H diff --git a/google/cloud/visionai/v1/internal/streaming_auth_decorator.cc b/google/cloud/visionai/v1/internal/streaming_auth_decorator.cc new file mode 100644 index 0000000000000..9170e13724c6f --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_auth_decorator.cc @@ -0,0 +1,175 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#include "google/cloud/visionai/v1/internal/streaming_auth_decorator.h" +#include "google/cloud/visionai/v1/streaming_service.grpc.pb.h" +#include "google/cloud/internal/async_read_write_stream_auth.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamingServiceAuth::StreamingServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> +StreamingServiceAuth::AsyncSendPackets( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + using StreamAuth = google::cloud::internal::AsyncStreamingReadWriteRpcAuth< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>; + + auto call = [child = child_, cq, options = std::move(options)]( + std::shared_ptr ctx) { + return child->AsyncSendPackets(cq, std::move(ctx), options); + }; + return std::make_unique( + std::move(context), auth_, StreamAuth::StreamFactory(std::move(call))); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> +StreamingServiceAuth::AsyncReceivePackets( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + using StreamAuth = google::cloud::internal::AsyncStreamingReadWriteRpcAuth< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>; + + auto call = [child = child_, cq, options = std::move(options)]( + std::shared_ptr ctx) { + return child->AsyncReceivePackets(cq, std::move(ctx), options); + }; + return std::make_unique( + std::move(context), auth_, StreamAuth::StreamFactory(std::move(call))); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> +StreamingServiceAuth::AsyncReceiveEvents( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + using StreamAuth = google::cloud::internal::AsyncStreamingReadWriteRpcAuth< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>; + + auto call = [child = child_, cq, options = std::move(options)]( + std::shared_ptr ctx) { + return child->AsyncReceiveEvents(cq, std::move(ctx), options); + }; + return std::make_unique( + std::move(context), auth_, StreamAuth::StreamFactory(std::move(call))); +} + +StatusOr StreamingServiceAuth::AcquireLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AcquireLeaseRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->AcquireLease(context, options, request); +} + +StatusOr StreamingServiceAuth::RenewLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RenewLeaseRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->RenewLease(context, options, request); +} + +StatusOr +StreamingServiceAuth::ReleaseLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ReleaseLeaseRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ReleaseLease(context, options, request); +} + +StatusOr +StreamingServiceAuth::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 StreamingServiceAuth::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 +StreamingServiceAuth::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 StreamingServiceAuth::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 StreamingServiceAuth::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 StreamingServiceAuth::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); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/streaming_auth_decorator.h b/google/cloud/visionai/v1/internal/streaming_auth_decorator.h new file mode 100644 index 0000000000000..b7be26f89dcd2 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_auth_decorator.h @@ -0,0 +1,115 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_AUTH_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/streaming_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamingServiceAuth : public StreamingServiceStub { + public: + ~StreamingServiceAuth() override = default; + StreamingServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> + AsyncSendPackets(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> + AsyncReceivePackets( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> + AsyncReceiveEvents( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + StatusOr AcquireLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AcquireLeaseRequest const& request) override; + + StatusOr RenewLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RenewLeaseRequest const& request) override; + + StatusOr ReleaseLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ReleaseLeaseRequest 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; + + private: + std::shared_ptr auth_; + std::shared_ptr child_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_AUTH_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/streaming_connection_impl.cc b/google/cloud/visionai/v1/internal/streaming_connection_impl.cc new file mode 100644 index 0000000000000..af0df64183e42 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_connection_impl.cc @@ -0,0 +1,256 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#include "google/cloud/visionai/v1/internal/streaming_connection_impl.h" +#include "google/cloud/visionai/v1/internal/streaming_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/pagination_range.h" +#include "google/cloud/internal/retry_loop.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_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(); +} + +} // namespace + +StreamingServiceConnectionImpl::StreamingServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions(std::move(options), + StreamingServiceConnection::options())) {} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> +StreamingServiceConnectionImpl::AsyncSendPackets() { + return stub_->AsyncSendPackets(background_->cq(), + std::make_shared(), + internal::SaveCurrentOptions()); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> +StreamingServiceConnectionImpl::AsyncReceivePackets() { + return stub_->AsyncReceivePackets(background_->cq(), + std::make_shared(), + internal::SaveCurrentOptions()); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> +StreamingServiceConnectionImpl::AsyncReceiveEvents() { + return stub_->AsyncReceiveEvents(background_->cq(), + std::make_shared(), + internal::SaveCurrentOptions()); +} + +StatusOr +StreamingServiceConnectionImpl::AcquireLease( + google::cloud::visionai::v1::AcquireLeaseRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->AcquireLease(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AcquireLeaseRequest const& request) { + return stub_->AcquireLease(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +StreamingServiceConnectionImpl::RenewLease( + google::cloud::visionai::v1::RenewLeaseRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->RenewLease(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RenewLeaseRequest const& request) { + return stub_->RenewLease(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +StreamingServiceConnectionImpl::ReleaseLease( + google::cloud::visionai::v1::ReleaseLeaseRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ReleaseLease(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ReleaseLeaseRequest const& request) { + return stub_->ReleaseLease(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +StreamingServiceConnectionImpl::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 +StreamingServiceConnectionImpl::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 +StreamingServiceConnectionImpl::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 +StreamingServiceConnectionImpl::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 StreamingServiceConnectionImpl::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 StreamingServiceConnectionImpl::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 visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/streaming_connection_impl.h b/google/cloud/visionai/v1/internal/streaming_connection_impl.h new file mode 100644 index 0000000000000..489defda39373 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_connection_impl.h @@ -0,0 +1,106 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_CONNECTION_IMPL_H + +#include "google/cloud/visionai/v1/internal/streaming_retry_traits.h" +#include "google/cloud/visionai/v1/internal/streaming_stub.h" +#include "google/cloud/visionai/v1/streaming_connection.h" +#include "google/cloud/visionai/v1/streaming_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/streaming_options.h" +#include "google/cloud/async_streaming_read_write_rpc.h" +#include "google/cloud/background_threads.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamingServiceConnectionImpl + : public visionai_v1::StreamingServiceConnection { + public: + ~StreamingServiceConnectionImpl() override = default; + + StreamingServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> + AsyncSendPackets() override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> + AsyncReceivePackets() override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> + AsyncReceiveEvents() override; + + StatusOr AcquireLease( + google::cloud::visionai::v1::AcquireLeaseRequest const& request) override; + + StatusOr RenewLease( + google::cloud::visionai::v1::RenewLeaseRequest const& request) override; + + StatusOr ReleaseLease( + google::cloud::visionai::v1::ReleaseLeaseRequest const& request) 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_CONNECTION_IMPL_H diff --git a/google/cloud/visionai/v1/internal/streaming_logging_decorator.cc b/google/cloud/visionai/v1/internal/streaming_logging_decorator.cc new file mode 100644 index 0000000000000..a2701ff0afd68 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_logging_decorator.cc @@ -0,0 +1,223 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#include "google/cloud/visionai/v1/internal/streaming_logging_decorator.h" +#include "google/cloud/visionai/v1/streaming_service.grpc.pb.h" +#include "google/cloud/internal/async_read_write_stream_logging.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamingServiceLogging::StreamingServiceLogging( + std::shared_ptr child, TracingOptions tracing_options, + std::set const& components) + : child_(std::move(child)), + tracing_options_(std::move(tracing_options)), + stream_logging_(components.find("rpc-streams") != components.end()) {} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> +StreamingServiceLogging::AsyncSendPackets( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + using LoggingStream = + ::google::cloud::internal::AsyncStreamingReadWriteRpcLogging< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>; + + auto request_id = google::cloud::internal::RequestIdForLogging(); + GCP_LOG(DEBUG) << __func__ << "(" << request_id << ")"; + auto stream = + child_->AsyncSendPackets(cq, std::move(context), std::move(options)); + if (stream_logging_) { + stream = std::make_unique( + std::move(stream), tracing_options_, std::move(request_id)); + } + return stream; +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> +StreamingServiceLogging::AsyncReceivePackets( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + using LoggingStream = + ::google::cloud::internal::AsyncStreamingReadWriteRpcLogging< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>; + + auto request_id = google::cloud::internal::RequestIdForLogging(); + GCP_LOG(DEBUG) << __func__ << "(" << request_id << ")"; + auto stream = + child_->AsyncReceivePackets(cq, std::move(context), std::move(options)); + if (stream_logging_) { + stream = std::make_unique( + std::move(stream), tracing_options_, std::move(request_id)); + } + return stream; +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> +StreamingServiceLogging::AsyncReceiveEvents( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + using LoggingStream = + ::google::cloud::internal::AsyncStreamingReadWriteRpcLogging< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>; + + auto request_id = google::cloud::internal::RequestIdForLogging(); + GCP_LOG(DEBUG) << __func__ << "(" << request_id << ")"; + auto stream = + child_->AsyncReceiveEvents(cq, std::move(context), std::move(options)); + if (stream_logging_) { + stream = std::make_unique( + std::move(stream), tracing_options_, std::move(request_id)); + } + return stream; +} + +StatusOr +StreamingServiceLogging::AcquireLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AcquireLeaseRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AcquireLeaseRequest const& request) { + return child_->AcquireLease(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +StreamingServiceLogging::RenewLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RenewLeaseRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RenewLeaseRequest const& request) { + return child_->RenewLease(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +StreamingServiceLogging::ReleaseLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ReleaseLeaseRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ReleaseLeaseRequest const& request) { + return child_->ReleaseLease(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +StreamingServiceLogging::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 +StreamingServiceLogging::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 +StreamingServiceLogging::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 StreamingServiceLogging::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 StreamingServiceLogging::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 StreamingServiceLogging::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_); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/streaming_logging_decorator.h b/google/cloud/visionai/v1/internal/streaming_logging_decorator.h new file mode 100644 index 0000000000000..781ac96aae4df --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_logging_decorator.h @@ -0,0 +1,116 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_LOGGING_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/streaming_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamingServiceLogging : public StreamingServiceStub { + public: + ~StreamingServiceLogging() override = default; + StreamingServiceLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> + AsyncSendPackets(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> + AsyncReceivePackets( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> + AsyncReceiveEvents( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + StatusOr AcquireLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AcquireLeaseRequest const& request) override; + + StatusOr RenewLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RenewLeaseRequest const& request) override; + + StatusOr ReleaseLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ReleaseLeaseRequest 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; + + private: + std::shared_ptr child_; + TracingOptions tracing_options_; + bool stream_logging_; +}; // StreamingServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_LOGGING_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/streaming_metadata_decorator.cc b/google/cloud/visionai/v1/internal/streaming_metadata_decorator.cc new file mode 100644 index 0000000000000..9b9116452344f --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_metadata_decorator.cc @@ -0,0 +1,181 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#include "google/cloud/visionai/v1/internal/streaming_metadata_decorator.h" +#include "google/cloud/visionai/v1/streaming_service.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamingServiceMetadata::StreamingServiceMetadata( + 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)) {} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> +StreamingServiceMetadata::AsyncSendPackets( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + SetMetadata(*context, *options); + return child_->AsyncSendPackets(cq, std::move(context), std::move(options)); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> +StreamingServiceMetadata::AsyncReceivePackets( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + SetMetadata(*context, *options); + return child_->AsyncReceivePackets(cq, std::move(context), + std::move(options)); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> +StreamingServiceMetadata::AsyncReceiveEvents( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + SetMetadata(*context, *options); + return child_->AsyncReceiveEvents(cq, std::move(context), std::move(options)); +} + +StatusOr +StreamingServiceMetadata::AcquireLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AcquireLeaseRequest const& request) { + SetMetadata(context, options, + absl::StrCat("series=", internal::UrlEncode(request.series()))); + return child_->AcquireLease(context, options, request); +} + +StatusOr +StreamingServiceMetadata::RenewLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RenewLeaseRequest const& request) { + SetMetadata(context, options, + absl::StrCat("series=", internal::UrlEncode(request.series()))); + return child_->RenewLease(context, options, request); +} + +StatusOr +StreamingServiceMetadata::ReleaseLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ReleaseLeaseRequest const& request) { + SetMetadata(context, options, + absl::StrCat("series=", internal::UrlEncode(request.series()))); + return child_->ReleaseLease(context, options, request); +} + +StatusOr +StreamingServiceMetadata::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 +StreamingServiceMetadata::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 +StreamingServiceMetadata::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 StreamingServiceMetadata::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 StreamingServiceMetadata::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 StreamingServiceMetadata::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); +} + +void StreamingServiceMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void StreamingServiceMetadata::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/streaming_metadata_decorator.h b/google/cloud/visionai/v1/internal/streaming_metadata_decorator.h new file mode 100644 index 0000000000000..760023b49d40f --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_metadata_decorator.h @@ -0,0 +1,121 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_METADATA_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/streaming_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamingServiceMetadata : public StreamingServiceStub { + public: + ~StreamingServiceMetadata() override = default; + StreamingServiceMetadata( + std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> + AsyncSendPackets(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> + AsyncReceivePackets( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> + AsyncReceiveEvents( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + StatusOr AcquireLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AcquireLeaseRequest const& request) override; + + StatusOr RenewLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RenewLeaseRequest const& request) override; + + StatusOr ReleaseLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ReleaseLeaseRequest 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; + + 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_METADATA_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/streaming_option_defaults.cc b/google/cloud/visionai/v1/internal/streaming_option_defaults.cc new file mode 100644 index 0000000000000..10be9bd5b880d --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_option_defaults.cc @@ -0,0 +1,67 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#include "google/cloud/visionai/v1/internal/streaming_option_defaults.h" +#include "google/cloud/visionai/v1/streaming_connection.h" +#include "google/cloud/visionai/v1/streaming_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 visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options StreamingServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_STREAMING_SERVICE_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_STREAMING_SERVICE_AUTHORITY", + "visionai.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + visionai_v1::StreamingServiceLimitedTimeRetryPolicy( + std::chrono::minutes(10)) + .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< + visionai_v1::StreamingServiceConnectionIdempotencyPolicyOption>()) { + options.set( + visionai_v1::MakeDefaultStreamingServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/streaming_option_defaults.h b/google/cloud/visionai/v1/internal/streaming_option_defaults.h new file mode 100644 index 0000000000000..adab9875cf5d6 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options StreamingServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_OPTION_DEFAULTS_H diff --git a/google/cloud/visionai/v1/internal/streaming_retry_traits.h b/google/cloud/visionai/v1/internal/streaming_retry_traits.h new file mode 100644 index 0000000000000..737e6795dbc49 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct StreamingServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_RETRY_TRAITS_H diff --git a/google/cloud/visionai/v1/internal/streaming_sources.cc b/google/cloud/visionai/v1/internal/streaming_sources.cc new file mode 100644 index 0000000000000..aa9f99ef90f58 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/visionai/v1/internal/streaming_auth_decorator.cc" +#include "google/cloud/visionai/v1/internal/streaming_connection_impl.cc" +#include "google/cloud/visionai/v1/internal/streaming_logging_decorator.cc" +#include "google/cloud/visionai/v1/internal/streaming_metadata_decorator.cc" +#include "google/cloud/visionai/v1/internal/streaming_option_defaults.cc" +#include "google/cloud/visionai/v1/internal/streaming_stub.cc" +#include "google/cloud/visionai/v1/internal/streaming_stub_factory.cc" +#include "google/cloud/visionai/v1/internal/streaming_tracing_connection.cc" +#include "google/cloud/visionai/v1/internal/streaming_tracing_stub.cc" +#include "google/cloud/visionai/v1/streaming_client.cc" +#include "google/cloud/visionai/v1/streaming_connection.cc" +#include "google/cloud/visionai/v1/streaming_connection_idempotency_policy.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/visionai/v1/internal/streaming_stub.cc b/google/cloud/visionai/v1/internal/streaming_stub.cc new file mode 100644 index 0000000000000..2b5d77d409456 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_stub.cc @@ -0,0 +1,196 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#include "google/cloud/visionai/v1/internal/streaming_stub.h" +#include "google/cloud/visionai/v1/streaming_service.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/internal/async_read_write_stream_impl.h" +#include "google/cloud/status_or.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamingServiceStub::~StreamingServiceStub() = default; + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> +DefaultStreamingServiceStub::AsyncSendPackets( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + return google::cloud::internal::MakeStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>( + cq, std::move(context), std::move(options), + [this](grpc::ClientContext* context, grpc::CompletionQueue* cq) { + return grpc_stub_->PrepareAsyncSendPackets(context, cq); + }); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> +DefaultStreamingServiceStub::AsyncReceivePackets( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + return google::cloud::internal::MakeStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>( + cq, std::move(context), std::move(options), + [this](grpc::ClientContext* context, grpc::CompletionQueue* cq) { + return grpc_stub_->PrepareAsyncReceivePackets(context, cq); + }); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> +DefaultStreamingServiceStub::AsyncReceiveEvents( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + return google::cloud::internal::MakeStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>( + cq, std::move(context), std::move(options), + [this](grpc::ClientContext* context, grpc::CompletionQueue* cq) { + return grpc_stub_->PrepareAsyncReceiveEvents(context, cq); + }); +} + +StatusOr +DefaultStreamingServiceStub::AcquireLease( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::AcquireLeaseRequest const& request) { + google::cloud::visionai::v1::Lease response; + auto status = grpc_stub_->AcquireLease(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultStreamingServiceStub::RenewLease( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::RenewLeaseRequest const& request) { + google::cloud::visionai::v1::Lease response; + auto status = grpc_stub_->RenewLease(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultStreamingServiceStub::ReleaseLease( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ReleaseLeaseRequest const& request) { + google::cloud::visionai::v1::ReleaseLeaseResponse response; + auto status = grpc_stub_->ReleaseLease(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultStreamingServiceStub::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 +DefaultStreamingServiceStub::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 +DefaultStreamingServiceStub::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 +DefaultStreamingServiceStub::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 DefaultStreamingServiceStub::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 DefaultStreamingServiceStub::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(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/streaming_stub.h b/google/cloud/visionai/v1/internal/streaming_stub.h new file mode 100644 index 0000000000000..7e5bd8fef5c28 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_stub.h @@ -0,0 +1,194 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_STUB_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/streaming_service.grpc.pb.h" +#include "google/cloud/async_streaming_read_write_rpc.h" +#include "google/cloud/completion_queue.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamingServiceStub { + public: + virtual ~StreamingServiceStub() = 0; + + virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> + AsyncSendPackets(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) = 0; + + virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> + AsyncReceivePackets(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) = 0; + + virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> + AsyncReceiveEvents(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) = 0; + + virtual StatusOr AcquireLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AcquireLeaseRequest const& request) = 0; + + virtual StatusOr RenewLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RenewLeaseRequest const& request) = 0; + + virtual StatusOr + ReleaseLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ReleaseLeaseRequest 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; +}; + +class DefaultStreamingServiceStub : public StreamingServiceStub { + public: + explicit DefaultStreamingServiceStub( + std::unique_ptr< + google::cloud::visionai::v1::StreamingService::StubInterface> + grpc_stub, + std::unique_ptr + operations_stub, + std::unique_ptr + locations_stub) + : grpc_stub_(std::move(grpc_stub)), + operations_stub_(std::move(operations_stub)), + locations_stub_(std::move(locations_stub)) {} + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> + AsyncSendPackets(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> + AsyncReceivePackets( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> + AsyncReceiveEvents( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + StatusOr AcquireLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AcquireLeaseRequest const& request) override; + + StatusOr RenewLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RenewLeaseRequest const& request) override; + + StatusOr ReleaseLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ReleaseLeaseRequest 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; + + private: + std::unique_ptr + grpc_stub_; + std::unique_ptr + operations_stub_; + std::unique_ptr + locations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_STUB_H diff --git a/google/cloud/visionai/v1/internal/streaming_stub_factory.cc b/google/cloud/visionai/v1/internal/streaming_stub_factory.cc new file mode 100644 index 0000000000000..d182e7f35b124 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_stub_factory.cc @@ -0,0 +1,84 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#include "google/cloud/visionai/v1/internal/streaming_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/internal/streaming_auth_decorator.h" +#include "google/cloud/visionai/v1/internal/streaming_logging_decorator.h" +#include "google/cloud/visionai/v1/internal/streaming_metadata_decorator.h" +#include "google/cloud/visionai/v1/internal/streaming_stub.h" +#include "google/cloud/visionai/v1/internal/streaming_tracing_stub.h" +#include "google/cloud/visionai/v1/streaming_service.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultStreamingServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::visionai::v1::StreamingService::NewStub(channel); + auto service_operations_stub = + google::longrunning::Operations::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_operations_stub), + std::move(service_locations_stub)); + + 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 = MakeStreamingServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/streaming_stub_factory.h b/google/cloud/visionai/v1/internal/streaming_stub_factory.h new file mode 100644 index 0000000000000..262a3fb11f456 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_STUB_FACTORY_H + +#include "google/cloud/visionai/v1/internal/streaming_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultStreamingServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_STUB_FACTORY_H diff --git a/google/cloud/visionai/v1/internal/streaming_tracing_connection.cc b/google/cloud/visionai/v1/internal/streaming_tracing_connection.cc new file mode 100644 index 0000000000000..07795b7dde5f1 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_tracing_connection.cc @@ -0,0 +1,150 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#include "google/cloud/visionai/v1/internal/streaming_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamingServiceTracingConnection::StreamingServiceTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> +StreamingServiceTracingConnection::AsyncSendPackets() { + return child_->AsyncSendPackets(); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> +StreamingServiceTracingConnection::AsyncReceivePackets() { + return child_->AsyncReceivePackets(); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> +StreamingServiceTracingConnection::AsyncReceiveEvents() { + return child_->AsyncReceiveEvents(); +} + +StatusOr +StreamingServiceTracingConnection::AcquireLease( + google::cloud::visionai::v1::AcquireLeaseRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamingServiceConnection::AcquireLease"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->AcquireLease(request)); +} + +StatusOr +StreamingServiceTracingConnection::RenewLease( + google::cloud::visionai::v1::RenewLeaseRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamingServiceConnection::RenewLease"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->RenewLease(request)); +} + +StatusOr +StreamingServiceTracingConnection::ReleaseLease( + google::cloud::visionai::v1::ReleaseLeaseRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamingServiceConnection::ReleaseLease"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->ReleaseLease(request)); +} + +StreamRange +StreamingServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamingServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +StreamingServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamingServiceConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +StreamingServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamingServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +StreamingServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamingServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status StreamingServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamingServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status StreamingServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamingServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeStreamingServiceTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/streaming_tracing_connection.h b/google/cloud/visionai/v1/internal/streaming_tracing_connection.h new file mode 100644 index 0000000000000..91c2b2fc429e6 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_tracing_connection.h @@ -0,0 +1,102 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_TRACING_CONNECTION_H + +#include "google/cloud/visionai/v1/streaming_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamingServiceTracingConnection + : public visionai_v1::StreamingServiceConnection { + public: + ~StreamingServiceTracingConnection() override = default; + + explicit StreamingServiceTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> + AsyncSendPackets() override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> + AsyncReceivePackets() override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> + AsyncReceiveEvents() override; + + StatusOr AcquireLease( + google::cloud::visionai::v1::AcquireLeaseRequest const& request) override; + + StatusOr RenewLease( + google::cloud::visionai::v1::RenewLeaseRequest const& request) override; + + StatusOr ReleaseLease( + google::cloud::visionai::v1::ReleaseLeaseRequest const& request) 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_; +}; + +/** + * 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 +MakeStreamingServiceTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_TRACING_CONNECTION_H diff --git a/google/cloud/visionai/v1/internal/streaming_tracing_stub.cc b/google/cloud/visionai/v1/internal/streaming_tracing_stub.cc new file mode 100644 index 0000000000000..dcdc41893ce5c --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_tracing_stub.cc @@ -0,0 +1,204 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#include "google/cloud/visionai/v1/internal/streaming_tracing_stub.h" +#include "google/cloud/internal/async_read_write_stream_tracing.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamingServiceTracingStub::StreamingServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +std::unique_ptr> +StreamingServiceTracingStub::AsyncSendPackets( + CompletionQueue const& cq, std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.StreamingService", "SendPackets"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto stream = child_->AsyncSendPackets(cq, context, std::move(options)); + return std::make_unique>( + std::move(context), std::move(stream), std::move(span)); +} + +std::unique_ptr> +StreamingServiceTracingStub::AsyncReceivePackets( + CompletionQueue const& cq, std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.StreamingService", "ReceivePackets"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto stream = child_->AsyncReceivePackets(cq, context, std::move(options)); + return std::make_unique>( + std::move(context), std::move(stream), std::move(span)); +} + +std::unique_ptr> +StreamingServiceTracingStub::AsyncReceiveEvents( + CompletionQueue const& cq, std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.StreamingService", "ReceiveEvents"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto stream = child_->AsyncReceiveEvents(cq, context, std::move(options)); + return std::make_unique>( + std::move(context), std::move(stream), std::move(span)); +} + +StatusOr +StreamingServiceTracingStub::AcquireLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AcquireLeaseRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.StreamingService", "AcquireLease"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->AcquireLease(context, options, request)); +} + +StatusOr +StreamingServiceTracingStub::RenewLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RenewLeaseRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.StreamingService", "RenewLease"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->RenewLease(context, options, request)); +} + +StatusOr +StreamingServiceTracingStub::ReleaseLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ReleaseLeaseRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.StreamingService", "ReleaseLease"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ReleaseLease(context, options, request)); +} + +StatusOr +StreamingServiceTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.StreamingService", "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +StreamingServiceTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.StreamingService", "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +StreamingServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.StreamingService", "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +StreamingServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.StreamingService", "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status StreamingServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.StreamingService", "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status StreamingServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.visionai.v1.StreamingService", "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +std::shared_ptr MakeStreamingServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/streaming_tracing_stub.h b/google/cloud/visionai/v1/internal/streaming_tracing_stub.h new file mode 100644 index 0000000000000..d502dbcd75482 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streaming_tracing_stub.h @@ -0,0 +1,124 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_TRACING_STUB_H + +#include "google/cloud/visionai/v1/internal/streaming_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamingServiceTracingStub : public StreamingServiceStub { + public: + ~StreamingServiceTracingStub() override = default; + + explicit StreamingServiceTracingStub( + std::shared_ptr child); + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> + AsyncSendPackets(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> + AsyncReceivePackets( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> + AsyncReceiveEvents( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + StatusOr AcquireLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AcquireLeaseRequest const& request) override; + + StatusOr RenewLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RenewLeaseRequest const& request) override; + + StatusOr ReleaseLease( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ReleaseLeaseRequest 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; + + private: + std::shared_ptr child_; + std::shared_ptr + propagator_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeStreamingServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMING_TRACING_STUB_H diff --git a/google/cloud/visionai/v1/internal/streams_auth_decorator.cc b/google/cloud/visionai/v1/internal/streams_auth_decorator.cc new file mode 100644 index 0000000000000..7bbe70f35cea9 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_auth_decorator.cc @@ -0,0 +1,597 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#include "google/cloud/visionai/v1/internal/streams_auth_decorator.h" +#include "google/cloud/visionai/v1/streams_service.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamsServiceAuth::StreamsServiceAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +StreamsServiceAuth::ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListClustersRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListClusters(context, options, request); +} + +StatusOr StreamsServiceAuth::GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetClusterRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetCluster(context, options, request); +} + +future> +StreamsServiceAuth::AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateClusterRequest 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->AsyncCreateCluster(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateCluster(context, options, request); +} + +future> +StreamsServiceAuth::AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateClusterRequest 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->AsyncUpdateCluster(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateCluster(context, options, request); +} + +future> +StreamsServiceAuth::AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteClusterRequest 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->AsyncDeleteCluster(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteCluster(context, options, request); +} + +StatusOr +StreamsServiceAuth::ListStreams( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListStreamsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListStreams(context, options, request); +} + +StatusOr StreamsServiceAuth::GetStream( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetStream(context, options, request); +} + +future> +StreamsServiceAuth::AsyncCreateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateStreamRequest 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->AsyncCreateStream(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::CreateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateStream(context, options, request); +} + +future> +StreamsServiceAuth::AsyncUpdateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateStreamRequest 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->AsyncUpdateStream(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::UpdateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateStream(context, options, request); +} + +future> +StreamsServiceAuth::AsyncDeleteStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteStreamRequest 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->AsyncDeleteStream(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::DeleteStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteStream(context, options, request); +} + +future> +StreamsServiceAuth::AsyncGetStreamThumbnail( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::GetStreamThumbnailRequest 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->AsyncGetStreamThumbnail(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::GetStreamThumbnail( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetStreamThumbnail(context, options, request); +} + +StatusOr +StreamsServiceAuth::GenerateStreamHlsToken( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GenerateStreamHlsToken(context, options, request); +} + +StatusOr +StreamsServiceAuth::ListEvents( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListEventsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListEvents(context, options, request); +} + +StatusOr StreamsServiceAuth::GetEvent( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetEventRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetEvent(context, options, request); +} + +future> +StreamsServiceAuth::AsyncCreateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateEventRequest 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->AsyncCreateEvent(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::CreateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateEventRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateEvent(context, options, request); +} + +future> +StreamsServiceAuth::AsyncUpdateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateEventRequest 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->AsyncUpdateEvent(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::UpdateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateEvent(context, options, request); +} + +future> +StreamsServiceAuth::AsyncDeleteEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteEventRequest 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->AsyncDeleteEvent(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::DeleteEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteEvent(context, options, request); +} + +StatusOr +StreamsServiceAuth::ListSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSeriesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListSeries(context, options, request); +} + +StatusOr StreamsServiceAuth::GetSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSeriesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetSeries(context, options, request); +} + +future> +StreamsServiceAuth::AsyncCreateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateSeriesRequest 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->AsyncCreateSeries(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::CreateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateSeries(context, options, request); +} + +future> +StreamsServiceAuth::AsyncUpdateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateSeriesRequest 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->AsyncUpdateSeries(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::UpdateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateSeries(context, options, request); +} + +future> +StreamsServiceAuth::AsyncDeleteSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteSeriesRequest 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->AsyncDeleteSeries(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::DeleteSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteSeries(context, options, request); +} + +future> +StreamsServiceAuth::AsyncMaterializeChannel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::MaterializeChannelRequest 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->AsyncMaterializeChannel(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr StreamsServiceAuth::MaterializeChannel( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->MaterializeChannel(context, options, request); +} + +StatusOr +StreamsServiceAuth::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 StreamsServiceAuth::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 +StreamsServiceAuth::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 StreamsServiceAuth::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 StreamsServiceAuth::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 StreamsServiceAuth::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> +StreamsServiceAuth::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 StreamsServiceAuth::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/streams_auth_decorator.h b/google/cloud/visionai/v1/internal/streams_auth_decorator.h new file mode 100644 index 0000000000000..101ad0cf71457 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_auth_decorator.h @@ -0,0 +1,281 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_AUTH_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/streams_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamsServiceAuth : public StreamsServiceStub { + public: + ~StreamsServiceAuth() override = default; + StreamsServiceAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListClustersRequest const& request) override; + + StatusOr GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetClusterRequest const& request) override; + + future> AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + StatusOr CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + future> AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + StatusOr UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + future> AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) + override; + + StatusOr DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) + override; + + StatusOr ListStreams( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListStreamsRequest const& request) override; + + StatusOr GetStream( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamRequest const& request) override; + + future> AsyncCreateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + StatusOr CreateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + future> AsyncUpdateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + StatusOr UpdateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + future> AsyncDeleteStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + StatusOr DeleteStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + future> AsyncGetStreamThumbnail( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + StatusOr GetStreamThumbnail( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + StatusOr + GenerateStreamHlsToken( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) + override; + + StatusOr ListEvents( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListEventsRequest const& request) override; + + StatusOr GetEvent( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetEventRequest const& request) override; + + future> AsyncCreateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + StatusOr CreateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + future> AsyncUpdateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + StatusOr UpdateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + future> AsyncDeleteEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + StatusOr DeleteEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + StatusOr ListSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSeriesRequest const& request) override; + + StatusOr GetSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSeriesRequest const& request) override; + + future> AsyncCreateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + StatusOr CreateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + future> AsyncUpdateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + StatusOr UpdateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + future> AsyncDeleteSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + StatusOr DeleteSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + future> AsyncMaterializeChannel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) + override; + + StatusOr MaterializeChannel( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::MaterializeChannelRequest 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_AUTH_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/streams_connection_impl.cc b/google/cloud/visionai/v1/internal/streams_connection_impl.cc new file mode 100644 index 0000000000000..0e503fa4ce2f5 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_connection_impl.cc @@ -0,0 +1,1667 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#include "google/cloud/visionai/v1/internal/streams_connection_impl.h" +#include "google/cloud/visionai/v1/internal/streams_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 visionai_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 + +StreamsServiceConnectionImpl::StreamsServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions(std::move(options), + StreamsServiceConnection::options())) {} + +StreamRange +StreamsServiceConnectionImpl::ListClusters( + google::cloud::visionai::v1::ListClustersRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListClusters(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::visionai::v1::ListClustersRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListClustersRequest const& + request) { + return stub->ListClusters(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListClustersResponse r) { + std::vector result( + r.clusters().size()); + auto& messages = *r.mutable_clusters(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +StreamsServiceConnectionImpl::GetCluster( + google::cloud::visionai::v1::GetClusterRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetCluster(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetClusterRequest const& request) { + return stub_->GetCluster(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::CreateCluster( + google::cloud::visionai::v1::CreateClusterRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateCluster(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Cluster>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + return stub->AsyncCreateCluster(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::visionai::v1::Cluster>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::CreateCluster( + NoAwaitTag, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateCluster(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + return stub_->CreateCluster(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::CreateCluster( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateCluster", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Cluster>( + 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::visionai::v1::Cluster>, + polling_policy(*current), __func__); +} + +future> +StreamsServiceConnectionImpl::UpdateCluster( + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateCluster(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Cluster>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + return stub->AsyncUpdateCluster(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::visionai::v1::Cluster>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::UpdateCluster( + NoAwaitTag, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateCluster(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + return stub_->UpdateCluster(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::UpdateCluster( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateCluster", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Cluster>( + 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::visionai::v1::Cluster>, + polling_policy(*current), __func__); +} + +future> +StreamsServiceConnectionImpl::DeleteCluster( + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteCluster(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::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::visionai::v1::DeleteClusterRequest const& request) { + return stub->AsyncDeleteCluster(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::visionai::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::DeleteCluster( + NoAwaitTag, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteCluster(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + return stub_->DeleteCluster(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::DeleteCluster( + 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 DeleteCluster", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::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::visionai::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +StreamsServiceConnectionImpl::ListStreams( + google::cloud::visionai::v1::ListStreamsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListStreams(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::visionai::v1::ListStreamsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListStreamsRequest const& + request) { + return stub->ListStreams(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListStreamsResponse r) { + std::vector result( + r.streams().size()); + auto& messages = *r.mutable_streams(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +StreamsServiceConnectionImpl::GetStream( + google::cloud::visionai::v1::GetStreamRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetStream(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamRequest const& request) { + return stub_->GetStream(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::CreateStream( + google::cloud::visionai::v1::CreateStreamRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateStream(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Stream>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + return stub->AsyncCreateStream(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::visionai::v1::Stream>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::CreateStream( + NoAwaitTag, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateStream(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + return stub_->CreateStream(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::CreateStream( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateStream", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Stream>( + 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::visionai::v1::Stream>, + polling_policy(*current), __func__); +} + +future> +StreamsServiceConnectionImpl::UpdateStream( + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateStream(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Stream>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + return stub->AsyncUpdateStream(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::visionai::v1::Stream>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::UpdateStream( + NoAwaitTag, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateStream(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + return stub_->UpdateStream(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::UpdateStream( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateStream", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Stream>( + 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::visionai::v1::Stream>, + polling_policy(*current), __func__); +} + +future> +StreamsServiceConnectionImpl::DeleteStream( + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteStream(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::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::visionai::v1::DeleteStreamRequest const& request) { + return stub->AsyncDeleteStream(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::visionai::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::DeleteStream( + NoAwaitTag, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteStream(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + return stub_->DeleteStream(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::DeleteStream( + 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 DeleteStream", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::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::visionai::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +future> +StreamsServiceConnectionImpl::GetStreamThumbnail( + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->GetStreamThumbnail(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::GetStreamThumbnailResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& + request) { + return stub->AsyncGetStreamThumbnail(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::visionai::v1::GetStreamThumbnailResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::GetStreamThumbnail( + NoAwaitTag, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetStreamThumbnail(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& + request) { + return stub_->GetStreamThumbnail(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::GetStreamThumbnail( + 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 GetStreamThumbnail", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::GetStreamThumbnailResponse>( + 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::visionai::v1::GetStreamThumbnailResponse>, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::GenerateStreamHlsToken( + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GenerateStreamHlsToken(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& + request) { + return stub_->GenerateStreamHlsToken(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +StreamsServiceConnectionImpl::ListEvents( + google::cloud::visionai::v1::ListEventsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListEvents(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::visionai::v1::ListEventsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListEventsRequest const& request) { + return stub->ListEvents(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListEventsResponse r) { + std::vector result( + r.events().size()); + auto& messages = *r.mutable_events(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +StreamsServiceConnectionImpl::GetEvent( + google::cloud::visionai::v1::GetEventRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetEvent(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetEventRequest const& request) { + return stub_->GetEvent(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::CreateEvent( + google::cloud::visionai::v1::CreateEventRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateEvent(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Event>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateEventRequest const& request) { + return stub->AsyncCreateEvent(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::visionai::v1::Event>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::CreateEvent( + NoAwaitTag, + google::cloud::visionai::v1::CreateEventRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateEvent(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateEventRequest const& request) { + return stub_->CreateEvent(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::CreateEvent( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateEvent", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Event>( + 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::visionai::v1::Event>, + polling_policy(*current), __func__); +} + +future> +StreamsServiceConnectionImpl::UpdateEvent( + google::cloud::visionai::v1::UpdateEventRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateEvent(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Event>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + return stub->AsyncUpdateEvent(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::visionai::v1::Event>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::UpdateEvent( + NoAwaitTag, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateEvent(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + return stub_->UpdateEvent(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::UpdateEvent( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateEvent", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Event>( + 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::visionai::v1::Event>, + polling_policy(*current), __func__); +} + +future> +StreamsServiceConnectionImpl::DeleteEvent( + google::cloud::visionai::v1::DeleteEventRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteEvent(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::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::visionai::v1::DeleteEventRequest const& request) { + return stub->AsyncDeleteEvent(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::visionai::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::DeleteEvent( + NoAwaitTag, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteEvent(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + return stub_->DeleteEvent(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::DeleteEvent( + 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 DeleteEvent", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::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::visionai::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +StreamsServiceConnectionImpl::ListSeries( + google::cloud::visionai::v1::ListSeriesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListSeries(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::visionai::v1::ListSeriesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSeriesRequest const& request) { + return stub->ListSeries(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListSeriesResponse r) { + std::vector result( + r.series().size()); + auto& messages = *r.mutable_series(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +StreamsServiceConnectionImpl::GetSeries( + google::cloud::visionai::v1::GetSeriesRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetSeries(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSeriesRequest const& request) { + return stub_->GetSeries(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::CreateSeries( + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateSeries(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Series>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + return stub->AsyncCreateSeries(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::visionai::v1::Series>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::CreateSeries( + NoAwaitTag, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateSeries(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + return stub_->CreateSeries(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::CreateSeries( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateSeries", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Series>( + 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::visionai::v1::Series>, + polling_policy(*current), __func__); +} + +future> +StreamsServiceConnectionImpl::UpdateSeries( + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateSeries(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Series>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + return stub->AsyncUpdateSeries(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::visionai::v1::Series>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::UpdateSeries( + NoAwaitTag, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateSeries(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + return stub_->UpdateSeries(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::UpdateSeries( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateSeries", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Series>( + 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::visionai::v1::Series>, + polling_policy(*current), __func__); +} + +future> +StreamsServiceConnectionImpl::DeleteSeries( + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteSeries(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::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::visionai::v1::DeleteSeriesRequest const& request) { + return stub->AsyncDeleteSeries(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::visionai::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::DeleteSeries( + NoAwaitTag, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteSeries(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + return stub_->DeleteSeries(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::DeleteSeries( + 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 DeleteSeries", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::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::visionai::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +future> +StreamsServiceConnectionImpl::MaterializeChannel( + google::cloud::visionai::v1::MaterializeChannelRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->MaterializeChannel(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Channel>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::MaterializeChannelRequest const& + request) { + return stub->AsyncMaterializeChannel(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::visionai::v1::Channel>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +StreamsServiceConnectionImpl::MaterializeChannel( + NoAwaitTag, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->MaterializeChannel(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::MaterializeChannelRequest const& + request) { + return stub_->MaterializeChannel(context, options, request); + }, + *current, request, __func__); +} + +future> +StreamsServiceConnectionImpl::MaterializeChannel( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to MaterializeChannel", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Channel>( + 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::visionai::v1::Channel>, + polling_policy(*current), __func__); +} + +StreamRange +StreamsServiceConnectionImpl::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 +StreamsServiceConnectionImpl::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 +StreamsServiceConnectionImpl::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 +StreamsServiceConnectionImpl::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 StreamsServiceConnectionImpl::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 StreamsServiceConnectionImpl::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 visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/streams_connection_impl.h b/google/cloud/visionai/v1/internal/streams_connection_impl.h new file mode 100644 index 0000000000000..8e9c6575948aa --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_connection_impl.h @@ -0,0 +1,264 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_CONNECTION_IMPL_H + +#include "google/cloud/visionai/v1/internal/streams_retry_traits.h" +#include "google/cloud/visionai/v1/internal/streams_stub.h" +#include "google/cloud/visionai/v1/streams_connection.h" +#include "google/cloud/visionai/v1/streams_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/streams_options.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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamsServiceConnectionImpl + : public visionai_v1::StreamsServiceConnection { + public: + ~StreamsServiceConnectionImpl() override = default; + + StreamsServiceConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + StreamRange ListClusters( + google::cloud::visionai::v1::ListClustersRequest request) override; + + StatusOr GetCluster( + google::cloud::visionai::v1::GetClusterRequest const& request) override; + + future> CreateCluster( + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + StatusOr CreateCluster( + NoAwaitTag, + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + future> CreateCluster( + google::longrunning::Operation const& operation) override; + + future> UpdateCluster( + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + StatusOr UpdateCluster( + NoAwaitTag, + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + future> UpdateCluster( + google::longrunning::Operation const& operation) override; + + future> + DeleteCluster(google::cloud::visionai::v1::DeleteClusterRequest const& + request) override; + + StatusOr DeleteCluster( + NoAwaitTag, + google::cloud::visionai::v1::DeleteClusterRequest const& request) + override; + + future> + DeleteCluster(google::longrunning::Operation const& operation) override; + + StreamRange ListStreams( + google::cloud::visionai::v1::ListStreamsRequest request) override; + + StatusOr GetStream( + google::cloud::visionai::v1::GetStreamRequest const& request) override; + + future> CreateStream( + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + StatusOr CreateStream( + NoAwaitTag, + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + future> CreateStream( + google::longrunning::Operation const& operation) override; + + future> UpdateStream( + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + StatusOr UpdateStream( + NoAwaitTag, + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + future> UpdateStream( + google::longrunning::Operation const& operation) override; + + future> DeleteStream( + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + StatusOr DeleteStream( + NoAwaitTag, + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + future> DeleteStream( + google::longrunning::Operation const& operation) override; + + future> + GetStreamThumbnail( + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + StatusOr GetStreamThumbnail( + NoAwaitTag, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + future> + GetStreamThumbnail(google::longrunning::Operation const& operation) override; + + StatusOr + GenerateStreamHlsToken( + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) + override; + + StreamRange ListEvents( + google::cloud::visionai::v1::ListEventsRequest request) override; + + StatusOr GetEvent( + google::cloud::visionai::v1::GetEventRequest const& request) override; + + future> CreateEvent( + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + StatusOr CreateEvent( + NoAwaitTag, + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + future> CreateEvent( + google::longrunning::Operation const& operation) override; + + future> UpdateEvent( + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + StatusOr UpdateEvent( + NoAwaitTag, + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + future> UpdateEvent( + google::longrunning::Operation const& operation) override; + + future> DeleteEvent( + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + StatusOr DeleteEvent( + NoAwaitTag, + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + future> DeleteEvent( + google::longrunning::Operation const& operation) override; + + StreamRange ListSeries( + google::cloud::visionai::v1::ListSeriesRequest request) override; + + StatusOr GetSeries( + google::cloud::visionai::v1::GetSeriesRequest const& request) override; + + future> CreateSeries( + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + StatusOr CreateSeries( + NoAwaitTag, + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + future> CreateSeries( + google::longrunning::Operation const& operation) override; + + future> UpdateSeries( + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + StatusOr UpdateSeries( + NoAwaitTag, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + future> UpdateSeries( + google::longrunning::Operation const& operation) override; + + future> DeleteSeries( + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + StatusOr DeleteSeries( + NoAwaitTag, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + future> DeleteSeries( + google::longrunning::Operation const& operation) override; + + future> MaterializeChannel( + google::cloud::visionai::v1::MaterializeChannelRequest const& request) + override; + + StatusOr MaterializeChannel( + NoAwaitTag, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) + override; + + future> MaterializeChannel( + 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_CONNECTION_IMPL_H diff --git a/google/cloud/visionai/v1/internal/streams_logging_decorator.cc b/google/cloud/visionai/v1/internal/streams_logging_decorator.cc new file mode 100644 index 0000000000000..dee66b98def05 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_logging_decorator.cc @@ -0,0 +1,667 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#include "google/cloud/visionai/v1/internal/streams_logging_decorator.h" +#include "google/cloud/visionai/v1/streams_service.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamsServiceLogging::StreamsServiceLogging( + std::shared_ptr child, TracingOptions tracing_options, + std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +StreamsServiceLogging::ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListClustersRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListClustersRequest const& request) { + return child_->ListClusters(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +StreamsServiceLogging::GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetClusterRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetClusterRequest const& request) { + return child_->GetCluster(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + return child_->AsyncCreateCluster(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr StreamsServiceLogging::CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + return child_->CreateCluster(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + return child_->AsyncUpdateCluster(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr StreamsServiceLogging::UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + return child_->UpdateCluster(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + return child_->AsyncDeleteCluster(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr StreamsServiceLogging::DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + return child_->DeleteCluster(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +StreamsServiceLogging::ListStreams( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListStreamsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListStreamsRequest const& request) { + return child_->ListStreams(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr StreamsServiceLogging::GetStream( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamRequest const& request) { + return child_->GetStream(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncCreateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + return child_->AsyncCreateStream(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr StreamsServiceLogging::CreateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + return child_->CreateStream(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncUpdateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + return child_->AsyncUpdateStream(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr StreamsServiceLogging::UpdateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + return child_->UpdateStream(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncDeleteStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + return child_->AsyncDeleteStream(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr StreamsServiceLogging::DeleteStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + return child_->DeleteStream(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncGetStreamThumbnail( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& + request) { + return child_->AsyncGetStreamThumbnail(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +StreamsServiceLogging::GetStreamThumbnail( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& + request) { + return child_->GetStreamThumbnail(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +StreamsServiceLogging::GenerateStreamHlsToken( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& + request) { + return child_->GenerateStreamHlsToken(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +StreamsServiceLogging::ListEvents( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListEventsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListEventsRequest const& request) { + return child_->ListEvents(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr StreamsServiceLogging::GetEvent( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetEventRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetEventRequest const& request) { + return child_->GetEvent(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncCreateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateEventRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateEventRequest const& request) { + return child_->AsyncCreateEvent(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr StreamsServiceLogging::CreateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateEventRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateEventRequest const& request) { + return child_->CreateEvent(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncUpdateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + return child_->AsyncUpdateEvent(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr StreamsServiceLogging::UpdateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + return child_->UpdateEvent(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncDeleteEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + return child_->AsyncDeleteEvent(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr StreamsServiceLogging::DeleteEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + return child_->DeleteEvent(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +StreamsServiceLogging::ListSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSeriesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSeriesRequest const& request) { + return child_->ListSeries(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr StreamsServiceLogging::GetSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSeriesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSeriesRequest const& request) { + return child_->GetSeries(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncCreateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + return child_->AsyncCreateSeries(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr StreamsServiceLogging::CreateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + return child_->CreateSeries(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncUpdateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + return child_->AsyncUpdateSeries(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr StreamsServiceLogging::UpdateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + return child_->UpdateSeries(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncDeleteSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + return child_->AsyncDeleteSeries(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr StreamsServiceLogging::DeleteSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + return child_->DeleteSeries(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +StreamsServiceLogging::AsyncMaterializeChannel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::MaterializeChannelRequest const& + request) { + return child_->AsyncMaterializeChannel(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +StreamsServiceLogging::MaterializeChannel( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::MaterializeChannelRequest const& + request) { + return child_->MaterializeChannel(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +StreamsServiceLogging::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 StreamsServiceLogging::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 +StreamsServiceLogging::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 StreamsServiceLogging::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 StreamsServiceLogging::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 StreamsServiceLogging::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> +StreamsServiceLogging::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 StreamsServiceLogging::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/streams_logging_decorator.h b/google/cloud/visionai/v1/internal/streams_logging_decorator.h new file mode 100644 index 0000000000000..8c547e876ac68 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_logging_decorator.h @@ -0,0 +1,281 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_LOGGING_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/streams_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamsServiceLogging : public StreamsServiceStub { + public: + ~StreamsServiceLogging() override = default; + StreamsServiceLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListClustersRequest const& request) override; + + StatusOr GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetClusterRequest const& request) override; + + future> AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + StatusOr CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + future> AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + StatusOr UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + future> AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) + override; + + StatusOr DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) + override; + + StatusOr ListStreams( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListStreamsRequest const& request) override; + + StatusOr GetStream( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamRequest const& request) override; + + future> AsyncCreateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + StatusOr CreateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + future> AsyncUpdateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + StatusOr UpdateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + future> AsyncDeleteStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + StatusOr DeleteStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + future> AsyncGetStreamThumbnail( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + StatusOr GetStreamThumbnail( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + StatusOr + GenerateStreamHlsToken( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) + override; + + StatusOr ListEvents( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListEventsRequest const& request) override; + + StatusOr GetEvent( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetEventRequest const& request) override; + + future> AsyncCreateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + StatusOr CreateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + future> AsyncUpdateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + StatusOr UpdateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + future> AsyncDeleteEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + StatusOr DeleteEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + StatusOr ListSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSeriesRequest const& request) override; + + StatusOr GetSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSeriesRequest const& request) override; + + future> AsyncCreateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + StatusOr CreateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + future> AsyncUpdateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + StatusOr UpdateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + future> AsyncDeleteSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + StatusOr DeleteSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + future> AsyncMaterializeChannel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) + override; + + StatusOr MaterializeChannel( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::MaterializeChannelRequest 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_; +}; // StreamsServiceLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_LOGGING_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/streams_metadata_decorator.cc b/google/cloud/visionai/v1/internal/streams_metadata_decorator.cc new file mode 100644 index 0000000000000..469b9e6c3635f --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_metadata_decorator.cc @@ -0,0 +1,510 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#include "google/cloud/visionai/v1/internal/streams_metadata_decorator.h" +#include "google/cloud/visionai/v1/streams_service.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamsServiceMetadata::StreamsServiceMetadata( + 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 +StreamsServiceMetadata::ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListClustersRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListClusters(context, options, request); +} + +StatusOr +StreamsServiceMetadata::GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetClusterRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetCluster(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateCluster(cq, std::move(context), std::move(options), + request); +} + +StatusOr StreamsServiceMetadata::CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateCluster(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("cluster.name=", + internal::UrlEncode(request.cluster().name()))); + return child_->AsyncUpdateCluster(cq, std::move(context), std::move(options), + request); +} + +StatusOr StreamsServiceMetadata::UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + SetMetadata(context, options, + absl::StrCat("cluster.name=", + internal::UrlEncode(request.cluster().name()))); + return child_->UpdateCluster(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteCluster(cq, std::move(context), std::move(options), + request); +} + +StatusOr StreamsServiceMetadata::DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteCluster(context, options, request); +} + +StatusOr +StreamsServiceMetadata::ListStreams( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListStreamsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListStreams(context, options, request); +} + +StatusOr StreamsServiceMetadata::GetStream( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetStream(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncCreateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateStream(cq, std::move(context), std::move(options), + request); +} + +StatusOr StreamsServiceMetadata::CreateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateStream(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncUpdateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("stream.name=", + internal::UrlEncode(request.stream().name()))); + return child_->AsyncUpdateStream(cq, std::move(context), std::move(options), + request); +} + +StatusOr StreamsServiceMetadata::UpdateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + SetMetadata(context, options, + absl::StrCat("stream.name=", + internal::UrlEncode(request.stream().name()))); + return child_->UpdateStream(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncDeleteStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteStream(cq, std::move(context), std::move(options), + request); +} + +StatusOr StreamsServiceMetadata::DeleteStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteStream(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncGetStreamThumbnail( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("stream=", internal::UrlEncode(request.stream()))); + return child_->AsyncGetStreamThumbnail(cq, std::move(context), + std::move(options), request); +} + +StatusOr +StreamsServiceMetadata::GetStreamThumbnail( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) { + SetMetadata(context, options, + absl::StrCat("stream=", internal::UrlEncode(request.stream()))); + return child_->GetStreamThumbnail(context, options, request); +} + +StatusOr +StreamsServiceMetadata::GenerateStreamHlsToken( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) { + SetMetadata(context, options, + absl::StrCat("stream=", internal::UrlEncode(request.stream()))); + return child_->GenerateStreamHlsToken(context, options, request); +} + +StatusOr +StreamsServiceMetadata::ListEvents( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListEventsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListEvents(context, options, request); +} + +StatusOr StreamsServiceMetadata::GetEvent( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetEventRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetEvent(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncCreateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateEventRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateEvent(cq, std::move(context), std::move(options), + request); +} + +StatusOr StreamsServiceMetadata::CreateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateEventRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateEvent(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncUpdateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + SetMetadata( + *context, *options, + absl::StrCat("event.name=", internal::UrlEncode(request.event().name()))); + return child_->AsyncUpdateEvent(cq, std::move(context), std::move(options), + request); +} + +StatusOr StreamsServiceMetadata::UpdateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("event.name=", internal::UrlEncode(request.event().name()))); + return child_->UpdateEvent(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncDeleteEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteEvent(cq, std::move(context), std::move(options), + request); +} + +StatusOr StreamsServiceMetadata::DeleteEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteEvent(context, options, request); +} + +StatusOr +StreamsServiceMetadata::ListSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSeriesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListSeries(context, options, request); +} + +StatusOr StreamsServiceMetadata::GetSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSeriesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetSeries(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncCreateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateSeries(cq, std::move(context), std::move(options), + request); +} + +StatusOr StreamsServiceMetadata::CreateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateSeries(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncUpdateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("series.name=", + internal::UrlEncode(request.series().name()))); + return child_->AsyncUpdateSeries(cq, std::move(context), std::move(options), + request); +} + +StatusOr StreamsServiceMetadata::UpdateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("series.name=", + internal::UrlEncode(request.series().name()))); + return child_->UpdateSeries(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncDeleteSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteSeries(cq, std::move(context), std::move(options), + request); +} + +StatusOr StreamsServiceMetadata::DeleteSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteSeries(context, options, request); +} + +future> +StreamsServiceMetadata::AsyncMaterializeChannel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncMaterializeChannel(cq, std::move(context), + std::move(options), request); +} + +StatusOr +StreamsServiceMetadata::MaterializeChannel( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->MaterializeChannel(context, options, request); +} + +StatusOr +StreamsServiceMetadata::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 StreamsServiceMetadata::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 +StreamsServiceMetadata::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 StreamsServiceMetadata::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 StreamsServiceMetadata::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 StreamsServiceMetadata::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> +StreamsServiceMetadata::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 StreamsServiceMetadata::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 StreamsServiceMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void StreamsServiceMetadata::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/streams_metadata_decorator.h b/google/cloud/visionai/v1/internal/streams_metadata_decorator.h new file mode 100644 index 0000000000000..8269f3d2de7ea --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_metadata_decorator.h @@ -0,0 +1,286 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_METADATA_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/streams_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamsServiceMetadata : public StreamsServiceStub { + public: + ~StreamsServiceMetadata() override = default; + StreamsServiceMetadata(std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListClustersRequest const& request) override; + + StatusOr GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetClusterRequest const& request) override; + + future> AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + StatusOr CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + future> AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + StatusOr UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + future> AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) + override; + + StatusOr DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) + override; + + StatusOr ListStreams( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListStreamsRequest const& request) override; + + StatusOr GetStream( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamRequest const& request) override; + + future> AsyncCreateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + StatusOr CreateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + future> AsyncUpdateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + StatusOr UpdateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + future> AsyncDeleteStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + StatusOr DeleteStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + future> AsyncGetStreamThumbnail( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + StatusOr GetStreamThumbnail( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + StatusOr + GenerateStreamHlsToken( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) + override; + + StatusOr ListEvents( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListEventsRequest const& request) override; + + StatusOr GetEvent( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetEventRequest const& request) override; + + future> AsyncCreateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + StatusOr CreateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + future> AsyncUpdateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + StatusOr UpdateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + future> AsyncDeleteEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + StatusOr DeleteEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + StatusOr ListSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSeriesRequest const& request) override; + + StatusOr GetSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSeriesRequest const& request) override; + + future> AsyncCreateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + StatusOr CreateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + future> AsyncUpdateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + StatusOr UpdateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + future> AsyncDeleteSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + StatusOr DeleteSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + future> AsyncMaterializeChannel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) + override; + + StatusOr MaterializeChannel( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::MaterializeChannelRequest 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_METADATA_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/streams_option_defaults.cc b/google/cloud/visionai/v1/internal/streams_option_defaults.cc new file mode 100644 index 0000000000000..fc5902a921960 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_option_defaults.cc @@ -0,0 +1,78 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#include "google/cloud/visionai/v1/internal/streams_option_defaults.h" +#include "google/cloud/visionai/v1/streams_connection.h" +#include "google/cloud/visionai/v1/streams_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 visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options StreamsServiceDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_STREAMS_SERVICE_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_STREAMS_SERVICE_AUTHORITY", "visionai.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + visionai_v1::StreamsServiceLimitedTimeRetryPolicy( + std::chrono::minutes(10)) + .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< + visionai_v1::StreamsServiceRetryPolicyOption::Type, + visionai_v1::StreamsServiceBackoffPolicyOption::Type>( + options.get() + ->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } + if (!options.has< + visionai_v1::StreamsServiceConnectionIdempotencyPolicyOption>()) { + options.set( + visionai_v1::MakeDefaultStreamsServiceConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/streams_option_defaults.h b/google/cloud/visionai/v1/internal/streams_option_defaults.h new file mode 100644 index 0000000000000..32bd137e9beff --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options StreamsServiceDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_OPTION_DEFAULTS_H diff --git a/google/cloud/visionai/v1/internal/streams_retry_traits.h b/google/cloud/visionai/v1/internal/streams_retry_traits.h new file mode 100644 index 0000000000000..49d81197dec38 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct StreamsServiceRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_RETRY_TRAITS_H diff --git a/google/cloud/visionai/v1/internal/streams_sources.cc b/google/cloud/visionai/v1/internal/streams_sources.cc new file mode 100644 index 0000000000000..d4775a4def1b3 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/visionai/v1/internal/streams_auth_decorator.cc" +#include "google/cloud/visionai/v1/internal/streams_connection_impl.cc" +#include "google/cloud/visionai/v1/internal/streams_logging_decorator.cc" +#include "google/cloud/visionai/v1/internal/streams_metadata_decorator.cc" +#include "google/cloud/visionai/v1/internal/streams_option_defaults.cc" +#include "google/cloud/visionai/v1/internal/streams_stub.cc" +#include "google/cloud/visionai/v1/internal/streams_stub_factory.cc" +#include "google/cloud/visionai/v1/internal/streams_tracing_connection.cc" +#include "google/cloud/visionai/v1/internal/streams_tracing_stub.cc" +#include "google/cloud/visionai/v1/streams_client.cc" +#include "google/cloud/visionai/v1/streams_connection.cc" +#include "google/cloud/visionai/v1/streams_connection_idempotency_policy.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/visionai/v1/internal/streams_stub.cc b/google/cloud/visionai/v1/internal/streams_stub.cc new file mode 100644 index 0000000000000..0484036a05724 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_stub.cc @@ -0,0 +1,679 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#include "google/cloud/visionai/v1/internal/streams_stub.h" +#include "google/cloud/visionai/v1/streams_service.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamsServiceStub::~StreamsServiceStub() = default; + +StatusOr +DefaultStreamsServiceStub::ListClusters( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListClustersRequest const& request) { + google::cloud::visionai::v1::ListClustersResponse response; + auto status = grpc_stub_->ListClusters(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultStreamsServiceStub::GetCluster( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetClusterRequest const& request) { + google::cloud::visionai::v1::Cluster response; + auto status = grpc_stub_->GetCluster(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateClusterRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::CreateClusterRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateCluster(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultStreamsServiceStub::CreateCluster( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateCluster(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateClusterRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UpdateClusterRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateCluster(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultStreamsServiceStub::UpdateCluster( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateCluster(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteClusterRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteClusterRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteCluster(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultStreamsServiceStub::DeleteCluster( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteCluster(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultStreamsServiceStub::ListStreams( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListStreamsRequest const& request) { + google::cloud::visionai::v1::ListStreamsResponse response; + auto status = grpc_stub_->ListStreams(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultStreamsServiceStub::GetStream( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetStreamRequest const& request) { + google::cloud::visionai::v1::Stream response; + auto status = grpc_stub_->GetStream(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncCreateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateStreamRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::CreateStreamRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateStream(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultStreamsServiceStub::CreateStream( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateStream(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncUpdateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateStreamRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UpdateStreamRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateStream(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultStreamsServiceStub::UpdateStream( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateStream(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncDeleteStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteStreamRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteStreamRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteStream(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultStreamsServiceStub::DeleteStream( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteStream(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncGetStreamThumbnail( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::GetStreamThumbnailRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncGetStreamThumbnail(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultStreamsServiceStub::GetStreamThumbnail( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->GetStreamThumbnail(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultStreamsServiceStub::GenerateStreamHlsToken( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) { + google::cloud::visionai::v1::GenerateStreamHlsTokenResponse response; + auto status = + grpc_stub_->GenerateStreamHlsToken(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultStreamsServiceStub::ListEvents( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListEventsRequest const& request) { + google::cloud::visionai::v1::ListEventsResponse response; + auto status = grpc_stub_->ListEvents(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultStreamsServiceStub::GetEvent( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetEventRequest const& request) { + google::cloud::visionai::v1::Event response; + auto status = grpc_stub_->GetEvent(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncCreateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateEventRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateEventRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::CreateEventRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateEvent(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultStreamsServiceStub::CreateEvent( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateEventRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateEvent(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncUpdateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateEventRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UpdateEventRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateEvent(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultStreamsServiceStub::UpdateEvent( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateEvent(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncDeleteEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteEventRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteEventRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteEvent(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultStreamsServiceStub::DeleteEvent( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteEvent(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultStreamsServiceStub::ListSeries( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListSeriesRequest const& request) { + google::cloud::visionai::v1::ListSeriesResponse response; + auto status = grpc_stub_->ListSeries(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultStreamsServiceStub::GetSeries( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetSeriesRequest const& request) { + google::cloud::visionai::v1::Series response; + auto status = grpc_stub_->GetSeries(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncCreateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateSeriesRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::CreateSeriesRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateSeries(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultStreamsServiceStub::CreateSeries( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateSeries(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncUpdateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateSeriesRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UpdateSeriesRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateSeries(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultStreamsServiceStub::UpdateSeries( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateSeries(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncDeleteSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteSeriesRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteSeriesRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteSeries(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultStreamsServiceStub::DeleteSeries( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteSeries(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultStreamsServiceStub::AsyncMaterializeChannel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::MaterializeChannelRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::visionai::v1::MaterializeChannelRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncMaterializeChannel(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultStreamsServiceStub::MaterializeChannel( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->MaterializeChannel(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultStreamsServiceStub::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 +DefaultStreamsServiceStub::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 +DefaultStreamsServiceStub::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 +DefaultStreamsServiceStub::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 DefaultStreamsServiceStub::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 DefaultStreamsServiceStub::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> +DefaultStreamsServiceStub::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 DefaultStreamsServiceStub::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/streams_stub.h b/google/cloud/visionai/v1/internal/streams_stub.h new file mode 100644 index 0000000000000..19d967c5b6030 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_stub.h @@ -0,0 +1,523 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_STUB_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/streams_service.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamsServiceStub { + public: + virtual ~StreamsServiceStub() = 0; + + virtual StatusOr + ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListClustersRequest const& request) = 0; + + virtual StatusOr GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetClusterRequest const& request) = 0; + + virtual future> AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateClusterRequest const& request) = 0; + + virtual StatusOr CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateClusterRequest const& request) = 0; + + virtual future> AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) = 0; + + virtual StatusOr UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) = 0; + + virtual future> AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) = 0; + + virtual StatusOr DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) = 0; + + virtual StatusOr + ListStreams( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListStreamsRequest const& request) = 0; + + virtual StatusOr GetStream( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamRequest const& request) = 0; + + virtual future> AsyncCreateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateStreamRequest const& request) = 0; + + virtual StatusOr CreateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateStreamRequest const& request) = 0; + + virtual future> AsyncUpdateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) = 0; + + virtual StatusOr UpdateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) = 0; + + virtual future> AsyncDeleteStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) = 0; + + virtual StatusOr DeleteStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) = 0; + + virtual future> + AsyncGetStreamThumbnail( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& + request) = 0; + + virtual StatusOr GetStreamThumbnail( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& + request) = 0; + + virtual StatusOr + GenerateStreamHlsToken( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& + request) = 0; + + virtual StatusOr ListEvents( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListEventsRequest const& request) = 0; + + virtual StatusOr GetEvent( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetEventRequest const& request) = 0; + + virtual future> AsyncCreateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateEventRequest const& request) = 0; + + virtual StatusOr CreateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateEventRequest const& request) = 0; + + virtual future> AsyncUpdateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateEventRequest const& request) = 0; + + virtual StatusOr UpdateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateEventRequest const& request) = 0; + + virtual future> AsyncDeleteEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteEventRequest const& request) = 0; + + virtual StatusOr DeleteEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteEventRequest const& request) = 0; + + virtual StatusOr ListSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSeriesRequest const& request) = 0; + + virtual StatusOr GetSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSeriesRequest const& request) = 0; + + virtual future> AsyncCreateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) = 0; + + virtual StatusOr CreateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) = 0; + + virtual future> AsyncUpdateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) = 0; + + virtual StatusOr UpdateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) = 0; + + virtual future> AsyncDeleteSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) = 0; + + virtual StatusOr DeleteSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) = 0; + + virtual future> + AsyncMaterializeChannel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::MaterializeChannelRequest const& + request) = 0; + + virtual StatusOr MaterializeChannel( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::MaterializeChannelRequest 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 DefaultStreamsServiceStub : public StreamsServiceStub { + public: + DefaultStreamsServiceStub( + std::unique_ptr< + google::cloud::visionai::v1::StreamsService::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 ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListClustersRequest const& request) override; + + StatusOr GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetClusterRequest const& request) override; + + future> AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + StatusOr CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + future> AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + StatusOr UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + future> AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) + override; + + StatusOr DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) + override; + + StatusOr ListStreams( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListStreamsRequest const& request) override; + + StatusOr GetStream( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamRequest const& request) override; + + future> AsyncCreateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + StatusOr CreateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + future> AsyncUpdateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + StatusOr UpdateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + future> AsyncDeleteStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + StatusOr DeleteStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + future> AsyncGetStreamThumbnail( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + StatusOr GetStreamThumbnail( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + StatusOr + GenerateStreamHlsToken( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) + override; + + StatusOr ListEvents( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListEventsRequest const& request) override; + + StatusOr GetEvent( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetEventRequest const& request) override; + + future> AsyncCreateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + StatusOr CreateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + future> AsyncUpdateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + StatusOr UpdateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + future> AsyncDeleteEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + StatusOr DeleteEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + StatusOr ListSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSeriesRequest const& request) override; + + StatusOr GetSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSeriesRequest const& request) override; + + future> AsyncCreateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + StatusOr CreateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + future> AsyncUpdateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + StatusOr UpdateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + future> AsyncDeleteSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + StatusOr DeleteSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + future> AsyncMaterializeChannel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) + override; + + StatusOr MaterializeChannel( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::MaterializeChannelRequest 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 + grpc_stub_; + std::unique_ptr + locations_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_STUB_H diff --git a/google/cloud/visionai/v1/internal/streams_stub_factory.cc b/google/cloud/visionai/v1/internal/streams_stub_factory.cc new file mode 100644 index 0000000000000..291a17b180dff --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_stub_factory.cc @@ -0,0 +1,82 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#include "google/cloud/visionai/v1/internal/streams_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/internal/streams_auth_decorator.h" +#include "google/cloud/visionai/v1/internal/streams_logging_decorator.h" +#include "google/cloud/visionai/v1/internal/streams_metadata_decorator.h" +#include "google/cloud/visionai/v1/internal/streams_stub.h" +#include "google/cloud/visionai/v1/internal/streams_tracing_stub.h" +#include "google/cloud/visionai/v1/streams_service.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultStreamsServiceStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::visionai::v1::StreamsService::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 = MakeStreamsServiceTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/streams_stub_factory.h b/google/cloud/visionai/v1/internal/streams_stub_factory.h new file mode 100644 index 0000000000000..b3466e39f1efb --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_STUB_FACTORY_H + +#include "google/cloud/visionai/v1/internal/streams_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultStreamsServiceStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_STUB_FACTORY_H diff --git a/google/cloud/visionai/v1/internal/streams_tracing_connection.cc b/google/cloud/visionai/v1/internal/streams_tracing_connection.cc new file mode 100644 index 0000000000000..c9e7000192153 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_tracing_connection.cc @@ -0,0 +1,589 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#include "google/cloud/visionai/v1/internal/streams_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamsServiceTracingConnection::StreamsServiceTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StreamRange +StreamsServiceTracingConnection::ListClusters( + google::cloud::visionai::v1::ListClustersRequest request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::ListClusters"); + internal::OTelScope scope(span); + auto sr = child_->ListClusters(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +StreamsServiceTracingConnection::GetCluster( + google::cloud::visionai::v1::GetClusterRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::GetCluster"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetCluster(request)); +} + +future> +StreamsServiceTracingConnection::CreateCluster( + google::cloud::visionai::v1::CreateClusterRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::CreateCluster"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateCluster(request)); +} + +StatusOr +StreamsServiceTracingConnection::CreateCluster( + NoAwaitTag, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::CreateCluster"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateCluster(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::CreateCluster( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::CreateCluster"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateCluster(operation)); +} + +future> +StreamsServiceTracingConnection::UpdateCluster( + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::UpdateCluster"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateCluster(request)); +} + +StatusOr +StreamsServiceTracingConnection::UpdateCluster( + NoAwaitTag, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::UpdateCluster"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateCluster(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::UpdateCluster( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::UpdateCluster"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateCluster(operation)); +} + +future> +StreamsServiceTracingConnection::DeleteCluster( + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::DeleteCluster"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteCluster(request)); +} + +StatusOr +StreamsServiceTracingConnection::DeleteCluster( + NoAwaitTag, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::DeleteCluster"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteCluster(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::DeleteCluster( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::DeleteCluster"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteCluster(operation)); +} + +StreamRange +StreamsServiceTracingConnection::ListStreams( + google::cloud::visionai::v1::ListStreamsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::ListStreams"); + internal::OTelScope scope(span); + auto sr = child_->ListStreams(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +StreamsServiceTracingConnection::GetStream( + google::cloud::visionai::v1::GetStreamRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::GetStream"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetStream(request)); +} + +future> +StreamsServiceTracingConnection::CreateStream( + google::cloud::visionai::v1::CreateStreamRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::CreateStream"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateStream(request)); +} + +StatusOr +StreamsServiceTracingConnection::CreateStream( + NoAwaitTag, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::CreateStream"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateStream(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::CreateStream( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::CreateStream"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateStream(operation)); +} + +future> +StreamsServiceTracingConnection::UpdateStream( + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::UpdateStream"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateStream(request)); +} + +StatusOr +StreamsServiceTracingConnection::UpdateStream( + NoAwaitTag, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::UpdateStream"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateStream(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::UpdateStream( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::UpdateStream"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateStream(operation)); +} + +future> +StreamsServiceTracingConnection::DeleteStream( + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::DeleteStream"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteStream(request)); +} + +StatusOr +StreamsServiceTracingConnection::DeleteStream( + NoAwaitTag, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::DeleteStream"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteStream(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::DeleteStream( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::DeleteStream"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteStream(operation)); +} + +future> +StreamsServiceTracingConnection::GetStreamThumbnail( + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::GetStreamThumbnail"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->GetStreamThumbnail(request)); +} + +StatusOr +StreamsServiceTracingConnection::GetStreamThumbnail( + NoAwaitTag, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::GetStreamThumbnail"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->GetStreamThumbnail(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::GetStreamThumbnail( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::GetStreamThumbnail"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->GetStreamThumbnail(operation)); +} + +StatusOr +StreamsServiceTracingConnection::GenerateStreamHlsToken( + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::GenerateStreamHlsToken"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GenerateStreamHlsToken(request)); +} + +StreamRange +StreamsServiceTracingConnection::ListEvents( + google::cloud::visionai::v1::ListEventsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::ListEvents"); + internal::OTelScope scope(span); + auto sr = child_->ListEvents(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +StreamsServiceTracingConnection::GetEvent( + google::cloud::visionai::v1::GetEventRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::GetEvent"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetEvent(request)); +} + +future> +StreamsServiceTracingConnection::CreateEvent( + google::cloud::visionai::v1::CreateEventRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::CreateEvent"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateEvent(request)); +} + +StatusOr +StreamsServiceTracingConnection::CreateEvent( + NoAwaitTag, + google::cloud::visionai::v1::CreateEventRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::CreateEvent"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateEvent(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::CreateEvent( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::CreateEvent"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateEvent(operation)); +} + +future> +StreamsServiceTracingConnection::UpdateEvent( + google::cloud::visionai::v1::UpdateEventRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::UpdateEvent"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateEvent(request)); +} + +StatusOr +StreamsServiceTracingConnection::UpdateEvent( + NoAwaitTag, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::UpdateEvent"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateEvent(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::UpdateEvent( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::UpdateEvent"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateEvent(operation)); +} + +future> +StreamsServiceTracingConnection::DeleteEvent( + google::cloud::visionai::v1::DeleteEventRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::DeleteEvent"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteEvent(request)); +} + +StatusOr +StreamsServiceTracingConnection::DeleteEvent( + NoAwaitTag, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::DeleteEvent"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteEvent(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::DeleteEvent( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::DeleteEvent"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteEvent(operation)); +} + +StreamRange +StreamsServiceTracingConnection::ListSeries( + google::cloud::visionai::v1::ListSeriesRequest request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::ListSeries"); + internal::OTelScope scope(span); + auto sr = child_->ListSeries(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +StreamsServiceTracingConnection::GetSeries( + google::cloud::visionai::v1::GetSeriesRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::GetSeries"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetSeries(request)); +} + +future> +StreamsServiceTracingConnection::CreateSeries( + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::CreateSeries"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateSeries(request)); +} + +StatusOr +StreamsServiceTracingConnection::CreateSeries( + NoAwaitTag, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::CreateSeries"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateSeries(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::CreateSeries( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::CreateSeries"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateSeries(operation)); +} + +future> +StreamsServiceTracingConnection::UpdateSeries( + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::UpdateSeries"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateSeries(request)); +} + +StatusOr +StreamsServiceTracingConnection::UpdateSeries( + NoAwaitTag, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::UpdateSeries"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateSeries(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::UpdateSeries( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::UpdateSeries"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateSeries(operation)); +} + +future> +StreamsServiceTracingConnection::DeleteSeries( + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::DeleteSeries"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteSeries(request)); +} + +StatusOr +StreamsServiceTracingConnection::DeleteSeries( + NoAwaitTag, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::DeleteSeries"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteSeries(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::DeleteSeries( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::DeleteSeries"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteSeries(operation)); +} + +future> +StreamsServiceTracingConnection::MaterializeChannel( + google::cloud::visionai::v1::MaterializeChannelRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::MaterializeChannel"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->MaterializeChannel(request)); +} + +StatusOr +StreamsServiceTracingConnection::MaterializeChannel( + NoAwaitTag, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::MaterializeChannel"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->MaterializeChannel(NoAwaitTag{}, request)); +} + +future> +StreamsServiceTracingConnection::MaterializeChannel( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::MaterializeChannel"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->MaterializeChannel(operation)); +} + +StreamRange +StreamsServiceTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +StreamsServiceTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +StreamsServiceTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +StreamsServiceTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::StreamsServiceConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status StreamsServiceTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status StreamsServiceTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::StreamsServiceConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeStreamsServiceTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/streams_tracing_connection.h b/google/cloud/visionai/v1/internal/streams_tracing_connection.h new file mode 100644 index 0000000000000..8b72c3db37132 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_tracing_connection.h @@ -0,0 +1,258 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_TRACING_CONNECTION_H + +#include "google/cloud/visionai/v1/streams_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamsServiceTracingConnection + : public visionai_v1::StreamsServiceConnection { + public: + ~StreamsServiceTracingConnection() override = default; + + explicit StreamsServiceTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StreamRange ListClusters( + google::cloud::visionai::v1::ListClustersRequest request) override; + + StatusOr GetCluster( + google::cloud::visionai::v1::GetClusterRequest const& request) override; + + future> CreateCluster( + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + StatusOr CreateCluster( + NoAwaitTag, + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + future> CreateCluster( + google::longrunning::Operation const& operation) override; + + future> UpdateCluster( + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + StatusOr UpdateCluster( + NoAwaitTag, + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + future> UpdateCluster( + google::longrunning::Operation const& operation) override; + + future> + DeleteCluster(google::cloud::visionai::v1::DeleteClusterRequest const& + request) override; + + StatusOr DeleteCluster( + NoAwaitTag, + google::cloud::visionai::v1::DeleteClusterRequest const& request) + override; + + future> + DeleteCluster(google::longrunning::Operation const& operation) override; + + StreamRange ListStreams( + google::cloud::visionai::v1::ListStreamsRequest request) override; + + StatusOr GetStream( + google::cloud::visionai::v1::GetStreamRequest const& request) override; + + future> CreateStream( + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + StatusOr CreateStream( + NoAwaitTag, + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + future> CreateStream( + google::longrunning::Operation const& operation) override; + + future> UpdateStream( + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + StatusOr UpdateStream( + NoAwaitTag, + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + future> UpdateStream( + google::longrunning::Operation const& operation) override; + + future> DeleteStream( + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + StatusOr DeleteStream( + NoAwaitTag, + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + future> DeleteStream( + google::longrunning::Operation const& operation) override; + + future> + GetStreamThumbnail( + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + StatusOr GetStreamThumbnail( + NoAwaitTag, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + future> + GetStreamThumbnail(google::longrunning::Operation const& operation) override; + + StatusOr + GenerateStreamHlsToken( + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) + override; + + StreamRange ListEvents( + google::cloud::visionai::v1::ListEventsRequest request) override; + + StatusOr GetEvent( + google::cloud::visionai::v1::GetEventRequest const& request) override; + + future> CreateEvent( + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + StatusOr CreateEvent( + NoAwaitTag, + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + future> CreateEvent( + google::longrunning::Operation const& operation) override; + + future> UpdateEvent( + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + StatusOr UpdateEvent( + NoAwaitTag, + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + future> UpdateEvent( + google::longrunning::Operation const& operation) override; + + future> DeleteEvent( + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + StatusOr DeleteEvent( + NoAwaitTag, + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + future> DeleteEvent( + google::longrunning::Operation const& operation) override; + + StreamRange ListSeries( + google::cloud::visionai::v1::ListSeriesRequest request) override; + + StatusOr GetSeries( + google::cloud::visionai::v1::GetSeriesRequest const& request) override; + + future> CreateSeries( + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + StatusOr CreateSeries( + NoAwaitTag, + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + future> CreateSeries( + google::longrunning::Operation const& operation) override; + + future> UpdateSeries( + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + StatusOr UpdateSeries( + NoAwaitTag, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + future> UpdateSeries( + google::longrunning::Operation const& operation) override; + + future> DeleteSeries( + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + StatusOr DeleteSeries( + NoAwaitTag, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + future> DeleteSeries( + google::longrunning::Operation const& operation) override; + + future> MaterializeChannel( + google::cloud::visionai::v1::MaterializeChannelRequest const& request) + override; + + StatusOr MaterializeChannel( + NoAwaitTag, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) + override; + + future> MaterializeChannel( + 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_; +}; + +/** + * 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 +MakeStreamsServiceTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_TRACING_CONNECTION_H diff --git a/google/cloud/visionai/v1/internal/streams_tracing_stub.cc b/google/cloud/visionai/v1/internal/streams_tracing_stub.cc new file mode 100644 index 0000000000000..eabc0f5e19394 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_tracing_stub.cc @@ -0,0 +1,616 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#include "google/cloud/visionai/v1/internal/streams_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamsServiceTracingStub::StreamsServiceTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +StreamsServiceTracingStub::ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListClustersRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "ListClusters"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListClusters(context, options, request)); +} + +StatusOr +StreamsServiceTracingStub::GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetClusterRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "GetCluster"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetCluster(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "CreateCluster"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateCluster(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +StreamsServiceTracingStub::CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateClusterRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "CreateCluster"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateCluster(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "UpdateCluster"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateCluster(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +StreamsServiceTracingStub::UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "UpdateCluster"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateCluster(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "DeleteCluster"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteCluster(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +StreamsServiceTracingStub::DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "DeleteCluster"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteCluster(context, options, request)); +} + +StatusOr +StreamsServiceTracingStub::ListStreams( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListStreamsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "ListStreams"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListStreams(context, options, request)); +} + +StatusOr +StreamsServiceTracingStub::GetStream( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "GetStream"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetStream(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncCreateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "CreateStream"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateStream(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +StreamsServiceTracingStub::CreateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateStreamRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "CreateStream"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateStream(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncUpdateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "UpdateStream"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateStream(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +StreamsServiceTracingStub::UpdateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "UpdateStream"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateStream(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncDeleteStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "DeleteStream"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteStream(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +StreamsServiceTracingStub::DeleteStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "DeleteStream"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteStream(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncGetStreamThumbnail( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "GetStreamThumbnail"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncGetStreamThumbnail(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +StreamsServiceTracingStub::GetStreamThumbnail( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "GetStreamThumbnail"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->GetStreamThumbnail(context, options, request)); +} + +StatusOr +StreamsServiceTracingStub::GenerateStreamHlsToken( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "GenerateStreamHlsToken"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, + child_->GenerateStreamHlsToken(context, options, request)); +} + +StatusOr +StreamsServiceTracingStub::ListEvents( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListEventsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "ListEvents"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListEvents(context, options, request)); +} + +StatusOr +StreamsServiceTracingStub::GetEvent( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetEventRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "GetEvent"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetEvent(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncCreateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateEventRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "CreateEvent"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateEvent(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr StreamsServiceTracingStub::CreateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateEventRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "CreateEvent"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateEvent(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncUpdateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "UpdateEvent"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateEvent(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr StreamsServiceTracingStub::UpdateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateEventRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "UpdateEvent"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateEvent(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncDeleteEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "DeleteEvent"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteEvent(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr StreamsServiceTracingStub::DeleteEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteEventRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "DeleteEvent"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteEvent(context, options, request)); +} + +StatusOr +StreamsServiceTracingStub::ListSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSeriesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "ListSeries"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListSeries(context, options, request)); +} + +StatusOr +StreamsServiceTracingStub::GetSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSeriesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "GetSeries"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetSeries(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncCreateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "CreateSeries"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateSeries(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +StreamsServiceTracingStub::CreateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "CreateSeries"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateSeries(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncUpdateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "UpdateSeries"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateSeries(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +StreamsServiceTracingStub::UpdateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "UpdateSeries"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateSeries(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncDeleteSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "DeleteSeries"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteSeries(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +StreamsServiceTracingStub::DeleteSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "DeleteSeries"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteSeries(context, options, request)); +} + +future> +StreamsServiceTracingStub::AsyncMaterializeChannel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "MaterializeChannel"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncMaterializeChannel(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +StreamsServiceTracingStub::MaterializeChannel( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "MaterializeChannel"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->MaterializeChannel(context, options, request)); +} + +StatusOr +StreamsServiceTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +StreamsServiceTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +StreamsServiceTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +StreamsServiceTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status StreamsServiceTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status StreamsServiceTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.StreamsService", + "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +StreamsServiceTracingStub::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 StreamsServiceTracingStub::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)); +} + +std::shared_ptr MakeStreamsServiceTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/streams_tracing_stub.h b/google/cloud/visionai/v1/internal/streams_tracing_stub.h new file mode 100644 index 0000000000000..6d573e7054991 --- /dev/null +++ b/google/cloud/visionai/v1/internal/streams_tracing_stub.h @@ -0,0 +1,288 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_TRACING_STUB_H + +#include "google/cloud/visionai/v1/internal/streams_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamsServiceTracingStub : public StreamsServiceStub { + public: + ~StreamsServiceTracingStub() override = default; + + explicit StreamsServiceTracingStub(std::shared_ptr child); + + StatusOr ListClusters( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListClustersRequest const& request) override; + + StatusOr GetCluster( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetClusterRequest const& request) override; + + future> AsyncCreateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + StatusOr CreateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateClusterRequest const& request) + override; + + future> AsyncUpdateCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + StatusOr UpdateCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateClusterRequest const& request) + override; + + future> AsyncDeleteCluster( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) + override; + + StatusOr DeleteCluster( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteClusterRequest const& request) + override; + + StatusOr ListStreams( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListStreamsRequest const& request) override; + + StatusOr GetStream( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetStreamRequest const& request) override; + + future> AsyncCreateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + StatusOr CreateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateStreamRequest const& request) override; + + future> AsyncUpdateStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + StatusOr UpdateStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateStreamRequest const& request) override; + + future> AsyncDeleteStream( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + StatusOr DeleteStream( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteStreamRequest const& request) override; + + future> AsyncGetStreamThumbnail( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + StatusOr GetStreamThumbnail( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request) + override; + + StatusOr + GenerateStreamHlsToken( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request) + override; + + StatusOr ListEvents( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListEventsRequest const& request) override; + + StatusOr GetEvent( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetEventRequest const& request) override; + + future> AsyncCreateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + StatusOr CreateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateEventRequest const& request) override; + + future> AsyncUpdateEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + StatusOr UpdateEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateEventRequest const& request) override; + + future> AsyncDeleteEvent( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + StatusOr DeleteEvent( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteEventRequest const& request) override; + + StatusOr ListSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSeriesRequest const& request) override; + + StatusOr GetSeries( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSeriesRequest const& request) override; + + future> AsyncCreateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + StatusOr CreateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateSeriesRequest const& request) override; + + future> AsyncUpdateSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + StatusOr UpdateSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateSeriesRequest const& request) override; + + future> AsyncDeleteSeries( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + StatusOr DeleteSeries( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteSeriesRequest const& request) override; + + future> AsyncMaterializeChannel( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::MaterializeChannelRequest const& request) + override; + + StatusOr MaterializeChannel( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::MaterializeChannelRequest 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_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeStreamsServiceTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_STREAMS_TRACING_STUB_H diff --git a/google/cloud/visionai/v1/internal/warehouse_auth_decorator.cc b/google/cloud/visionai/v1/internal/warehouse_auth_decorator.cc new file mode 100644 index 0000000000000..58ceb6103be2a --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_auth_decorator.cc @@ -0,0 +1,1033 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#include "google/cloud/visionai/v1/internal/warehouse_auth_decorator.h" +#include "google/cloud/visionai/v1/warehouse.grpc.pb.h" +#include "google/cloud/internal/async_read_write_stream_auth.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WarehouseAuth::WarehouseAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr WarehouseAuth::CreateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAssetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateAsset(context, options, request); +} + +StatusOr WarehouseAuth::UpdateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAssetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateAsset(context, options, request); +} + +StatusOr WarehouseAuth::GetAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAssetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetAsset(context, options, request); +} + +StatusOr +WarehouseAuth::ListAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAssetsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListAssets(context, options, request); +} + +future> +WarehouseAuth::AsyncDeleteAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAssetRequest 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->AsyncDeleteAsset(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::DeleteAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteAsset(context, options, request); +} + +future> +WarehouseAuth::AsyncUploadAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UploadAssetRequest 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->AsyncUploadAsset(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::UploadAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UploadAsset(context, options, request); +} + +StatusOr +WarehouseAuth::GenerateRetrievalUrl( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GenerateRetrievalUrl(context, options, request); +} + +future> +WarehouseAuth::AsyncAnalyzeAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeAssetRequest 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->AsyncAnalyzeAsset(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::AnalyzeAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->AnalyzeAsset(context, options, request); +} + +future> WarehouseAuth::AsyncIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::IndexAssetRequest 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->AsyncIndexAsset(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::IndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::IndexAssetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->IndexAsset(context, options, request); +} + +future> +WarehouseAuth::AsyncRemoveIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveIndexAssetRequest 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->AsyncRemoveIndexAsset(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::RemoveIndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->RemoveIndexAsset(context, options, request); +} + +StatusOr +WarehouseAuth::ViewIndexedAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewIndexedAssetsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ViewIndexedAssets(context, options, request); +} + +future> +WarehouseAuth::AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexRequest 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->AsyncCreateIndex(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateIndex(context, options, request); +} + +future> +WarehouseAuth::AsyncUpdateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexRequest 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->AsyncUpdateIndex(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::UpdateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateIndex(context, options, request); +} + +StatusOr WarehouseAuth::GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetIndex(context, options, request); +} + +StatusOr +WarehouseAuth::ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListIndexes(context, options, request); +} + +future> +WarehouseAuth::AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexRequest 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->AsyncDeleteIndex(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteIndex(context, options, request); +} + +future> +WarehouseAuth::AsyncCreateCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCorpusRequest 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->AsyncCreateCorpus(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::CreateCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateCorpus(context, options, request); +} + +StatusOr WarehouseAuth::GetCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCorpusRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetCorpus(context, options, request); +} + +StatusOr WarehouseAuth::UpdateCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCorpusRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateCorpus(context, options, request); +} + +StatusOr +WarehouseAuth::ListCorpora( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCorporaRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListCorpora(context, options, request); +} + +Status WarehouseAuth::DeleteCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCorpusRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteCorpus(context, options, request); +} + +future> +WarehouseAuth::AsyncAnalyzeCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeCorpusRequest 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->AsyncAnalyzeCorpus(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::AnalyzeCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->AnalyzeCorpus(context, options, request); +} + +StatusOr +WarehouseAuth::CreateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateDataSchema(context, options, request); +} + +StatusOr +WarehouseAuth::UpdateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateDataSchema(context, options, request); +} + +StatusOr WarehouseAuth::GetDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDataSchemaRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetDataSchema(context, options, request); +} + +Status WarehouseAuth::DeleteDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteDataSchema(context, options, request); +} + +StatusOr +WarehouseAuth::ListDataSchemas( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDataSchemasRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListDataSchemas(context, options, request); +} + +StatusOr +WarehouseAuth::CreateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnnotationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateAnnotation(context, options, request); +} + +StatusOr WarehouseAuth::GetAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnnotationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetAnnotation(context, options, request); +} + +StatusOr +WarehouseAuth::ListAnnotations( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnnotationsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListAnnotations(context, options, request); +} + +StatusOr +WarehouseAuth::UpdateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateAnnotation(context, options, request); +} + +Status WarehouseAuth::DeleteAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteAnnotation(context, options, request); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> +WarehouseAuth::AsyncIngestAsset( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + using StreamAuth = google::cloud::internal::AsyncStreamingReadWriteRpcAuth< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>; + + auto call = [child = child_, cq, options = std::move(options)]( + std::shared_ptr ctx) { + return child->AsyncIngestAsset(cq, std::move(ctx), options); + }; + return std::make_unique( + std::move(context), auth_, StreamAuth::StreamFactory(std::move(call))); +} + +StatusOr +WarehouseAuth::ClipAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ClipAssetRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ClipAsset(context, options, request); +} + +StatusOr +WarehouseAuth::GenerateHlsUri( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GenerateHlsUri(context, options, request); +} + +future> +WarehouseAuth::AsyncImportAssets( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::ImportAssetsRequest 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->AsyncImportAssets(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::ImportAssets( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ImportAssets(context, options, request); +} + +StatusOr +WarehouseAuth::CreateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateSearchConfig(context, options, request); +} + +StatusOr +WarehouseAuth::UpdateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateSearchConfig(context, options, request); +} + +StatusOr +WarehouseAuth::GetSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetSearchConfig(context, options, request); +} + +Status WarehouseAuth::DeleteSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteSearchConfig(context, options, request); +} + +StatusOr +WarehouseAuth::ListSearchConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchConfigsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListSearchConfigs(context, options, request); +} + +StatusOr +WarehouseAuth::CreateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateSearchHypernym(context, options, request); +} + +StatusOr +WarehouseAuth::UpdateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateSearchHypernym(context, options, request); +} + +StatusOr +WarehouseAuth::GetSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetSearchHypernym(context, options, request); +} + +Status WarehouseAuth::DeleteSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteSearchHypernym(context, options, request); +} + +StatusOr +WarehouseAuth::ListSearchHypernyms( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchHypernymsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListSearchHypernyms(context, options, request); +} + +StatusOr +WarehouseAuth::SearchAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchAssetsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->SearchAssets(context, options, request); +} + +StatusOr +WarehouseAuth::SearchIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchIndexEndpointRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->SearchIndexEndpoint(context, options, request); +} + +future> +WarehouseAuth::AsyncCreateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexEndpointRequest 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->AsyncCreateIndexEndpoint(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::CreateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateIndexEndpoint(context, options, request); +} + +StatusOr +WarehouseAuth::GetIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetIndexEndpoint(context, options, request); +} + +StatusOr +WarehouseAuth::ListIndexEndpoints( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexEndpointsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListIndexEndpoints(context, options, request); +} + +future> +WarehouseAuth::AsyncUpdateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest 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->AsyncUpdateIndexEndpoint(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::UpdateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateIndexEndpoint(context, options, request); +} + +future> +WarehouseAuth::AsyncDeleteIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest 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->AsyncDeleteIndexEndpoint(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::DeleteIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteIndexEndpoint(context, options, request); +} + +future> +WarehouseAuth::AsyncDeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployIndexRequest 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->AsyncDeployIndex(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::DeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeployIndex(context, options, request); +} + +future> +WarehouseAuth::AsyncUndeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployIndexRequest 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->AsyncUndeployIndex(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::UndeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UndeployIndex(context, options, request); +} + +future> +WarehouseAuth::AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCollectionRequest 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->AsyncCreateCollection(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateCollection(context, options, request); +} + +future> +WarehouseAuth::AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteCollectionRequest 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->AsyncDeleteCollection(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WarehouseAuth::DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteCollection(context, options, request); +} + +StatusOr WarehouseAuth::GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCollectionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetCollection(context, options, request); +} + +StatusOr +WarehouseAuth::UpdateCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCollectionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateCollection(context, options, request); +} + +StatusOr +WarehouseAuth::ListCollections( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCollectionsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListCollections(context, options, request); +} + +StatusOr +WarehouseAuth::AddCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddCollectionItemRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->AddCollectionItem(context, options, request); +} + +StatusOr +WarehouseAuth::RemoveCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->RemoveCollectionItem(context, options, request); +} + +StatusOr +WarehouseAuth::ViewCollectionItems( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewCollectionItemsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ViewCollectionItems(context, options, request); +} + +StatusOr +WarehouseAuth::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 WarehouseAuth::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 +WarehouseAuth::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 WarehouseAuth::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 WarehouseAuth::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 WarehouseAuth::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> +WarehouseAuth::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 WarehouseAuth::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/warehouse_auth_decorator.h b/google/cloud/visionai/v1/internal/warehouse_auth_decorator.h new file mode 100644 index 0000000000000..567aedc76fd87 --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_auth_decorator.h @@ -0,0 +1,510 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_AUTH_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/warehouse_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WarehouseAuth : public WarehouseStub { + public: + ~WarehouseAuth() override = default; + WarehouseAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr CreateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAssetRequest const& request) override; + + StatusOr UpdateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAssetRequest const& request) override; + + StatusOr GetAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAssetRequest const& request) override; + + StatusOr ListAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAssetsRequest const& request) override; + + future> AsyncDeleteAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + StatusOr DeleteAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + future> AsyncUploadAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + StatusOr UploadAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + StatusOr + GenerateRetrievalUrl( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) + override; + + future> AsyncAnalyzeAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + StatusOr AnalyzeAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + future> AsyncIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + StatusOr IndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + future> AsyncRemoveIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) + override; + + StatusOr RemoveIndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) + override; + + StatusOr + ViewIndexedAssets(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewIndexedAssetsRequest const& + request) override; + + future> AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + StatusOr CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + future> AsyncUpdateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + StatusOr UpdateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + StatusOr GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexRequest const& request) override; + + StatusOr ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexesRequest const& request) override; + + future> AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + StatusOr DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + future> AsyncCreateCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + StatusOr CreateCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + StatusOr GetCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCorpusRequest const& request) override; + + StatusOr UpdateCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCorpusRequest const& request) override; + + StatusOr ListCorpora( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCorporaRequest const& request) override; + + Status DeleteCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCorpusRequest const& request) override; + + future> AsyncAnalyzeCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) + override; + + StatusOr AnalyzeCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) + override; + + StatusOr CreateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) + override; + + StatusOr UpdateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) + override; + + StatusOr GetDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDataSchemaRequest const& request) + override; + + Status DeleteDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) + override; + + StatusOr + ListDataSchemas(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDataSchemasRequest const& + request) override; + + StatusOr CreateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnnotationRequest const& request) + override; + + StatusOr GetAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnnotationRequest const& request) + override; + + StatusOr + ListAnnotations(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnnotationsRequest const& + request) override; + + StatusOr UpdateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) + override; + + Status DeleteAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) + override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> + AsyncIngestAsset(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + StatusOr ClipAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ClipAssetRequest const& request) override; + + StatusOr GenerateHlsUri( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) + override; + + future> AsyncImportAssets( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + StatusOr ImportAssets( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + StatusOr CreateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) + override; + + StatusOr UpdateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) + override; + + StatusOr GetSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchConfigRequest const& request) + override; + + Status DeleteSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) + override; + + StatusOr + ListSearchConfigs(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchConfigsRequest const& + request) override; + + StatusOr CreateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) + override; + + StatusOr UpdateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) + override; + + StatusOr GetSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) + override; + + Status DeleteSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) + override; + + StatusOr + ListSearchHypernyms( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchHypernymsRequest const& request) + override; + + StatusOr SearchAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchAssetsRequest const& request) override; + + StatusOr + SearchIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchIndexEndpointRequest const& request) + override; + + future> AsyncCreateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + StatusOr CreateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + StatusOr GetIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) + override; + + StatusOr + ListIndexEndpoints( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexEndpointsRequest const& request) + override; + + future> AsyncUpdateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + StatusOr UpdateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + future> AsyncDeleteIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + StatusOr DeleteIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + future> AsyncDeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + StatusOr DeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + future> AsyncUndeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) + override; + + StatusOr UndeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) + override; + + future> AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + future> AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) + override; + + StatusOr DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) + override; + + StatusOr GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCollectionRequest const& request) + override; + + StatusOr + ListCollections(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCollectionsRequest const& + request) override; + + StatusOr + AddCollectionItem(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddCollectionItemRequest const& + request) override; + + StatusOr + RemoveCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) + override; + + StatusOr + ViewCollectionItems( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewCollectionItemsRequest 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_AUTH_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/warehouse_connection_impl.cc b/google/cloud/visionai/v1/internal/warehouse_connection_impl.cc new file mode 100644 index 0000000000000..b41f30a227417 --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_connection_impl.cc @@ -0,0 +1,2725 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#include "google/cloud/visionai/v1/internal/warehouse_connection_impl.h" +#include "google/cloud/visionai/v1/internal/warehouse_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 visionai_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 + +WarehouseConnectionImpl::WarehouseConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions(std::move(options), + WarehouseConnection::options())) {} + +StatusOr +WarehouseConnectionImpl::CreateAsset( + google::cloud::visionai::v1::CreateAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateAsset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAssetRequest const& request) { + return stub_->CreateAsset(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +WarehouseConnectionImpl::UpdateAsset( + google::cloud::visionai::v1::UpdateAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateAsset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAssetRequest const& request) { + return stub_->UpdateAsset(context, options, request); + }, + *current, request, __func__); +} + +StatusOr WarehouseConnectionImpl::GetAsset( + google::cloud::visionai::v1::GetAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetAsset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAssetRequest const& request) { + return stub_->GetAsset(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +WarehouseConnectionImpl::ListAssets( + google::cloud::visionai::v1::ListAssetsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListAssets(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::visionai::v1::ListAssetsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAssetsRequest const& request) { + return stub->ListAssets(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListAssetsResponse r) { + std::vector result( + r.assets().size()); + auto& messages = *r.mutable_assets(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +future> +WarehouseConnectionImpl::DeleteAsset( + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteAsset(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::DeleteAssetMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + return stub->AsyncDeleteAsset(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::visionai::v1::DeleteAssetMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr WarehouseConnectionImpl::DeleteAsset( + NoAwaitTag, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteAsset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + return stub_->DeleteAsset(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::DeleteAsset( + 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 DeleteAsset", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::DeleteAssetMetadata>( + 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::visionai::v1::DeleteAssetMetadata>, + polling_policy(*current), __func__); +} + +future> +WarehouseConnectionImpl::UploadAsset( + google::cloud::visionai::v1::UploadAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UploadAsset(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::UploadAssetResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + return stub->AsyncUploadAsset(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::visionai::v1::UploadAssetResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr WarehouseConnectionImpl::UploadAsset( + NoAwaitTag, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UploadAsset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + return stub_->UploadAsset(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::UploadAsset( + 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 UploadAsset", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::UploadAssetResponse>( + 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::visionai::v1::UploadAssetResponse>, + polling_policy(*current), __func__); +} + +StatusOr +WarehouseConnectionImpl::GenerateRetrievalUrl( + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GenerateRetrievalUrl(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& + request) { + return stub_->GenerateRetrievalUrl(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::AnalyzeAsset( + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->AnalyzeAsset(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::AnalyzeAssetResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + return stub->AsyncAnalyzeAsset(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::visionai::v1::AnalyzeAssetResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr WarehouseConnectionImpl::AnalyzeAsset( + NoAwaitTag, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->AnalyzeAsset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + return stub_->AnalyzeAsset(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::AnalyzeAsset( + 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 AnalyzeAsset", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::AnalyzeAssetResponse>( + 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::visionai::v1::AnalyzeAssetResponse>, + polling_policy(*current), __func__); +} + +future> +WarehouseConnectionImpl::IndexAsset( + google::cloud::visionai::v1::IndexAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->IndexAsset(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::IndexAssetResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::IndexAssetRequest const& request) { + return stub->AsyncIndexAsset(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::visionai::v1::IndexAssetResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr WarehouseConnectionImpl::IndexAsset( + NoAwaitTag, google::cloud::visionai::v1::IndexAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->IndexAsset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::IndexAssetRequest const& request) { + return stub_->IndexAsset(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::IndexAsset( + 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 IndexAsset", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::IndexAssetResponse>( + 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::visionai::v1::IndexAssetResponse>, + polling_policy(*current), __func__); +} + +future> +WarehouseConnectionImpl::RemoveIndexAsset( + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->RemoveIndexAsset(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::RemoveIndexAssetResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + return stub->AsyncRemoveIndexAsset(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::visionai::v1::RemoveIndexAssetResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +WarehouseConnectionImpl::RemoveIndexAsset( + NoAwaitTag, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->RemoveIndexAsset(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + return stub_->RemoveIndexAsset(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::RemoveIndexAsset( + 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 RemoveIndexAsset", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::RemoveIndexAssetResponse>( + 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::visionai::v1::RemoveIndexAssetResponse>, + polling_policy(*current), __func__); +} + +StreamRange +WarehouseConnectionImpl::ViewIndexedAssets( + google::cloud::visionai::v1::ViewIndexedAssetsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ViewIndexedAssets(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::visionai::v1::ViewIndexedAssetsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewIndexedAssetsRequest const& + request) { + return stub->ViewIndexedAssets(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ViewIndexedAssetsResponse r) { + std::vector result( + r.indexed_assets().size()); + auto& messages = *r.mutable_indexed_assets(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +future> +WarehouseConnectionImpl::CreateIndex( + google::cloud::visionai::v1::CreateIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateIndex(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Index>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + return stub->AsyncCreateIndex(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::visionai::v1::Index>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr WarehouseConnectionImpl::CreateIndex( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateIndex(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + return stub_->CreateIndex(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::CreateIndex( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateIndex", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Index>( + 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::visionai::v1::Index>, + polling_policy(*current), __func__); +} + +future> +WarehouseConnectionImpl::UpdateIndex( + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateIndex(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Index>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + return stub->AsyncUpdateIndex(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::visionai::v1::Index>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr WarehouseConnectionImpl::UpdateIndex( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateIndex(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + return stub_->UpdateIndex(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::UpdateIndex( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateIndex", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Index>( + 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::visionai::v1::Index>, + polling_policy(*current), __func__); +} + +StatusOr WarehouseConnectionImpl::GetIndex( + google::cloud::visionai::v1::GetIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetIndex(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexRequest const& request) { + return stub_->GetIndex(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +WarehouseConnectionImpl::ListIndexes( + google::cloud::visionai::v1::ListIndexesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListIndexes(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::visionai::v1::ListIndexesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexesRequest const& + request) { + return stub->ListIndexes(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListIndexesResponse r) { + std::vector result( + r.indexes().size()); + auto& messages = *r.mutable_indexes(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +future> +WarehouseConnectionImpl::DeleteIndex( + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteIndex(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::DeleteIndexMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + return stub->AsyncDeleteIndex(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::visionai::v1::DeleteIndexMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr WarehouseConnectionImpl::DeleteIndex( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteIndex(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + return stub_->DeleteIndex(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::DeleteIndex( + 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 DeleteIndex", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::DeleteIndexMetadata>( + 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::visionai::v1::DeleteIndexMetadata>, + polling_policy(*current), __func__); +} + +future> +WarehouseConnectionImpl::CreateCorpus( + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateCorpus(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Corpus>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + return stub->AsyncCreateCorpus(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::visionai::v1::Corpus>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr WarehouseConnectionImpl::CreateCorpus( + NoAwaitTag, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateCorpus(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + return stub_->CreateCorpus(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::CreateCorpus( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateCorpus", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Corpus>( + 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::visionai::v1::Corpus>, + polling_policy(*current), __func__); +} + +StatusOr +WarehouseConnectionImpl::GetCorpus( + google::cloud::visionai::v1::GetCorpusRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetCorpus(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCorpusRequest const& request) { + return stub_->GetCorpus(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +WarehouseConnectionImpl::UpdateCorpus( + google::cloud::visionai::v1::UpdateCorpusRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateCorpus(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCorpusRequest const& request) { + return stub_->UpdateCorpus(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +WarehouseConnectionImpl::ListCorpora( + google::cloud::visionai::v1::ListCorporaRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListCorpora(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::visionai::v1::ListCorporaRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCorporaRequest const& + request) { + return stub->ListCorpora(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListCorporaResponse r) { + std::vector result( + r.corpora().size()); + auto& messages = *r.mutable_corpora(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +Status WarehouseConnectionImpl::DeleteCorpus( + google::cloud::visionai::v1::DeleteCorpusRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteCorpus(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCorpusRequest const& request) { + return stub_->DeleteCorpus(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::AnalyzeCorpus( + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->AnalyzeCorpus(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::AnalyzeCorpusResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + return stub->AsyncAnalyzeCorpus(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::visionai::v1::AnalyzeCorpusResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr WarehouseConnectionImpl::AnalyzeCorpus( + NoAwaitTag, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->AnalyzeCorpus(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + return stub_->AnalyzeCorpus(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::AnalyzeCorpus( + 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 AnalyzeCorpus", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::AnalyzeCorpusResponse>( + 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::visionai::v1::AnalyzeCorpusResponse>, + polling_policy(*current), __func__); +} + +StatusOr +WarehouseConnectionImpl::CreateDataSchema( + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateDataSchema(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) { + return stub_->CreateDataSchema(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +WarehouseConnectionImpl::UpdateDataSchema( + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateDataSchema(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) { + return stub_->UpdateDataSchema(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +WarehouseConnectionImpl::GetDataSchema( + google::cloud::visionai::v1::GetDataSchemaRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetDataSchema(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDataSchemaRequest const& request) { + return stub_->GetDataSchema(context, options, request); + }, + *current, request, __func__); +} + +Status WarehouseConnectionImpl::DeleteDataSchema( + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteDataSchema(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) { + return stub_->DeleteDataSchema(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +WarehouseConnectionImpl::ListDataSchemas( + google::cloud::visionai::v1::ListDataSchemasRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListDataSchemas(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::visionai::v1::ListDataSchemasRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDataSchemasRequest const& + request) { + return stub->ListDataSchemas(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListDataSchemasResponse r) { + std::vector result( + r.data_schemas().size()); + auto& messages = *r.mutable_data_schemas(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +WarehouseConnectionImpl::CreateAnnotation( + google::cloud::visionai::v1::CreateAnnotationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateAnnotation(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnnotationRequest const& request) { + return stub_->CreateAnnotation(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +WarehouseConnectionImpl::GetAnnotation( + google::cloud::visionai::v1::GetAnnotationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetAnnotation(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnnotationRequest const& request) { + return stub_->GetAnnotation(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +WarehouseConnectionImpl::ListAnnotations( + google::cloud::visionai::v1::ListAnnotationsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListAnnotations(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::visionai::v1::ListAnnotationsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnnotationsRequest const& + request) { + return stub->ListAnnotations(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListAnnotationsResponse r) { + std::vector result( + r.annotations().size()); + auto& messages = *r.mutable_annotations(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +WarehouseConnectionImpl::UpdateAnnotation( + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateAnnotation(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) { + return stub_->UpdateAnnotation(context, options, request); + }, + *current, request, __func__); +} + +Status WarehouseConnectionImpl::DeleteAnnotation( + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteAnnotation(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) { + return stub_->DeleteAnnotation(context, options, request); + }, + *current, request, __func__); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> +WarehouseConnectionImpl::AsyncIngestAsset() { + return stub_->AsyncIngestAsset(background_->cq(), + std::make_shared(), + internal::SaveCurrentOptions()); +} + +StatusOr +WarehouseConnectionImpl::ClipAsset( + google::cloud::visionai::v1::ClipAssetRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ClipAsset(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ClipAssetRequest const& request) { + return stub_->ClipAsset(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +WarehouseConnectionImpl::GenerateHlsUri( + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GenerateHlsUri(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) { + return stub_->GenerateHlsUri(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::ImportAssets( + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->ImportAssets(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::ImportAssetsResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + return stub->AsyncImportAssets(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::visionai::v1::ImportAssetsResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr WarehouseConnectionImpl::ImportAssets( + NoAwaitTag, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ImportAssets(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + return stub_->ImportAssets(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::ImportAssets( + 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 ImportAssets", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::ImportAssetsResponse>( + 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::visionai::v1::ImportAssetsResponse>, + polling_policy(*current), __func__); +} + +StatusOr +WarehouseConnectionImpl::CreateSearchConfig( + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateSearchConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchConfigRequest const& + request) { + return stub_->CreateSearchConfig(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +WarehouseConnectionImpl::UpdateSearchConfig( + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateSearchConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchConfigRequest const& + request) { + return stub_->UpdateSearchConfig(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +WarehouseConnectionImpl::GetSearchConfig( + google::cloud::visionai::v1::GetSearchConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetSearchConfig(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchConfigRequest const& request) { + return stub_->GetSearchConfig(context, options, request); + }, + *current, request, __func__); +} + +Status WarehouseConnectionImpl::DeleteSearchConfig( + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteSearchConfig(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchConfigRequest const& + request) { + return stub_->DeleteSearchConfig(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +WarehouseConnectionImpl::ListSearchConfigs( + google::cloud::visionai::v1::ListSearchConfigsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListSearchConfigs(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::visionai::v1::ListSearchConfigsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchConfigsRequest const& + request) { + return stub->ListSearchConfigs(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListSearchConfigsResponse r) { + std::vector result( + r.search_configs().size()); + auto& messages = *r.mutable_search_configs(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +WarehouseConnectionImpl::CreateSearchHypernym( + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateSearchHypernym(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchHypernymRequest const& + request) { + return stub_->CreateSearchHypernym(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +WarehouseConnectionImpl::UpdateSearchHypernym( + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateSearchHypernym(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& + request) { + return stub_->UpdateSearchHypernym(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +WarehouseConnectionImpl::GetSearchHypernym( + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetSearchHypernym(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchHypernymRequest const& + request) { + return stub_->GetSearchHypernym(context, options, request); + }, + *current, request, __func__); +} + +Status WarehouseConnectionImpl::DeleteSearchHypernym( + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteSearchHypernym(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& + request) { + return stub_->DeleteSearchHypernym(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +WarehouseConnectionImpl::ListSearchHypernyms( + google::cloud::visionai::v1::ListSearchHypernymsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListSearchHypernyms(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::visionai::v1::ListSearchHypernymsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchHypernymsRequest const& + request) { + return stub->ListSearchHypernyms(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListSearchHypernymsResponse r) { + std::vector result( + r.search_hypernyms().size()); + auto& messages = *r.mutable_search_hypernyms(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StreamRange +WarehouseConnectionImpl::SearchAssets( + google::cloud::visionai::v1::SearchAssetsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->SearchAssets(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::visionai::v1::SearchAssetsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchAssetsRequest const& + request) { + return stub->SearchAssets(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::SearchAssetsResponse r) { + std::vector result( + r.search_result_items().size()); + auto& messages = *r.mutable_search_result_items(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StreamRange +WarehouseConnectionImpl::SearchIndexEndpoint( + google::cloud::visionai::v1::SearchIndexEndpointRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->SearchIndexEndpoint(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::visionai::v1::SearchIndexEndpointRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchIndexEndpointRequest const& + request) { + return stub->SearchIndexEndpoint(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::SearchIndexEndpointResponse r) { + std::vector result( + r.search_result_items().size()); + auto& messages = *r.mutable_search_result_items(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +future> +WarehouseConnectionImpl::CreateIndexEndpoint( + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateIndexEndpoint(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::IndexEndpoint>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& + request) { + return stub->AsyncCreateIndexEndpoint(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::visionai::v1::IndexEndpoint>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +WarehouseConnectionImpl::CreateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateIndexEndpoint(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& + request) { + return stub_->CreateIndexEndpoint(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::CreateIndexEndpoint( + 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 CreateIndexEndpoint", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::IndexEndpoint>( + 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::visionai::v1::IndexEndpoint>, + polling_policy(*current), __func__); +} + +StatusOr +WarehouseConnectionImpl::GetIndexEndpoint( + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetIndexEndpoint(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) { + return stub_->GetIndexEndpoint(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +WarehouseConnectionImpl::ListIndexEndpoints( + google::cloud::visionai::v1::ListIndexEndpointsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListIndexEndpoints(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::visionai::v1::ListIndexEndpointsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexEndpointsRequest const& + request) { + return stub->ListIndexEndpoints(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListIndexEndpointsResponse r) { + std::vector result( + r.index_endpoints().size()); + auto& messages = *r.mutable_index_endpoints(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +future> +WarehouseConnectionImpl::UpdateIndexEndpoint( + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateIndexEndpoint(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::IndexEndpoint>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& + request) { + return stub->AsyncUpdateIndexEndpoint(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::visionai::v1::IndexEndpoint>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +WarehouseConnectionImpl::UpdateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateIndexEndpoint(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& + request) { + return stub_->UpdateIndexEndpoint(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::UpdateIndexEndpoint( + 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 UpdateIndexEndpoint", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::IndexEndpoint>( + 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::visionai::v1::IndexEndpoint>, + polling_policy(*current), __func__); +} + +future> +WarehouseConnectionImpl::DeleteIndexEndpoint( + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteIndexEndpoint(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::DeleteIndexEndpointMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& + request) { + return stub->AsyncDeleteIndexEndpoint(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::visionai::v1::DeleteIndexEndpointMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +WarehouseConnectionImpl::DeleteIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteIndexEndpoint(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& + request) { + return stub_->DeleteIndexEndpoint(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::DeleteIndexEndpoint( + 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 DeleteIndexEndpoint", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::DeleteIndexEndpointMetadata>( + 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::visionai::v1::DeleteIndexEndpointMetadata>, + polling_policy(*current), __func__); +} + +future> +WarehouseConnectionImpl::DeployIndex( + google::cloud::visionai::v1::DeployIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeployIndex(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::DeployIndexResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + return stub->AsyncDeployIndex(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::visionai::v1::DeployIndexResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr WarehouseConnectionImpl::DeployIndex( + NoAwaitTag, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeployIndex(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + return stub_->DeployIndex(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::DeployIndex( + 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 DeployIndex", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::DeployIndexResponse>( + 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::visionai::v1::DeployIndexResponse>, + polling_policy(*current), __func__); +} + +future> +WarehouseConnectionImpl::UndeployIndex( + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UndeployIndex(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::UndeployIndexResponse>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + return stub->AsyncUndeployIndex(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::visionai::v1::UndeployIndexResponse>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr WarehouseConnectionImpl::UndeployIndex( + NoAwaitTag, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UndeployIndex(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + return stub_->UndeployIndex(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::UndeployIndex( + 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 UndeployIndex", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::UndeployIndexResponse>( + 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::visionai::v1::UndeployIndexResponse>, + polling_policy(*current), __func__); +} + +future> +WarehouseConnectionImpl::CreateCollection( + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateCollection(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::Collection>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + return stub->AsyncCreateCollection(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::visionai::v1::Collection>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +WarehouseConnectionImpl::CreateCollection( + NoAwaitTag, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateCollection(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + return stub_->CreateCollection(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::CreateCollection( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future>( + internal::InvalidArgumentError( + "operation does not correspond to CreateCollection", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::Collection>( + 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::visionai::v1::Collection>, + polling_policy(*current), __func__); +} + +future> +WarehouseConnectionImpl::DeleteCollection( + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteCollection(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::visionai::v1::DeleteCollectionMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + return stub->AsyncDeleteCollection(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::visionai::v1::DeleteCollectionMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +WarehouseConnectionImpl::DeleteCollection( + NoAwaitTag, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteCollection(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + return stub_->DeleteCollection(context, options, request); + }, + *current, request, __func__); +} + +future> +WarehouseConnectionImpl::DeleteCollection( + 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 DeleteCollection", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::visionai::v1::DeleteCollectionMetadata>( + 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::visionai::v1::DeleteCollectionMetadata>, + polling_policy(*current), __func__); +} + +StatusOr +WarehouseConnectionImpl::GetCollection( + google::cloud::visionai::v1::GetCollectionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetCollection(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCollectionRequest const& request) { + return stub_->GetCollection(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +WarehouseConnectionImpl::UpdateCollection( + google::cloud::visionai::v1::UpdateCollectionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateCollection(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCollectionRequest const& request) { + return stub_->UpdateCollection(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +WarehouseConnectionImpl::ListCollections( + google::cloud::visionai::v1::ListCollectionsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListCollections(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::visionai::v1::ListCollectionsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCollectionsRequest const& + request) { + return stub->ListCollections(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ListCollectionsResponse r) { + std::vector result( + r.collections().size()); + auto& messages = *r.mutable_collections(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +WarehouseConnectionImpl::AddCollectionItem( + google::cloud::visionai::v1::AddCollectionItemRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->AddCollectionItem(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddCollectionItemRequest const& + request) { + return stub_->AddCollectionItem(context, options, request); + }, + *current, request, __func__); +} + +StatusOr +WarehouseConnectionImpl::RemoveCollectionItem( + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->RemoveCollectionItem(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveCollectionItemRequest const& + request) { + return stub_->RemoveCollectionItem(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +WarehouseConnectionImpl::ViewCollectionItems( + google::cloud::visionai::v1::ViewCollectionItemsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ViewCollectionItems(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::visionai::v1::ViewCollectionItemsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewCollectionItemsRequest const& + request) { + return stub->ViewCollectionItems(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::visionai::v1::ViewCollectionItemsResponse r) { + std::vector result( + r.items().size()); + auto& messages = *r.mutable_items(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StreamRange +WarehouseConnectionImpl::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 +WarehouseConnectionImpl::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 +WarehouseConnectionImpl::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 WarehouseConnectionImpl::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 WarehouseConnectionImpl::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 WarehouseConnectionImpl::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 visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/warehouse_connection_impl.h b/google/cloud/visionai/v1/internal/warehouse_connection_impl.h new file mode 100644 index 0000000000000..fdcadcf7b6c3b --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_connection_impl.h @@ -0,0 +1,452 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_CONNECTION_IMPL_H + +#include "google/cloud/visionai/v1/internal/warehouse_retry_traits.h" +#include "google/cloud/visionai/v1/internal/warehouse_stub.h" +#include "google/cloud/visionai/v1/warehouse_connection.h" +#include "google/cloud/visionai/v1/warehouse_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/warehouse_options.h" +#include "google/cloud/async_streaming_read_write_rpc.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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WarehouseConnectionImpl : public visionai_v1::WarehouseConnection { + public: + ~WarehouseConnectionImpl() override = default; + + WarehouseConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + StatusOr CreateAsset( + google::cloud::visionai::v1::CreateAssetRequest const& request) override; + + StatusOr UpdateAsset( + google::cloud::visionai::v1::UpdateAssetRequest const& request) override; + + StatusOr GetAsset( + google::cloud::visionai::v1::GetAssetRequest const& request) override; + + StreamRange ListAssets( + google::cloud::visionai::v1::ListAssetsRequest request) override; + + future> + DeleteAsset( + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + StatusOr DeleteAsset( + NoAwaitTag, + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + future> + DeleteAsset(google::longrunning::Operation const& operation) override; + + future> + UploadAsset( + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + StatusOr UploadAsset( + NoAwaitTag, + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + future> + UploadAsset(google::longrunning::Operation const& operation) override; + + StatusOr + GenerateRetrievalUrl( + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) + override; + + future> + AnalyzeAsset( + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + StatusOr AnalyzeAsset( + NoAwaitTag, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + future> + AnalyzeAsset(google::longrunning::Operation const& operation) override; + + future> IndexAsset( + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + StatusOr IndexAsset( + NoAwaitTag, + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + future> IndexAsset( + google::longrunning::Operation const& operation) override; + + future> + RemoveIndexAsset(google::cloud::visionai::v1::RemoveIndexAssetRequest const& + request) override; + + StatusOr RemoveIndexAsset( + NoAwaitTag, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) + override; + + future> + RemoveIndexAsset(google::longrunning::Operation const& operation) override; + + StreamRange ViewIndexedAssets( + google::cloud::visionai::v1::ViewIndexedAssetsRequest request) override; + + future> CreateIndex( + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + StatusOr CreateIndex( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + future> CreateIndex( + google::longrunning::Operation const& operation) override; + + future> UpdateIndex( + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + StatusOr UpdateIndex( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + future> UpdateIndex( + google::longrunning::Operation const& operation) override; + + StatusOr GetIndex( + google::cloud::visionai::v1::GetIndexRequest const& request) override; + + StreamRange ListIndexes( + google::cloud::visionai::v1::ListIndexesRequest request) override; + + future> + DeleteIndex( + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + StatusOr DeleteIndex( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + future> + DeleteIndex(google::longrunning::Operation const& operation) override; + + future> CreateCorpus( + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + StatusOr CreateCorpus( + NoAwaitTag, + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + future> CreateCorpus( + google::longrunning::Operation const& operation) override; + + StatusOr GetCorpus( + google::cloud::visionai::v1::GetCorpusRequest const& request) override; + + StatusOr UpdateCorpus( + google::cloud::visionai::v1::UpdateCorpusRequest const& request) override; + + StreamRange ListCorpora( + google::cloud::visionai::v1::ListCorporaRequest request) override; + + Status DeleteCorpus( + google::cloud::visionai::v1::DeleteCorpusRequest const& request) override; + + future> + AnalyzeCorpus(google::cloud::visionai::v1::AnalyzeCorpusRequest const& + request) override; + + StatusOr AnalyzeCorpus( + NoAwaitTag, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) + override; + + future> + AnalyzeCorpus(google::longrunning::Operation const& operation) override; + + StatusOr CreateDataSchema( + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) + override; + + StatusOr UpdateDataSchema( + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) + override; + + StatusOr GetDataSchema( + google::cloud::visionai::v1::GetDataSchemaRequest const& request) + override; + + Status DeleteDataSchema( + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) + override; + + StreamRange ListDataSchemas( + google::cloud::visionai::v1::ListDataSchemasRequest request) override; + + StatusOr CreateAnnotation( + google::cloud::visionai::v1::CreateAnnotationRequest const& request) + override; + + StatusOr GetAnnotation( + google::cloud::visionai::v1::GetAnnotationRequest const& request) + override; + + StreamRange ListAnnotations( + google::cloud::visionai::v1::ListAnnotationsRequest request) override; + + StatusOr UpdateAnnotation( + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) + override; + + Status DeleteAnnotation( + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) + override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> + AsyncIngestAsset() override; + + StatusOr ClipAsset( + google::cloud::visionai::v1::ClipAssetRequest const& request) override; + + StatusOr GenerateHlsUri( + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) + override; + + future> + ImportAssets( + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + StatusOr ImportAssets( + NoAwaitTag, + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + future> + ImportAssets(google::longrunning::Operation const& operation) override; + + StatusOr CreateSearchConfig( + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) + override; + + StatusOr UpdateSearchConfig( + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) + override; + + StatusOr GetSearchConfig( + google::cloud::visionai::v1::GetSearchConfigRequest const& request) + override; + + Status DeleteSearchConfig( + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) + override; + + StreamRange ListSearchConfigs( + google::cloud::visionai::v1::ListSearchConfigsRequest request) override; + + StatusOr CreateSearchHypernym( + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) + override; + + StatusOr UpdateSearchHypernym( + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) + override; + + StatusOr GetSearchHypernym( + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) + override; + + Status DeleteSearchHypernym( + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) + override; + + StreamRange ListSearchHypernyms( + google::cloud::visionai::v1::ListSearchHypernymsRequest request) override; + + StreamRange SearchAssets( + google::cloud::visionai::v1::SearchAssetsRequest request) override; + + StreamRange + SearchIndexEndpoint( + google::cloud::visionai::v1::SearchIndexEndpointRequest request) override; + + future> + CreateIndexEndpoint( + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + StatusOr CreateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + future> + CreateIndexEndpoint(google::longrunning::Operation const& operation) override; + + StatusOr GetIndexEndpoint( + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) + override; + + StreamRange ListIndexEndpoints( + google::cloud::visionai::v1::ListIndexEndpointsRequest request) override; + + future> + UpdateIndexEndpoint( + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + StatusOr UpdateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + future> + UpdateIndexEndpoint(google::longrunning::Operation const& operation) override; + + future> + DeleteIndexEndpoint( + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + StatusOr DeleteIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + future> + DeleteIndexEndpoint(google::longrunning::Operation const& operation) override; + + future> + DeployIndex( + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + StatusOr DeployIndex( + NoAwaitTag, + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + future> + DeployIndex(google::longrunning::Operation const& operation) override; + + future> + UndeployIndex(google::cloud::visionai::v1::UndeployIndexRequest const& + request) override; + + StatusOr UndeployIndex( + NoAwaitTag, + google::cloud::visionai::v1::UndeployIndexRequest const& request) + override; + + future> + UndeployIndex(google::longrunning::Operation const& operation) override; + + future> CreateCollection( + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + NoAwaitTag, + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + future> CreateCollection( + google::longrunning::Operation const& operation) override; + + future> + DeleteCollection(google::cloud::visionai::v1::DeleteCollectionRequest const& + request) override; + + StatusOr DeleteCollection( + NoAwaitTag, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) + override; + + future> + DeleteCollection(google::longrunning::Operation const& operation) override; + + StatusOr GetCollection( + google::cloud::visionai::v1::GetCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + google::cloud::visionai::v1::UpdateCollectionRequest const& request) + override; + + StreamRange ListCollections( + google::cloud::visionai::v1::ListCollectionsRequest request) override; + + StatusOr + AddCollectionItem(google::cloud::visionai::v1::AddCollectionItemRequest const& + request) override; + + StatusOr + RemoveCollectionItem( + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) + override; + + StreamRange ViewCollectionItems( + google::cloud::visionai::v1::ViewCollectionItemsRequest request) 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_CONNECTION_IMPL_H diff --git a/google/cloud/visionai/v1/internal/warehouse_logging_decorator.cc b/google/cloud/visionai/v1/internal/warehouse_logging_decorator.cc new file mode 100644 index 0000000000000..21eb55e5f0dd8 --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_logging_decorator.cc @@ -0,0 +1,1255 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#include "google/cloud/visionai/v1/internal/warehouse_logging_decorator.h" +#include "google/cloud/visionai/v1/warehouse.grpc.pb.h" +#include "google/cloud/internal/async_read_write_stream_logging.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WarehouseLogging::WarehouseLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components) + : child_(std::move(child)), + tracing_options_(std::move(tracing_options)), + stream_logging_(components.find("rpc-streams") != components.end()) {} + +StatusOr WarehouseLogging::CreateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAssetRequest const& request) { + return child_->CreateAsset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr WarehouseLogging::UpdateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAssetRequest const& request) { + return child_->UpdateAsset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr WarehouseLogging::GetAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAssetRequest const& request) { + return child_->GetAsset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::ListAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAssetsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAssetsRequest const& request) { + return child_->ListAssets(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncDeleteAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + return child_->AsyncDeleteAsset(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::DeleteAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + return child_->DeleteAsset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncUploadAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + return child_->AsyncUploadAsset(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::UploadAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + return child_->UploadAsset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::GenerateRetrievalUrl( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& + request) { + return child_->GenerateRetrievalUrl(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncAnalyzeAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + return child_->AsyncAnalyzeAsset(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::AnalyzeAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + return child_->AnalyzeAsset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::IndexAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::IndexAssetRequest const& request) { + return child_->AsyncIndexAsset(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::IndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::IndexAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::IndexAssetRequest const& request) { + return child_->IndexAsset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncRemoveIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + return child_->AsyncRemoveIndexAsset(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::RemoveIndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + return child_->RemoveIndexAsset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::ViewIndexedAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewIndexedAssetsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewIndexedAssetsRequest const& + request) { + return child_->ViewIndexedAssets(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + return child_->AsyncCreateIndex(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + return child_->CreateIndex(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncUpdateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + return child_->AsyncUpdateIndex(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::UpdateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + return child_->UpdateIndex(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr WarehouseLogging::GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexRequest const& request) { + return child_->GetIndex(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexesRequest const& request) { + return child_->ListIndexes(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + return child_->AsyncDeleteIndex(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + return child_->DeleteIndex(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncCreateCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + return child_->AsyncCreateCorpus(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::CreateCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + return child_->CreateCorpus(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr WarehouseLogging::GetCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCorpusRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCorpusRequest const& request) { + return child_->GetCorpus(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr WarehouseLogging::UpdateCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCorpusRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCorpusRequest const& request) { + return child_->UpdateCorpus(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::ListCorpora( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCorporaRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCorporaRequest const& request) { + return child_->ListCorpora(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status WarehouseLogging::DeleteCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCorpusRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCorpusRequest const& request) { + return child_->DeleteCorpus(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncAnalyzeCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + return child_->AsyncAnalyzeCorpus(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::AnalyzeCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + return child_->AnalyzeCorpus(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::CreateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) { + return child_->CreateDataSchema(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::UpdateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) { + return child_->UpdateDataSchema(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::GetDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDataSchemaRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDataSchemaRequest const& request) { + return child_->GetDataSchema(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status WarehouseLogging::DeleteDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) { + return child_->DeleteDataSchema(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::ListDataSchemas( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDataSchemasRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDataSchemasRequest const& request) { + return child_->ListDataSchemas(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::CreateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnnotationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnnotationRequest const& request) { + return child_->CreateAnnotation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::GetAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnnotationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnnotationRequest const& request) { + return child_->GetAnnotation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::ListAnnotations( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnnotationsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnnotationsRequest const& request) { + return child_->ListAnnotations(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::UpdateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) { + return child_->UpdateAnnotation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status WarehouseLogging::DeleteAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) { + return child_->DeleteAnnotation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> +WarehouseLogging::AsyncIngestAsset( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + using LoggingStream = + ::google::cloud::internal::AsyncStreamingReadWriteRpcLogging< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>; + + auto request_id = google::cloud::internal::RequestIdForLogging(); + GCP_LOG(DEBUG) << __func__ << "(" << request_id << ")"; + auto stream = + child_->AsyncIngestAsset(cq, std::move(context), std::move(options)); + if (stream_logging_) { + stream = std::make_unique( + std::move(stream), tracing_options_, std::move(request_id)); + } + return stream; +} + +StatusOr +WarehouseLogging::ClipAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ClipAssetRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ClipAssetRequest const& request) { + return child_->ClipAsset(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::GenerateHlsUri( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) { + return child_->GenerateHlsUri(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncImportAssets( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + return child_->AsyncImportAssets(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::ImportAssets( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + return child_->ImportAssets(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::CreateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchConfigRequest const& + request) { + return child_->CreateSearchConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::UpdateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchConfigRequest const& + request) { + return child_->UpdateSearchConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::GetSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchConfigRequest const& request) { + return child_->GetSearchConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status WarehouseLogging::DeleteSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchConfigRequest const& + request) { + return child_->DeleteSearchConfig(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::ListSearchConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchConfigsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchConfigsRequest const& + request) { + return child_->ListSearchConfigs(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::CreateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchHypernymRequest const& + request) { + return child_->CreateSearchHypernym(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::UpdateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& + request) { + return child_->UpdateSearchHypernym(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::GetSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchHypernymRequest const& + request) { + return child_->GetSearchHypernym(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status WarehouseLogging::DeleteSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& + request) { + return child_->DeleteSearchHypernym(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::ListSearchHypernyms( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchHypernymsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchHypernymsRequest const& + request) { + return child_->ListSearchHypernyms(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::SearchAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchAssetsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchAssetsRequest const& request) { + return child_->SearchAssets(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::SearchIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchIndexEndpointRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchIndexEndpointRequest const& + request) { + return child_->SearchIndexEndpoint(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncCreateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& + request) { + return child_->AsyncCreateIndexEndpoint(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::CreateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& + request) { + return child_->CreateIndexEndpoint(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::GetIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) { + return child_->GetIndexEndpoint(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::ListIndexEndpoints( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexEndpointsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexEndpointsRequest const& + request) { + return child_->ListIndexEndpoints(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncUpdateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& + request) { + return child_->AsyncUpdateIndexEndpoint(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::UpdateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& + request) { + return child_->UpdateIndexEndpoint(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncDeleteIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& + request) { + return child_->AsyncDeleteIndexEndpoint(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::DeleteIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& + request) { + return child_->DeleteIndexEndpoint(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncDeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + return child_->AsyncDeployIndex(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::DeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + return child_->DeployIndex(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncUndeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + return child_->AsyncUndeployIndex(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::UndeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + return child_->UndeployIndex(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + return child_->AsyncCreateCollection(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + return child_->CreateCollection(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WarehouseLogging::AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + return child_->AsyncDeleteCollection(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WarehouseLogging::DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + return child_->DeleteCollection(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCollectionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCollectionRequest const& request) { + return child_->GetCollection(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::UpdateCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCollectionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCollectionRequest const& request) { + return child_->UpdateCollection(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::ListCollections( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCollectionsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCollectionsRequest const& request) { + return child_->ListCollections(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::AddCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddCollectionItemRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddCollectionItemRequest const& + request) { + return child_->AddCollectionItem(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::RemoveCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveCollectionItemRequest const& + request) { + return child_->RemoveCollectionItem(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::ViewCollectionItems( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewCollectionItemsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewCollectionItemsRequest const& + request) { + return child_->ViewCollectionItems(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WarehouseLogging::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 WarehouseLogging::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 +WarehouseLogging::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 WarehouseLogging::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 WarehouseLogging::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 WarehouseLogging::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> +WarehouseLogging::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 WarehouseLogging::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/warehouse_logging_decorator.h b/google/cloud/visionai/v1/internal/warehouse_logging_decorator.h new file mode 100644 index 0000000000000..73dba7455ed1e --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_logging_decorator.h @@ -0,0 +1,511 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_LOGGING_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/warehouse_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WarehouseLogging : public WarehouseStub { + public: + ~WarehouseLogging() override = default; + WarehouseLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr CreateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAssetRequest const& request) override; + + StatusOr UpdateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAssetRequest const& request) override; + + StatusOr GetAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAssetRequest const& request) override; + + StatusOr ListAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAssetsRequest const& request) override; + + future> AsyncDeleteAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + StatusOr DeleteAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + future> AsyncUploadAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + StatusOr UploadAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + StatusOr + GenerateRetrievalUrl( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) + override; + + future> AsyncAnalyzeAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + StatusOr AnalyzeAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + future> AsyncIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + StatusOr IndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + future> AsyncRemoveIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) + override; + + StatusOr RemoveIndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) + override; + + StatusOr + ViewIndexedAssets(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewIndexedAssetsRequest const& + request) override; + + future> AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + StatusOr CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + future> AsyncUpdateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + StatusOr UpdateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + StatusOr GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexRequest const& request) override; + + StatusOr ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexesRequest const& request) override; + + future> AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + StatusOr DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + future> AsyncCreateCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + StatusOr CreateCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + StatusOr GetCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCorpusRequest const& request) override; + + StatusOr UpdateCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCorpusRequest const& request) override; + + StatusOr ListCorpora( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCorporaRequest const& request) override; + + Status DeleteCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCorpusRequest const& request) override; + + future> AsyncAnalyzeCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) + override; + + StatusOr AnalyzeCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) + override; + + StatusOr CreateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) + override; + + StatusOr UpdateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) + override; + + StatusOr GetDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDataSchemaRequest const& request) + override; + + Status DeleteDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) + override; + + StatusOr + ListDataSchemas(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDataSchemasRequest const& + request) override; + + StatusOr CreateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnnotationRequest const& request) + override; + + StatusOr GetAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnnotationRequest const& request) + override; + + StatusOr + ListAnnotations(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnnotationsRequest const& + request) override; + + StatusOr UpdateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) + override; + + Status DeleteAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) + override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> + AsyncIngestAsset(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + StatusOr ClipAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ClipAssetRequest const& request) override; + + StatusOr GenerateHlsUri( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) + override; + + future> AsyncImportAssets( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + StatusOr ImportAssets( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + StatusOr CreateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) + override; + + StatusOr UpdateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) + override; + + StatusOr GetSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchConfigRequest const& request) + override; + + Status DeleteSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) + override; + + StatusOr + ListSearchConfigs(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchConfigsRequest const& + request) override; + + StatusOr CreateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) + override; + + StatusOr UpdateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) + override; + + StatusOr GetSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) + override; + + Status DeleteSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) + override; + + StatusOr + ListSearchHypernyms( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchHypernymsRequest const& request) + override; + + StatusOr SearchAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchAssetsRequest const& request) override; + + StatusOr + SearchIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchIndexEndpointRequest const& request) + override; + + future> AsyncCreateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + StatusOr CreateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + StatusOr GetIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) + override; + + StatusOr + ListIndexEndpoints( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexEndpointsRequest const& request) + override; + + future> AsyncUpdateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + StatusOr UpdateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + future> AsyncDeleteIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + StatusOr DeleteIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + future> AsyncDeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + StatusOr DeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + future> AsyncUndeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) + override; + + StatusOr UndeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) + override; + + future> AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + future> AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) + override; + + StatusOr DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) + override; + + StatusOr GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCollectionRequest const& request) + override; + + StatusOr + ListCollections(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCollectionsRequest const& + request) override; + + StatusOr + AddCollectionItem(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddCollectionItemRequest const& + request) override; + + StatusOr + RemoveCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) + override; + + StatusOr + ViewCollectionItems( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewCollectionItemsRequest 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_; + bool stream_logging_; +}; // WarehouseLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_LOGGING_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/warehouse_metadata_decorator.cc b/google/cloud/visionai/v1/internal/warehouse_metadata_decorator.cc new file mode 100644 index 0000000000000..269723733e76f --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_metadata_decorator.cc @@ -0,0 +1,921 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#include "google/cloud/visionai/v1/internal/warehouse_metadata_decorator.h" +#include "google/cloud/visionai/v1/warehouse.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WarehouseMetadata::WarehouseMetadata( + 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 WarehouseMetadata::CreateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAssetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateAsset(context, options, request); +} + +StatusOr WarehouseMetadata::UpdateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAssetRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("asset.name=", internal::UrlEncode(request.asset().name()))); + return child_->UpdateAsset(context, options, request); +} + +StatusOr WarehouseMetadata::GetAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAssetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetAsset(context, options, request); +} + +StatusOr +WarehouseMetadata::ListAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAssetsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListAssets(context, options, request); +} + +future> +WarehouseMetadata::AsyncDeleteAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteAsset(cq, std::move(context), std::move(options), + request); +} + +StatusOr WarehouseMetadata::DeleteAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteAsset(context, options, request); +} + +future> +WarehouseMetadata::AsyncUploadAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncUploadAsset(cq, std::move(context), std::move(options), + request); +} + +StatusOr WarehouseMetadata::UploadAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->UploadAsset(context, options, request); +} + +StatusOr +WarehouseMetadata::GenerateRetrievalUrl( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GenerateRetrievalUrl(context, options, request); +} + +future> +WarehouseMetadata::AsyncAnalyzeAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncAnalyzeAsset(cq, std::move(context), std::move(options), + request); +} + +StatusOr WarehouseMetadata::AnalyzeAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AnalyzeAsset(context, options, request); +} + +future> +WarehouseMetadata::AsyncIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::IndexAssetRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncIndexAsset(cq, std::move(context), std::move(options), + request); +} + +StatusOr WarehouseMetadata::IndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::IndexAssetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->IndexAsset(context, options, request); +} + +future> +WarehouseMetadata::AsyncRemoveIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncRemoveIndexAsset(cq, std::move(context), + std::move(options), request); +} + +StatusOr WarehouseMetadata::RemoveIndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->RemoveIndexAsset(context, options, request); +} + +StatusOr +WarehouseMetadata::ViewIndexedAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewIndexedAssetsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("index=", internal::UrlEncode(request.index()))); + return child_->ViewIndexedAssets(context, options, request); +} + +future> +WarehouseMetadata::AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateIndex(cq, std::move(context), std::move(options), + request); +} + +StatusOr WarehouseMetadata::CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateIndex(context, options, request); +} + +future> +WarehouseMetadata::AsyncUpdateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + SetMetadata( + *context, *options, + absl::StrCat("index.name=", internal::UrlEncode(request.index().name()))); + return child_->AsyncUpdateIndex(cq, std::move(context), std::move(options), + request); +} + +StatusOr WarehouseMetadata::UpdateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("index.name=", internal::UrlEncode(request.index().name()))); + return child_->UpdateIndex(context, options, request); +} + +StatusOr WarehouseMetadata::GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetIndex(context, options, request); +} + +StatusOr +WarehouseMetadata::ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListIndexes(context, options, request); +} + +future> +WarehouseMetadata::AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteIndex(cq, std::move(context), std::move(options), + request); +} + +StatusOr WarehouseMetadata::DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteIndex(context, options, request); +} + +future> +WarehouseMetadata::AsyncCreateCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateCorpus(cq, std::move(context), std::move(options), + request); +} + +StatusOr WarehouseMetadata::CreateCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateCorpus(context, options, request); +} + +StatusOr WarehouseMetadata::GetCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCorpusRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetCorpus(context, options, request); +} + +StatusOr WarehouseMetadata::UpdateCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCorpusRequest const& request) { + SetMetadata(context, options, + absl::StrCat("corpus.name=", + internal::UrlEncode(request.corpus().name()))); + return child_->UpdateCorpus(context, options, request); +} + +StatusOr +WarehouseMetadata::ListCorpora( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCorporaRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListCorpora(context, options, request); +} + +Status WarehouseMetadata::DeleteCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCorpusRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteCorpus(context, options, request); +} + +future> +WarehouseMetadata::AsyncAnalyzeCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncAnalyzeCorpus(cq, std::move(context), std::move(options), + request); +} + +StatusOr WarehouseMetadata::AnalyzeCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AnalyzeCorpus(context, options, request); +} + +StatusOr +WarehouseMetadata::CreateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateDataSchema(context, options, request); +} + +StatusOr +WarehouseMetadata::UpdateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) { + SetMetadata(context, options, + absl::StrCat("data_schema.name=", + internal::UrlEncode(request.data_schema().name()))); + return child_->UpdateDataSchema(context, options, request); +} + +StatusOr +WarehouseMetadata::GetDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDataSchemaRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetDataSchema(context, options, request); +} + +Status WarehouseMetadata::DeleteDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteDataSchema(context, options, request); +} + +StatusOr +WarehouseMetadata::ListDataSchemas( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDataSchemasRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListDataSchemas(context, options, request); +} + +StatusOr +WarehouseMetadata::CreateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnnotationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateAnnotation(context, options, request); +} + +StatusOr +WarehouseMetadata::GetAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnnotationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetAnnotation(context, options, request); +} + +StatusOr +WarehouseMetadata::ListAnnotations( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnnotationsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListAnnotations(context, options, request); +} + +StatusOr +WarehouseMetadata::UpdateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("annotation.name=", + internal::UrlEncode(request.annotation().name()))); + return child_->UpdateAnnotation(context, options, request); +} + +Status WarehouseMetadata::DeleteAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteAnnotation(context, options, request); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> +WarehouseMetadata::AsyncIngestAsset( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + SetMetadata(*context, *options); + return child_->AsyncIngestAsset(cq, std::move(context), std::move(options)); +} + +StatusOr +WarehouseMetadata::ClipAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ClipAssetRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->ClipAsset(context, options, request); +} + +StatusOr +WarehouseMetadata::GenerateHlsUri( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GenerateHlsUri(context, options, request); +} + +future> +WarehouseMetadata::AsyncImportAssets( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncImportAssets(cq, std::move(context), std::move(options), + request); +} + +StatusOr WarehouseMetadata::ImportAssets( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ImportAssets(context, options, request); +} + +StatusOr +WarehouseMetadata::CreateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateSearchConfig(context, options, request); +} + +StatusOr +WarehouseMetadata::UpdateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("search_config.name=", + internal::UrlEncode(request.search_config().name()))); + return child_->UpdateSearchConfig(context, options, request); +} + +StatusOr +WarehouseMetadata::GetSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchConfigRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetSearchConfig(context, options, request); +} + +Status WarehouseMetadata::DeleteSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteSearchConfig(context, options, request); +} + +StatusOr +WarehouseMetadata::ListSearchConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchConfigsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListSearchConfigs(context, options, request); +} + +StatusOr +WarehouseMetadata::CreateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateSearchHypernym(context, options, request); +} + +StatusOr +WarehouseMetadata::UpdateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("search_hypernym.name=", + internal::UrlEncode(request.search_hypernym().name()))); + return child_->UpdateSearchHypernym(context, options, request); +} + +StatusOr +WarehouseMetadata::GetSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetSearchHypernym(context, options, request); +} + +Status WarehouseMetadata::DeleteSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteSearchHypernym(context, options, request); +} + +StatusOr +WarehouseMetadata::ListSearchHypernyms( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchHypernymsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListSearchHypernyms(context, options, request); +} + +StatusOr +WarehouseMetadata::SearchAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchAssetsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("corpus=", internal::UrlEncode(request.corpus()))); + return child_->SearchAssets(context, options, request); +} + +StatusOr +WarehouseMetadata::SearchIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchIndexEndpointRequest const& request) { + SetMetadata(context, options, + absl::StrCat("index_endpoint=", + internal::UrlEncode(request.index_endpoint()))); + return child_->SearchIndexEndpoint(context, options, request); +} + +future> +WarehouseMetadata::AsyncCreateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateIndexEndpoint(cq, std::move(context), + std::move(options), request); +} + +StatusOr WarehouseMetadata::CreateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateIndexEndpoint(context, options, request); +} + +StatusOr +WarehouseMetadata::GetIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetIndexEndpoint(context, options, request); +} + +StatusOr +WarehouseMetadata::ListIndexEndpoints( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexEndpointsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListIndexEndpoints(context, options, request); +} + +future> +WarehouseMetadata::AsyncUpdateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) { + SetMetadata( + *context, *options, + absl::StrCat("index_endpoint.name=", + internal::UrlEncode(request.index_endpoint().name()))); + return child_->AsyncUpdateIndexEndpoint(cq, std::move(context), + std::move(options), request); +} + +StatusOr WarehouseMetadata::UpdateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("index_endpoint.name=", + internal::UrlEncode(request.index_endpoint().name()))); + return child_->UpdateIndexEndpoint(context, options, request); +} + +future> +WarehouseMetadata::AsyncDeleteIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteIndexEndpoint(cq, std::move(context), + std::move(options), request); +} + +StatusOr WarehouseMetadata::DeleteIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteIndexEndpoint(context, options, request); +} + +future> +WarehouseMetadata::AsyncDeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("index_endpoint=", + internal::UrlEncode(request.index_endpoint()))); + return child_->AsyncDeployIndex(cq, std::move(context), std::move(options), + request); +} + +StatusOr WarehouseMetadata::DeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + SetMetadata(context, options, + absl::StrCat("index_endpoint=", + internal::UrlEncode(request.index_endpoint()))); + return child_->DeployIndex(context, options, request); +} + +future> +WarehouseMetadata::AsyncUndeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("index_endpoint=", + internal::UrlEncode(request.index_endpoint()))); + return child_->AsyncUndeployIndex(cq, std::move(context), std::move(options), + request); +} + +StatusOr WarehouseMetadata::UndeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + SetMetadata(context, options, + absl::StrCat("index_endpoint=", + internal::UrlEncode(request.index_endpoint()))); + return child_->UndeployIndex(context, options, request); +} + +future> +WarehouseMetadata::AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateCollection(cq, std::move(context), + std::move(options), request); +} + +StatusOr WarehouseMetadata::CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateCollection(context, options, request); +} + +future> +WarehouseMetadata::AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteCollection(cq, std::move(context), + std::move(options), request); +} + +StatusOr WarehouseMetadata::DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteCollection(context, options, request); +} + +StatusOr +WarehouseMetadata::GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCollectionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetCollection(context, options, request); +} + +StatusOr +WarehouseMetadata::UpdateCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCollectionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("collection.name=", + internal::UrlEncode(request.collection().name()))); + return child_->UpdateCollection(context, options, request); +} + +StatusOr +WarehouseMetadata::ListCollections( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCollectionsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListCollections(context, options, request); +} + +StatusOr +WarehouseMetadata::AddCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddCollectionItemRequest const& request) { + SetMetadata(context, options, + absl::StrCat("item.collection=", + internal::UrlEncode(request.item().collection()))); + return child_->AddCollectionItem(context, options, request); +} + +StatusOr +WarehouseMetadata::RemoveCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) { + SetMetadata(context, options, + absl::StrCat("item.collection=", + internal::UrlEncode(request.item().collection()))); + return child_->RemoveCollectionItem(context, options, request); +} + +StatusOr +WarehouseMetadata::ViewCollectionItems( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewCollectionItemsRequest const& request) { + SetMetadata( + context, options, + absl::StrCat("collection=", internal::UrlEncode(request.collection()))); + return child_->ViewCollectionItems(context, options, request); +} + +StatusOr +WarehouseMetadata::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 WarehouseMetadata::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 +WarehouseMetadata::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 WarehouseMetadata::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 WarehouseMetadata::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 WarehouseMetadata::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> +WarehouseMetadata::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 WarehouseMetadata::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 WarehouseMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void WarehouseMetadata::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/warehouse_metadata_decorator.h b/google/cloud/visionai/v1/internal/warehouse_metadata_decorator.h new file mode 100644 index 0000000000000..bb797486b4476 --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_metadata_decorator.h @@ -0,0 +1,515 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_METADATA_DECORATOR_H + +#include "google/cloud/visionai/v1/internal/warehouse_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WarehouseMetadata : public WarehouseStub { + public: + ~WarehouseMetadata() override = default; + WarehouseMetadata(std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr CreateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAssetRequest const& request) override; + + StatusOr UpdateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAssetRequest const& request) override; + + StatusOr GetAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAssetRequest const& request) override; + + StatusOr ListAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAssetsRequest const& request) override; + + future> AsyncDeleteAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + StatusOr DeleteAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + future> AsyncUploadAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + StatusOr UploadAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + StatusOr + GenerateRetrievalUrl( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) + override; + + future> AsyncAnalyzeAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + StatusOr AnalyzeAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + future> AsyncIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + StatusOr IndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + future> AsyncRemoveIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) + override; + + StatusOr RemoveIndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) + override; + + StatusOr + ViewIndexedAssets(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewIndexedAssetsRequest const& + request) override; + + future> AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + StatusOr CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + future> AsyncUpdateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + StatusOr UpdateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + StatusOr GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexRequest const& request) override; + + StatusOr ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexesRequest const& request) override; + + future> AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + StatusOr DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + future> AsyncCreateCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + StatusOr CreateCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + StatusOr GetCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCorpusRequest const& request) override; + + StatusOr UpdateCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCorpusRequest const& request) override; + + StatusOr ListCorpora( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCorporaRequest const& request) override; + + Status DeleteCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCorpusRequest const& request) override; + + future> AsyncAnalyzeCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) + override; + + StatusOr AnalyzeCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) + override; + + StatusOr CreateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) + override; + + StatusOr UpdateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) + override; + + StatusOr GetDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDataSchemaRequest const& request) + override; + + Status DeleteDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) + override; + + StatusOr + ListDataSchemas(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDataSchemasRequest const& + request) override; + + StatusOr CreateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnnotationRequest const& request) + override; + + StatusOr GetAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnnotationRequest const& request) + override; + + StatusOr + ListAnnotations(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnnotationsRequest const& + request) override; + + StatusOr UpdateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) + override; + + Status DeleteAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) + override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> + AsyncIngestAsset(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + StatusOr ClipAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ClipAssetRequest const& request) override; + + StatusOr GenerateHlsUri( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) + override; + + future> AsyncImportAssets( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + StatusOr ImportAssets( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + StatusOr CreateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) + override; + + StatusOr UpdateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) + override; + + StatusOr GetSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchConfigRequest const& request) + override; + + Status DeleteSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) + override; + + StatusOr + ListSearchConfigs(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchConfigsRequest const& + request) override; + + StatusOr CreateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) + override; + + StatusOr UpdateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) + override; + + StatusOr GetSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) + override; + + Status DeleteSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) + override; + + StatusOr + ListSearchHypernyms( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchHypernymsRequest const& request) + override; + + StatusOr SearchAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchAssetsRequest const& request) override; + + StatusOr + SearchIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchIndexEndpointRequest const& request) + override; + + future> AsyncCreateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + StatusOr CreateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + StatusOr GetIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) + override; + + StatusOr + ListIndexEndpoints( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexEndpointsRequest const& request) + override; + + future> AsyncUpdateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + StatusOr UpdateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + future> AsyncDeleteIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + StatusOr DeleteIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + future> AsyncDeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + StatusOr DeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + future> AsyncUndeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) + override; + + StatusOr UndeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) + override; + + future> AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + future> AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) + override; + + StatusOr DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) + override; + + StatusOr GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCollectionRequest const& request) + override; + + StatusOr + ListCollections(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCollectionsRequest const& + request) override; + + StatusOr + AddCollectionItem(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddCollectionItemRequest const& + request) override; + + StatusOr + RemoveCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) + override; + + StatusOr + ViewCollectionItems( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewCollectionItemsRequest 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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_METADATA_DECORATOR_H diff --git a/google/cloud/visionai/v1/internal/warehouse_option_defaults.cc b/google/cloud/visionai/v1/internal/warehouse_option_defaults.cc new file mode 100644 index 0000000000000..cc3f70439af8e --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_option_defaults.cc @@ -0,0 +1,75 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#include "google/cloud/visionai/v1/internal/warehouse_option_defaults.h" +#include "google/cloud/visionai/v1/warehouse_connection.h" +#include "google/cloud/visionai/v1/warehouse_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 visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options WarehouseDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_WAREHOUSE_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_WAREHOUSE_AUTHORITY", + "warehouse-visionai.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + visionai_v1::WarehouseLimitedTimeRetryPolicy(std::chrono::minutes(10)) + .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( + options.get()->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } + if (!options.has()) { + options.set( + visionai_v1::MakeDefaultWarehouseConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/warehouse_option_defaults.h b/google/cloud/visionai/v1/internal/warehouse_option_defaults.h new file mode 100644 index 0000000000000..ebeeb860dd1c1 --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options WarehouseDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_OPTION_DEFAULTS_H diff --git a/google/cloud/visionai/v1/internal/warehouse_retry_traits.h b/google/cloud/visionai/v1/internal/warehouse_retry_traits.h new file mode 100644 index 0000000000000..ed22862a4dd14 --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct WarehouseRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_RETRY_TRAITS_H diff --git a/google/cloud/visionai/v1/internal/warehouse_sources.cc b/google/cloud/visionai/v1/internal/warehouse_sources.cc new file mode 100644 index 0000000000000..8ed115804db24 --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/visionai/v1/internal/warehouse_auth_decorator.cc" +#include "google/cloud/visionai/v1/internal/warehouse_connection_impl.cc" +#include "google/cloud/visionai/v1/internal/warehouse_logging_decorator.cc" +#include "google/cloud/visionai/v1/internal/warehouse_metadata_decorator.cc" +#include "google/cloud/visionai/v1/internal/warehouse_option_defaults.cc" +#include "google/cloud/visionai/v1/internal/warehouse_stub.cc" +#include "google/cloud/visionai/v1/internal/warehouse_stub_factory.cc" +#include "google/cloud/visionai/v1/internal/warehouse_tracing_connection.cc" +#include "google/cloud/visionai/v1/internal/warehouse_tracing_stub.cc" +#include "google/cloud/visionai/v1/warehouse_client.cc" +#include "google/cloud/visionai/v1/warehouse_connection.cc" +#include "google/cloud/visionai/v1/warehouse_connection_idempotency_policy.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/visionai/v1/internal/warehouse_stub.cc b/google/cloud/visionai/v1/internal/warehouse_stub.cc new file mode 100644 index 0000000000000..a9a18c7c7b26f --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_stub.cc @@ -0,0 +1,1215 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#include "google/cloud/visionai/v1/internal/warehouse_stub.h" +#include "google/cloud/visionai/v1/warehouse.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/internal/async_read_write_stream_impl.h" +#include "google/cloud/status_or.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WarehouseStub::~WarehouseStub() = default; + +StatusOr DefaultWarehouseStub::CreateAsset( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::CreateAssetRequest const& request) { + google::cloud::visionai::v1::Asset response; + auto status = grpc_stub_->CreateAsset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultWarehouseStub::UpdateAsset( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::UpdateAssetRequest const& request) { + google::cloud::visionai::v1::Asset response; + auto status = grpc_stub_->UpdateAsset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultWarehouseStub::GetAsset( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetAssetRequest const& request) { + google::cloud::visionai::v1::Asset response; + auto status = grpc_stub_->GetAsset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::ListAssets( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListAssetsRequest const& request) { + google::cloud::visionai::v1::ListAssetsResponse response; + auto status = grpc_stub_->ListAssets(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncDeleteAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteAssetRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteAssetRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteAsset(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::DeleteAsset( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteAsset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncUploadAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UploadAssetRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UploadAssetRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUploadAsset(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::UploadAsset( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UploadAsset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::GenerateRetrievalUrl( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) { + google::cloud::visionai::v1::GenerateRetrievalUrlResponse response; + auto status = grpc_stub_->GenerateRetrievalUrl(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncAnalyzeAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::AnalyzeAssetRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncAnalyzeAsset(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::AnalyzeAsset( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->AnalyzeAsset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::IndexAssetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::IndexAssetRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::IndexAssetRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncIndexAsset(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::IndexAsset( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::IndexAssetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->IndexAsset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncRemoveIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::RemoveIndexAssetRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncRemoveIndexAsset(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::RemoveIndexAsset( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->RemoveIndexAsset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::ViewIndexedAssets( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ViewIndexedAssetsRequest const& request) { + google::cloud::visionai::v1::ViewIndexedAssetsResponse response; + auto status = grpc_stub_->ViewIndexedAssets(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateIndexRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::CreateIndexRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateIndex(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::CreateIndex( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateIndex(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncUpdateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateIndexRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UpdateIndexRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateIndex(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::UpdateIndex( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateIndex(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultWarehouseStub::GetIndex( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetIndexRequest const& request) { + google::cloud::visionai::v1::Index response; + auto status = grpc_stub_->GetIndex(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::ListIndexes( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListIndexesRequest const& request) { + google::cloud::visionai::v1::ListIndexesResponse response; + auto status = grpc_stub_->ListIndexes(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteIndexRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteIndexRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteIndex(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::DeleteIndex( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteIndex(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncCreateCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateCorpusRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::CreateCorpusRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateCorpus(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::CreateCorpus( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateCorpus(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr DefaultWarehouseStub::GetCorpus( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetCorpusRequest const& request) { + google::cloud::visionai::v1::Corpus response; + auto status = grpc_stub_->GetCorpus(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::UpdateCorpus( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::UpdateCorpusRequest const& request) { + google::cloud::visionai::v1::Corpus response; + auto status = grpc_stub_->UpdateCorpus(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::ListCorpora( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListCorporaRequest const& request) { + google::cloud::visionai::v1::ListCorporaResponse response; + auto status = grpc_stub_->ListCorpora(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultWarehouseStub::DeleteCorpus( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::DeleteCorpusRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteCorpus(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +future> +DefaultWarehouseStub::AsyncAnalyzeCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::AnalyzeCorpusRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncAnalyzeCorpus(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::AnalyzeCorpus( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->AnalyzeCorpus(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::CreateDataSchema( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) { + google::cloud::visionai::v1::DataSchema response; + auto status = grpc_stub_->CreateDataSchema(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::UpdateDataSchema( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) { + google::cloud::visionai::v1::DataSchema response; + auto status = grpc_stub_->UpdateDataSchema(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::GetDataSchema( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetDataSchemaRequest const& request) { + google::cloud::visionai::v1::DataSchema response; + auto status = grpc_stub_->GetDataSchema(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultWarehouseStub::DeleteDataSchema( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteDataSchema(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +StatusOr +DefaultWarehouseStub::ListDataSchemas( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListDataSchemasRequest const& request) { + google::cloud::visionai::v1::ListDataSchemasResponse response; + auto status = grpc_stub_->ListDataSchemas(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::CreateAnnotation( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::CreateAnnotationRequest const& request) { + google::cloud::visionai::v1::Annotation response; + auto status = grpc_stub_->CreateAnnotation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::GetAnnotation( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetAnnotationRequest const& request) { + google::cloud::visionai::v1::Annotation response; + auto status = grpc_stub_->GetAnnotation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::ListAnnotations( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListAnnotationsRequest const& request) { + google::cloud::visionai::v1::ListAnnotationsResponse response; + auto status = grpc_stub_->ListAnnotations(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::UpdateAnnotation( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) { + google::cloud::visionai::v1::Annotation response; + auto status = grpc_stub_->UpdateAnnotation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultWarehouseStub::DeleteAnnotation( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteAnnotation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> +DefaultWarehouseStub::AsyncIngestAsset( + google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + return google::cloud::internal::MakeStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>( + cq, std::move(context), std::move(options), + [this](grpc::ClientContext* context, grpc::CompletionQueue* cq) { + return grpc_stub_->PrepareAsyncIngestAsset(context, cq); + }); +} + +StatusOr +DefaultWarehouseStub::ClipAsset( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ClipAssetRequest const& request) { + google::cloud::visionai::v1::ClipAssetResponse response; + auto status = grpc_stub_->ClipAsset(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::GenerateHlsUri( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) { + google::cloud::visionai::v1::GenerateHlsUriResponse response; + auto status = grpc_stub_->GenerateHlsUri(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncImportAssets( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::ImportAssetsRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::ImportAssetsRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncImportAssets(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::ImportAssets( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->ImportAssets(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::CreateSearchConfig( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) { + google::cloud::visionai::v1::SearchConfig response; + auto status = grpc_stub_->CreateSearchConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::UpdateSearchConfig( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) { + google::cloud::visionai::v1::SearchConfig response; + auto status = grpc_stub_->UpdateSearchConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::GetSearchConfig( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetSearchConfigRequest const& request) { + google::cloud::visionai::v1::SearchConfig response; + auto status = grpc_stub_->GetSearchConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultWarehouseStub::DeleteSearchConfig( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteSearchConfig(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +StatusOr +DefaultWarehouseStub::ListSearchConfigs( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListSearchConfigsRequest const& request) { + google::cloud::visionai::v1::ListSearchConfigsResponse response; + auto status = grpc_stub_->ListSearchConfigs(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::CreateSearchHypernym( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) { + google::cloud::visionai::v1::SearchHypernym response; + auto status = grpc_stub_->CreateSearchHypernym(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::UpdateSearchHypernym( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) { + google::cloud::visionai::v1::SearchHypernym response; + auto status = grpc_stub_->UpdateSearchHypernym(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::GetSearchHypernym( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) { + google::cloud::visionai::v1::SearchHypernym response; + auto status = grpc_stub_->GetSearchHypernym(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultWarehouseStub::DeleteSearchHypernym( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) { + google::protobuf::Empty response; + auto status = grpc_stub_->DeleteSearchHypernym(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +StatusOr +DefaultWarehouseStub::ListSearchHypernyms( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListSearchHypernymsRequest const& request) { + google::cloud::visionai::v1::ListSearchHypernymsResponse response; + auto status = grpc_stub_->ListSearchHypernyms(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::SearchAssets( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::SearchAssetsRequest const& request) { + google::cloud::visionai::v1::SearchAssetsResponse response; + auto status = grpc_stub_->SearchAssets(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::SearchIndexEndpoint( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::SearchIndexEndpointRequest const& request) { + google::cloud::visionai::v1::SearchIndexEndpointResponse response; + auto status = grpc_stub_->SearchIndexEndpoint(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncCreateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateIndexEndpointRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateIndexEndpoint(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultWarehouseStub::CreateIndexEndpoint( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateIndexEndpoint(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::GetIndexEndpoint( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) { + google::cloud::visionai::v1::IndexEndpoint response; + auto status = grpc_stub_->GetIndexEndpoint(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::ListIndexEndpoints( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListIndexEndpointsRequest const& request) { + google::cloud::visionai::v1::ListIndexEndpointsResponse response; + auto status = grpc_stub_->ListIndexEndpoints(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncUpdateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UpdateIndexEndpointRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateIndexEndpoint(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultWarehouseStub::UpdateIndexEndpoint( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateIndexEndpoint(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncDeleteIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteIndexEndpointRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteIndexEndpoint(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultWarehouseStub::DeleteIndexEndpoint( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteIndexEndpoint(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncDeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeployIndexRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::DeployIndexRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeployIndex(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::DeployIndex( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeployIndex(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncUndeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::UndeployIndexRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::visionai::v1::UndeployIndexRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUndeployIndex(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::UndeployIndex( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UndeployIndex(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::CreateCollectionRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::visionai::v1::CreateCollectionRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateCollection(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::CreateCollection( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateCollection(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWarehouseStub::AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::visionai::v1::DeleteCollectionRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::visionai::v1::DeleteCollectionRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteCollection(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr DefaultWarehouseStub::DeleteCollection( + grpc::ClientContext& context, Options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteCollection(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::GetCollection( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::GetCollectionRequest const& request) { + google::cloud::visionai::v1::Collection response; + auto status = grpc_stub_->GetCollection(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::UpdateCollection( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::UpdateCollectionRequest const& request) { + google::cloud::visionai::v1::Collection response; + auto status = grpc_stub_->UpdateCollection(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::ListCollections( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ListCollectionsRequest const& request) { + google::cloud::visionai::v1::ListCollectionsResponse response; + auto status = grpc_stub_->ListCollections(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::AddCollectionItem( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::AddCollectionItemRequest const& request) { + google::cloud::visionai::v1::AddCollectionItemResponse response; + auto status = grpc_stub_->AddCollectionItem(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::RemoveCollectionItem( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) { + google::cloud::visionai::v1::RemoveCollectionItemResponse response; + auto status = grpc_stub_->RemoveCollectionItem(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::ViewCollectionItems( + grpc::ClientContext& context, Options const&, + google::cloud::visionai::v1::ViewCollectionItemsRequest const& request) { + google::cloud::visionai::v1::ViewCollectionItemsResponse response; + auto status = grpc_stub_->ViewCollectionItems(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWarehouseStub::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 DefaultWarehouseStub::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 +DefaultWarehouseStub::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 DefaultWarehouseStub::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 DefaultWarehouseStub::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 DefaultWarehouseStub::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> +DefaultWarehouseStub::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 DefaultWarehouseStub::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 visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/warehouse_stub.h b/google/cloud/visionai/v1/internal/warehouse_stub.h new file mode 100644 index 0000000000000..d6a1a8f3629ae --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_stub.h @@ -0,0 +1,974 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_STUB_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/warehouse.grpc.pb.h" +#include "google/cloud/async_streaming_read_write_rpc.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WarehouseStub { + public: + virtual ~WarehouseStub() = 0; + + virtual StatusOr CreateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAssetRequest const& request) = 0; + + virtual StatusOr UpdateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAssetRequest const& request) = 0; + + virtual StatusOr GetAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAssetRequest const& request) = 0; + + virtual StatusOr ListAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAssetsRequest const& request) = 0; + + virtual future> AsyncDeleteAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) = 0; + + virtual StatusOr DeleteAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) = 0; + + virtual future> AsyncUploadAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UploadAssetRequest const& request) = 0; + + virtual StatusOr UploadAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UploadAssetRequest const& request) = 0; + + virtual StatusOr + GenerateRetrievalUrl( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& + request) = 0; + + virtual future> AsyncAnalyzeAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) = 0; + + virtual StatusOr AnalyzeAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) = 0; + + virtual future> AsyncIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::IndexAssetRequest const& request) = 0; + + virtual StatusOr IndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::IndexAssetRequest const& request) = 0; + + virtual future> + AsyncRemoveIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) = 0; + + virtual StatusOr RemoveIndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) = 0; + + virtual StatusOr + ViewIndexedAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewIndexedAssetsRequest const& request) = 0; + + virtual future> AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexRequest const& request) = 0; + + virtual StatusOr CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexRequest const& request) = 0; + + virtual future> AsyncUpdateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) = 0; + + virtual StatusOr UpdateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) = 0; + + virtual StatusOr GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexRequest const& request) = 0; + + virtual StatusOr + ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexesRequest const& request) = 0; + + virtual future> AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) = 0; + + virtual StatusOr DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) = 0; + + virtual future> AsyncCreateCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) = 0; + + virtual StatusOr CreateCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) = 0; + + virtual StatusOr GetCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCorpusRequest const& request) = 0; + + virtual StatusOr UpdateCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCorpusRequest const& request) = 0; + + virtual StatusOr + ListCorpora( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCorporaRequest const& request) = 0; + + virtual Status DeleteCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCorpusRequest const& request) = 0; + + virtual future> AsyncAnalyzeCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) = 0; + + virtual StatusOr AnalyzeCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) = 0; + + virtual StatusOr CreateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) = 0; + + virtual StatusOr UpdateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) = 0; + + virtual StatusOr GetDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDataSchemaRequest const& request) = 0; + + virtual Status DeleteDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) = 0; + + virtual StatusOr + ListDataSchemas( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDataSchemasRequest const& request) = 0; + + virtual StatusOr CreateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnnotationRequest const& request) = 0; + + virtual StatusOr GetAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnnotationRequest const& request) = 0; + + virtual StatusOr + ListAnnotations( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnnotationsRequest const& request) = 0; + + virtual StatusOr UpdateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) = 0; + + virtual Status DeleteAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) = 0; + + virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> + AsyncIngestAsset(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) = 0; + + virtual StatusOr ClipAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ClipAssetRequest const& request) = 0; + + virtual StatusOr + GenerateHlsUri( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) = 0; + + virtual future> AsyncImportAssets( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) = 0; + + virtual StatusOr ImportAssets( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) = 0; + + virtual StatusOr + CreateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchConfigRequest const& + request) = 0; + + virtual StatusOr + UpdateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchConfigRequest const& + request) = 0; + + virtual StatusOr GetSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchConfigRequest const& request) = 0; + + virtual Status DeleteSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchConfigRequest const& + request) = 0; + + virtual StatusOr + ListSearchConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchConfigsRequest const& request) = 0; + + virtual StatusOr + CreateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchHypernymRequest const& + request) = 0; + + virtual StatusOr + UpdateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& + request) = 0; + + virtual StatusOr + GetSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) = 0; + + virtual Status DeleteSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& + request) = 0; + + virtual StatusOr + ListSearchHypernyms( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchHypernymsRequest const& + request) = 0; + + virtual StatusOr + SearchAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchAssetsRequest const& request) = 0; + + virtual StatusOr + SearchIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchIndexEndpointRequest const& + request) = 0; + + virtual future> + AsyncCreateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& + request) = 0; + + virtual StatusOr CreateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& + request) = 0; + + virtual StatusOr GetIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) = 0; + + virtual StatusOr + ListIndexEndpoints( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexEndpointsRequest const& + request) = 0; + + virtual future> + AsyncUpdateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& + request) = 0; + + virtual StatusOr UpdateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& + request) = 0; + + virtual future> + AsyncDeleteIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& + request) = 0; + + virtual StatusOr DeleteIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& + request) = 0; + + virtual future> AsyncDeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployIndexRequest const& request) = 0; + + virtual StatusOr DeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployIndexRequest const& request) = 0; + + virtual future> AsyncUndeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) = 0; + + virtual StatusOr UndeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) = 0; + + virtual future> + AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) = 0; + + virtual StatusOr CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) = 0; + + virtual future> + AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) = 0; + + virtual StatusOr DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) = 0; + + virtual StatusOr GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCollectionRequest const& request) = 0; + + virtual StatusOr UpdateCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCollectionRequest const& request) = 0; + + virtual StatusOr + ListCollections( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCollectionsRequest const& request) = 0; + + virtual StatusOr + AddCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddCollectionItemRequest const& request) = 0; + + virtual StatusOr + RemoveCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveCollectionItemRequest const& + request) = 0; + + virtual StatusOr + ViewCollectionItems( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewCollectionItemsRequest 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 DefaultWarehouseStub : public WarehouseStub { + public: + DefaultWarehouseStub( + std::unique_ptr + 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 CreateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAssetRequest const& request) override; + + StatusOr UpdateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAssetRequest const& request) override; + + StatusOr GetAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAssetRequest const& request) override; + + StatusOr ListAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAssetsRequest const& request) override; + + future> AsyncDeleteAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + StatusOr DeleteAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + future> AsyncUploadAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + StatusOr UploadAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + StatusOr + GenerateRetrievalUrl( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) + override; + + future> AsyncAnalyzeAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + StatusOr AnalyzeAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + future> AsyncIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + StatusOr IndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + future> AsyncRemoveIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) + override; + + StatusOr RemoveIndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) + override; + + StatusOr + ViewIndexedAssets(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewIndexedAssetsRequest const& + request) override; + + future> AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + StatusOr CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + future> AsyncUpdateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + StatusOr UpdateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + StatusOr GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexRequest const& request) override; + + StatusOr ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexesRequest const& request) override; + + future> AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + StatusOr DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + future> AsyncCreateCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + StatusOr CreateCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + StatusOr GetCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCorpusRequest const& request) override; + + StatusOr UpdateCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCorpusRequest const& request) override; + + StatusOr ListCorpora( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCorporaRequest const& request) override; + + Status DeleteCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCorpusRequest const& request) override; + + future> AsyncAnalyzeCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) + override; + + StatusOr AnalyzeCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) + override; + + StatusOr CreateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) + override; + + StatusOr UpdateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) + override; + + StatusOr GetDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDataSchemaRequest const& request) + override; + + Status DeleteDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) + override; + + StatusOr + ListDataSchemas(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDataSchemasRequest const& + request) override; + + StatusOr CreateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnnotationRequest const& request) + override; + + StatusOr GetAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnnotationRequest const& request) + override; + + StatusOr + ListAnnotations(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnnotationsRequest const& + request) override; + + StatusOr UpdateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) + override; + + Status DeleteAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) + override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> + AsyncIngestAsset(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + StatusOr ClipAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ClipAssetRequest const& request) override; + + StatusOr GenerateHlsUri( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) + override; + + future> AsyncImportAssets( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + StatusOr ImportAssets( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + StatusOr CreateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) + override; + + StatusOr UpdateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) + override; + + StatusOr GetSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchConfigRequest const& request) + override; + + Status DeleteSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) + override; + + StatusOr + ListSearchConfigs(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchConfigsRequest const& + request) override; + + StatusOr CreateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) + override; + + StatusOr UpdateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) + override; + + StatusOr GetSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) + override; + + Status DeleteSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) + override; + + StatusOr + ListSearchHypernyms( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchHypernymsRequest const& request) + override; + + StatusOr SearchAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchAssetsRequest const& request) override; + + StatusOr + SearchIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchIndexEndpointRequest const& request) + override; + + future> AsyncCreateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + StatusOr CreateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + StatusOr GetIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) + override; + + StatusOr + ListIndexEndpoints( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexEndpointsRequest const& request) + override; + + future> AsyncUpdateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + StatusOr UpdateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + future> AsyncDeleteIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + StatusOr DeleteIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + future> AsyncDeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + StatusOr DeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + future> AsyncUndeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) + override; + + StatusOr UndeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) + override; + + future> AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + future> AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) + override; + + StatusOr DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) + override; + + StatusOr GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCollectionRequest const& request) + override; + + StatusOr + ListCollections(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCollectionsRequest const& + request) override; + + StatusOr + AddCollectionItem(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddCollectionItemRequest const& + request) override; + + StatusOr + RemoveCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) + override; + + StatusOr + ViewCollectionItems( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewCollectionItemsRequest 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 + grpc_stub_; + std::unique_ptr + locations_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_STUB_H diff --git a/google/cloud/visionai/v1/internal/warehouse_stub_factory.cc b/google/cloud/visionai/v1/internal/warehouse_stub_factory.cc new file mode 100644 index 0000000000000..a3379061768b8 --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_stub_factory.cc @@ -0,0 +1,80 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#include "google/cloud/visionai/v1/internal/warehouse_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/internal/warehouse_auth_decorator.h" +#include "google/cloud/visionai/v1/internal/warehouse_logging_decorator.h" +#include "google/cloud/visionai/v1/internal/warehouse_metadata_decorator.h" +#include "google/cloud/visionai/v1/internal/warehouse_stub.h" +#include "google/cloud/visionai/v1/internal/warehouse_tracing_stub.h" +#include "google/cloud/visionai/v1/warehouse.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultWarehouseStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::visionai::v1::Warehouse::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 = MakeWarehouseTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/warehouse_stub_factory.h b/google/cloud/visionai/v1/internal/warehouse_stub_factory.h new file mode 100644 index 0000000000000..46c972e8a29c3 --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_STUB_FACTORY_H + +#include "google/cloud/visionai/v1/internal/warehouse_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultWarehouseStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_STUB_FACTORY_H diff --git a/google/cloud/visionai/v1/internal/warehouse_tracing_connection.cc b/google/cloud/visionai/v1/internal/warehouse_tracing_connection.cc new file mode 100644 index 0000000000000..20723c5603ed4 --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_tracing_connection.cc @@ -0,0 +1,1046 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#include "google/cloud/visionai/v1/internal/warehouse_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WarehouseTracingConnection::WarehouseTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StatusOr +WarehouseTracingConnection::CreateAsset( + google::cloud::visionai::v1::CreateAssetRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::CreateAsset"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateAsset(request)); +} + +StatusOr +WarehouseTracingConnection::UpdateAsset( + google::cloud::visionai::v1::UpdateAssetRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UpdateAsset"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateAsset(request)); +} + +StatusOr +WarehouseTracingConnection::GetAsset( + google::cloud::visionai::v1::GetAssetRequest const& request) { + auto span = internal::MakeSpan("visionai_v1::WarehouseConnection::GetAsset"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetAsset(request)); +} + +StreamRange +WarehouseTracingConnection::ListAssets( + google::cloud::visionai::v1::ListAssetsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::ListAssets"); + internal::OTelScope scope(span); + auto sr = child_->ListAssets(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +future> +WarehouseTracingConnection::DeleteAsset( + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeleteAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteAsset(request)); +} + +StatusOr +WarehouseTracingConnection::DeleteAsset( + NoAwaitTag, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeleteAsset"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteAsset(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::DeleteAsset( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeleteAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteAsset(operation)); +} + +future> +WarehouseTracingConnection::UploadAsset( + google::cloud::visionai::v1::UploadAssetRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UploadAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UploadAsset(request)); +} + +StatusOr +WarehouseTracingConnection::UploadAsset( + NoAwaitTag, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UploadAsset"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UploadAsset(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::UploadAsset( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UploadAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UploadAsset(operation)); +} + +StatusOr +WarehouseTracingConnection::GenerateRetrievalUrl( + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::GenerateRetrievalUrl"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GenerateRetrievalUrl(request)); +} + +future> +WarehouseTracingConnection::AnalyzeAsset( + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::AnalyzeAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->AnalyzeAsset(request)); +} + +StatusOr +WarehouseTracingConnection::AnalyzeAsset( + NoAwaitTag, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::AnalyzeAsset"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->AnalyzeAsset(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::AnalyzeAsset( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::AnalyzeAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->AnalyzeAsset(operation)); +} + +future> +WarehouseTracingConnection::IndexAsset( + google::cloud::visionai::v1::IndexAssetRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::IndexAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->IndexAsset(request)); +} + +StatusOr WarehouseTracingConnection::IndexAsset( + NoAwaitTag, google::cloud::visionai::v1::IndexAssetRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::IndexAsset"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->IndexAsset(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::IndexAsset( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::IndexAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->IndexAsset(operation)); +} + +future> +WarehouseTracingConnection::RemoveIndexAsset( + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::RemoveIndexAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->RemoveIndexAsset(request)); +} + +StatusOr +WarehouseTracingConnection::RemoveIndexAsset( + NoAwaitTag, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::RemoveIndexAsset"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->RemoveIndexAsset(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::RemoveIndexAsset( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::RemoveIndexAsset"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->RemoveIndexAsset(operation)); +} + +StreamRange +WarehouseTracingConnection::ViewIndexedAssets( + google::cloud::visionai::v1::ViewIndexedAssetsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::ViewIndexedAssets"); + internal::OTelScope scope(span); + auto sr = child_->ViewIndexedAssets(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::visionai::v1::IndexedAsset>(std::move(span), + std::move(sr)); +} + +future> +WarehouseTracingConnection::CreateIndex( + google::cloud::visionai::v1::CreateIndexRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::CreateIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateIndex(request)); +} + +StatusOr +WarehouseTracingConnection::CreateIndex( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::CreateIndex"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateIndex(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::CreateIndex( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::CreateIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateIndex(operation)); +} + +future> +WarehouseTracingConnection::UpdateIndex( + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UpdateIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateIndex(request)); +} + +StatusOr +WarehouseTracingConnection::UpdateIndex( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UpdateIndex"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateIndex(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::UpdateIndex( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UpdateIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateIndex(operation)); +} + +StatusOr +WarehouseTracingConnection::GetIndex( + google::cloud::visionai::v1::GetIndexRequest const& request) { + auto span = internal::MakeSpan("visionai_v1::WarehouseConnection::GetIndex"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetIndex(request)); +} + +StreamRange +WarehouseTracingConnection::ListIndexes( + google::cloud::visionai::v1::ListIndexesRequest request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::ListIndexes"); + internal::OTelScope scope(span); + auto sr = child_->ListIndexes(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +future> +WarehouseTracingConnection::DeleteIndex( + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeleteIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteIndex(request)); +} + +StatusOr +WarehouseTracingConnection::DeleteIndex( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeleteIndex"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteIndex(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::DeleteIndex( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeleteIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteIndex(operation)); +} + +future> +WarehouseTracingConnection::CreateCorpus( + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::CreateCorpus"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateCorpus(request)); +} + +StatusOr +WarehouseTracingConnection::CreateCorpus( + NoAwaitTag, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::CreateCorpus"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateCorpus(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::CreateCorpus( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::CreateCorpus"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateCorpus(operation)); +} + +StatusOr +WarehouseTracingConnection::GetCorpus( + google::cloud::visionai::v1::GetCorpusRequest const& request) { + auto span = internal::MakeSpan("visionai_v1::WarehouseConnection::GetCorpus"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetCorpus(request)); +} + +StatusOr +WarehouseTracingConnection::UpdateCorpus( + google::cloud::visionai::v1::UpdateCorpusRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UpdateCorpus"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateCorpus(request)); +} + +StreamRange +WarehouseTracingConnection::ListCorpora( + google::cloud::visionai::v1::ListCorporaRequest request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::ListCorpora"); + internal::OTelScope scope(span); + auto sr = child_->ListCorpora(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +Status WarehouseTracingConnection::DeleteCorpus( + google::cloud::visionai::v1::DeleteCorpusRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeleteCorpus"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteCorpus(request)); +} + +future> +WarehouseTracingConnection::AnalyzeCorpus( + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::AnalyzeCorpus"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->AnalyzeCorpus(request)); +} + +StatusOr +WarehouseTracingConnection::AnalyzeCorpus( + NoAwaitTag, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::AnalyzeCorpus"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->AnalyzeCorpus(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::AnalyzeCorpus( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::AnalyzeCorpus"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->AnalyzeCorpus(operation)); +} + +StatusOr +WarehouseTracingConnection::CreateDataSchema( + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::CreateDataSchema"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateDataSchema(request)); +} + +StatusOr +WarehouseTracingConnection::UpdateDataSchema( + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UpdateDataSchema"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateDataSchema(request)); +} + +StatusOr +WarehouseTracingConnection::GetDataSchema( + google::cloud::visionai::v1::GetDataSchemaRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::GetDataSchema"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetDataSchema(request)); +} + +Status WarehouseTracingConnection::DeleteDataSchema( + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeleteDataSchema"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteDataSchema(request)); +} + +StreamRange +WarehouseTracingConnection::ListDataSchemas( + google::cloud::visionai::v1::ListDataSchemasRequest request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::ListDataSchemas"); + internal::OTelScope scope(span); + auto sr = child_->ListDataSchemas(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::visionai::v1::DataSchema>(std::move(span), std::move(sr)); +} + +StatusOr +WarehouseTracingConnection::CreateAnnotation( + google::cloud::visionai::v1::CreateAnnotationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::CreateAnnotation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateAnnotation(request)); +} + +StatusOr +WarehouseTracingConnection::GetAnnotation( + google::cloud::visionai::v1::GetAnnotationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::GetAnnotation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetAnnotation(request)); +} + +StreamRange +WarehouseTracingConnection::ListAnnotations( + google::cloud::visionai::v1::ListAnnotationsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::ListAnnotations"); + internal::OTelScope scope(span); + auto sr = child_->ListAnnotations(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::visionai::v1::Annotation>(std::move(span), std::move(sr)); +} + +StatusOr +WarehouseTracingConnection::UpdateAnnotation( + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UpdateAnnotation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateAnnotation(request)); +} + +Status WarehouseTracingConnection::DeleteAnnotation( + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeleteAnnotation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteAnnotation(request)); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> +WarehouseTracingConnection::AsyncIngestAsset() { + return child_->AsyncIngestAsset(); +} + +StatusOr +WarehouseTracingConnection::ClipAsset( + google::cloud::visionai::v1::ClipAssetRequest const& request) { + auto span = internal::MakeSpan("visionai_v1::WarehouseConnection::ClipAsset"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->ClipAsset(request)); +} + +StatusOr +WarehouseTracingConnection::GenerateHlsUri( + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::GenerateHlsUri"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GenerateHlsUri(request)); +} + +future> +WarehouseTracingConnection::ImportAssets( + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::ImportAssets"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->ImportAssets(request)); +} + +StatusOr +WarehouseTracingConnection::ImportAssets( + NoAwaitTag, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::ImportAssets"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->ImportAssets(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::ImportAssets( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::ImportAssets"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->ImportAssets(operation)); +} + +StatusOr +WarehouseTracingConnection::CreateSearchConfig( + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::CreateSearchConfig"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateSearchConfig(request)); +} + +StatusOr +WarehouseTracingConnection::UpdateSearchConfig( + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::UpdateSearchConfig"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateSearchConfig(request)); +} + +StatusOr +WarehouseTracingConnection::GetSearchConfig( + google::cloud::visionai::v1::GetSearchConfigRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::GetSearchConfig"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetSearchConfig(request)); +} + +Status WarehouseTracingConnection::DeleteSearchConfig( + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::DeleteSearchConfig"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteSearchConfig(request)); +} + +StreamRange +WarehouseTracingConnection::ListSearchConfigs( + google::cloud::visionai::v1::ListSearchConfigsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::ListSearchConfigs"); + internal::OTelScope scope(span); + auto sr = child_->ListSearchConfigs(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::visionai::v1::SearchConfig>(std::move(span), + std::move(sr)); +} + +StatusOr +WarehouseTracingConnection::CreateSearchHypernym( + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::CreateSearchHypernym"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CreateSearchHypernym(request)); +} + +StatusOr +WarehouseTracingConnection::UpdateSearchHypernym( + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::UpdateSearchHypernym"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateSearchHypernym(request)); +} + +StatusOr +WarehouseTracingConnection::GetSearchHypernym( + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::GetSearchHypernym"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetSearchHypernym(request)); +} + +Status WarehouseTracingConnection::DeleteSearchHypernym( + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::DeleteSearchHypernym"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteSearchHypernym(request)); +} + +StreamRange +WarehouseTracingConnection::ListSearchHypernyms( + google::cloud::visionai::v1::ListSearchHypernymsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::ListSearchHypernyms"); + internal::OTelScope scope(span); + auto sr = child_->ListSearchHypernyms(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::visionai::v1::SearchHypernym>(std::move(span), + std::move(sr)); +} + +StreamRange +WarehouseTracingConnection::SearchAssets( + google::cloud::visionai::v1::SearchAssetsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::SearchAssets"); + internal::OTelScope scope(span); + auto sr = child_->SearchAssets(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::visionai::v1::SearchResultItem>(std::move(span), + std::move(sr)); +} + +StreamRange +WarehouseTracingConnection::SearchIndexEndpoint( + google::cloud::visionai::v1::SearchIndexEndpointRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::SearchIndexEndpoint"); + internal::OTelScope scope(span); + auto sr = child_->SearchIndexEndpoint(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::visionai::v1::SearchResultItem>(std::move(span), + std::move(sr)); +} + +future> +WarehouseTracingConnection::CreateIndexEndpoint( + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::CreateIndexEndpoint"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateIndexEndpoint(request)); +} + +StatusOr +WarehouseTracingConnection::CreateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::CreateIndexEndpoint"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateIndexEndpoint(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::CreateIndexEndpoint( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::CreateIndexEndpoint"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateIndexEndpoint(operation)); +} + +StatusOr +WarehouseTracingConnection::GetIndexEndpoint( + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::GetIndexEndpoint"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetIndexEndpoint(request)); +} + +StreamRange +WarehouseTracingConnection::ListIndexEndpoints( + google::cloud::visionai::v1::ListIndexEndpointsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::ListIndexEndpoints"); + internal::OTelScope scope(span); + auto sr = child_->ListIndexEndpoints(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::visionai::v1::IndexEndpoint>(std::move(span), + std::move(sr)); +} + +future> +WarehouseTracingConnection::UpdateIndexEndpoint( + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::UpdateIndexEndpoint"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateIndexEndpoint(request)); +} + +StatusOr +WarehouseTracingConnection::UpdateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::UpdateIndexEndpoint"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateIndexEndpoint(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::UpdateIndexEndpoint( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::UpdateIndexEndpoint"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateIndexEndpoint(operation)); +} + +future> +WarehouseTracingConnection::DeleteIndexEndpoint( + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::DeleteIndexEndpoint"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteIndexEndpoint(request)); +} + +StatusOr +WarehouseTracingConnection::DeleteIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::DeleteIndexEndpoint"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteIndexEndpoint(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::DeleteIndexEndpoint( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::DeleteIndexEndpoint"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteIndexEndpoint(operation)); +} + +future> +WarehouseTracingConnection::DeployIndex( + google::cloud::visionai::v1::DeployIndexRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeployIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeployIndex(request)); +} + +StatusOr +WarehouseTracingConnection::DeployIndex( + NoAwaitTag, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeployIndex"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeployIndex(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::DeployIndex( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeployIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeployIndex(operation)); +} + +future> +WarehouseTracingConnection::UndeployIndex( + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UndeployIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UndeployIndex(request)); +} + +StatusOr +WarehouseTracingConnection::UndeployIndex( + NoAwaitTag, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UndeployIndex"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UndeployIndex(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::UndeployIndex( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UndeployIndex"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UndeployIndex(operation)); +} + +future> +WarehouseTracingConnection::CreateCollection( + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::CreateCollection"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateCollection(request)); +} + +StatusOr +WarehouseTracingConnection::CreateCollection( + NoAwaitTag, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::CreateCollection"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateCollection(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::CreateCollection( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::CreateCollection"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateCollection(operation)); +} + +future> +WarehouseTracingConnection::DeleteCollection( + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeleteCollection"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteCollection(request)); +} + +StatusOr +WarehouseTracingConnection::DeleteCollection( + NoAwaitTag, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeleteCollection"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteCollection(NoAwaitTag{}, request)); +} + +future> +WarehouseTracingConnection::DeleteCollection( + google::longrunning::Operation const& operation) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeleteCollection"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteCollection(operation)); +} + +StatusOr +WarehouseTracingConnection::GetCollection( + google::cloud::visionai::v1::GetCollectionRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::GetCollection"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetCollection(request)); +} + +StatusOr +WarehouseTracingConnection::UpdateCollection( + google::cloud::visionai::v1::UpdateCollectionRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::UpdateCollection"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->UpdateCollection(request)); +} + +StreamRange +WarehouseTracingConnection::ListCollections( + google::cloud::visionai::v1::ListCollectionsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::ListCollections"); + internal::OTelScope scope(span); + auto sr = child_->ListCollections(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::visionai::v1::Collection>(std::move(span), std::move(sr)); +} + +StatusOr +WarehouseTracingConnection::AddCollectionItem( + google::cloud::visionai::v1::AddCollectionItemRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::AddCollectionItem"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->AddCollectionItem(request)); +} + +StatusOr +WarehouseTracingConnection::RemoveCollectionItem( + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::RemoveCollectionItem"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->RemoveCollectionItem(request)); +} + +StreamRange +WarehouseTracingConnection::ViewCollectionItems( + google::cloud::visionai::v1::ViewCollectionItemsRequest request) { + auto span = internal::MakeSpan( + "visionai_v1::WarehouseConnection::ViewCollectionItems"); + internal::OTelScope scope(span); + auto sr = child_->ViewCollectionItems(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::visionai::v1::CollectionItem>(std::move(span), + std::move(sr)); +} + +StreamRange +WarehouseTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +WarehouseTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +WarehouseTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +WarehouseTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status WarehouseTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status WarehouseTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = + internal::MakeSpan("visionai_v1::WarehouseConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeWarehouseTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/internal/warehouse_tracing_connection.h b/google/cloud/visionai/v1/internal/warehouse_tracing_connection.h new file mode 100644 index 0000000000000..040527667fb35 --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_tracing_connection.h @@ -0,0 +1,445 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_TRACING_CONNECTION_H + +#include "google/cloud/visionai/v1/warehouse_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WarehouseTracingConnection : public visionai_v1::WarehouseConnection { + public: + ~WarehouseTracingConnection() override = default; + + explicit WarehouseTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StatusOr CreateAsset( + google::cloud::visionai::v1::CreateAssetRequest const& request) override; + + StatusOr UpdateAsset( + google::cloud::visionai::v1::UpdateAssetRequest const& request) override; + + StatusOr GetAsset( + google::cloud::visionai::v1::GetAssetRequest const& request) override; + + StreamRange ListAssets( + google::cloud::visionai::v1::ListAssetsRequest request) override; + + future> + DeleteAsset( + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + StatusOr DeleteAsset( + NoAwaitTag, + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + future> + DeleteAsset(google::longrunning::Operation const& operation) override; + + future> + UploadAsset( + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + StatusOr UploadAsset( + NoAwaitTag, + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + future> + UploadAsset(google::longrunning::Operation const& operation) override; + + StatusOr + GenerateRetrievalUrl( + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) + override; + + future> + AnalyzeAsset( + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + StatusOr AnalyzeAsset( + NoAwaitTag, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + future> + AnalyzeAsset(google::longrunning::Operation const& operation) override; + + future> IndexAsset( + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + StatusOr IndexAsset( + NoAwaitTag, + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + future> IndexAsset( + google::longrunning::Operation const& operation) override; + + future> + RemoveIndexAsset(google::cloud::visionai::v1::RemoveIndexAssetRequest const& + request) override; + + StatusOr RemoveIndexAsset( + NoAwaitTag, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) + override; + + future> + RemoveIndexAsset(google::longrunning::Operation const& operation) override; + + StreamRange ViewIndexedAssets( + google::cloud::visionai::v1::ViewIndexedAssetsRequest request) override; + + future> CreateIndex( + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + StatusOr CreateIndex( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + future> CreateIndex( + google::longrunning::Operation const& operation) override; + + future> UpdateIndex( + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + StatusOr UpdateIndex( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + future> UpdateIndex( + google::longrunning::Operation const& operation) override; + + StatusOr GetIndex( + google::cloud::visionai::v1::GetIndexRequest const& request) override; + + StreamRange ListIndexes( + google::cloud::visionai::v1::ListIndexesRequest request) override; + + future> + DeleteIndex( + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + StatusOr DeleteIndex( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + future> + DeleteIndex(google::longrunning::Operation const& operation) override; + + future> CreateCorpus( + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + StatusOr CreateCorpus( + NoAwaitTag, + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + future> CreateCorpus( + google::longrunning::Operation const& operation) override; + + StatusOr GetCorpus( + google::cloud::visionai::v1::GetCorpusRequest const& request) override; + + StatusOr UpdateCorpus( + google::cloud::visionai::v1::UpdateCorpusRequest const& request) override; + + StreamRange ListCorpora( + google::cloud::visionai::v1::ListCorporaRequest request) override; + + Status DeleteCorpus( + google::cloud::visionai::v1::DeleteCorpusRequest const& request) override; + + future> + AnalyzeCorpus(google::cloud::visionai::v1::AnalyzeCorpusRequest const& + request) override; + + StatusOr AnalyzeCorpus( + NoAwaitTag, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) + override; + + future> + AnalyzeCorpus(google::longrunning::Operation const& operation) override; + + StatusOr CreateDataSchema( + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) + override; + + StatusOr UpdateDataSchema( + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) + override; + + StatusOr GetDataSchema( + google::cloud::visionai::v1::GetDataSchemaRequest const& request) + override; + + Status DeleteDataSchema( + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) + override; + + StreamRange ListDataSchemas( + google::cloud::visionai::v1::ListDataSchemasRequest request) override; + + StatusOr CreateAnnotation( + google::cloud::visionai::v1::CreateAnnotationRequest const& request) + override; + + StatusOr GetAnnotation( + google::cloud::visionai::v1::GetAnnotationRequest const& request) + override; + + StreamRange ListAnnotations( + google::cloud::visionai::v1::ListAnnotationsRequest request) override; + + StatusOr UpdateAnnotation( + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) + override; + + Status DeleteAnnotation( + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) + override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> + AsyncIngestAsset() override; + + StatusOr ClipAsset( + google::cloud::visionai::v1::ClipAssetRequest const& request) override; + + StatusOr GenerateHlsUri( + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) + override; + + future> + ImportAssets( + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + StatusOr ImportAssets( + NoAwaitTag, + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + future> + ImportAssets(google::longrunning::Operation const& operation) override; + + StatusOr CreateSearchConfig( + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) + override; + + StatusOr UpdateSearchConfig( + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) + override; + + StatusOr GetSearchConfig( + google::cloud::visionai::v1::GetSearchConfigRequest const& request) + override; + + Status DeleteSearchConfig( + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) + override; + + StreamRange ListSearchConfigs( + google::cloud::visionai::v1::ListSearchConfigsRequest request) override; + + StatusOr CreateSearchHypernym( + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) + override; + + StatusOr UpdateSearchHypernym( + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) + override; + + StatusOr GetSearchHypernym( + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) + override; + + Status DeleteSearchHypernym( + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) + override; + + StreamRange ListSearchHypernyms( + google::cloud::visionai::v1::ListSearchHypernymsRequest request) override; + + StreamRange SearchAssets( + google::cloud::visionai::v1::SearchAssetsRequest request) override; + + StreamRange + SearchIndexEndpoint( + google::cloud::visionai::v1::SearchIndexEndpointRequest request) override; + + future> + CreateIndexEndpoint( + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + StatusOr CreateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + future> + CreateIndexEndpoint(google::longrunning::Operation const& operation) override; + + StatusOr GetIndexEndpoint( + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) + override; + + StreamRange ListIndexEndpoints( + google::cloud::visionai::v1::ListIndexEndpointsRequest request) override; + + future> + UpdateIndexEndpoint( + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + StatusOr UpdateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + future> + UpdateIndexEndpoint(google::longrunning::Operation const& operation) override; + + future> + DeleteIndexEndpoint( + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + StatusOr DeleteIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + future> + DeleteIndexEndpoint(google::longrunning::Operation const& operation) override; + + future> + DeployIndex( + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + StatusOr DeployIndex( + NoAwaitTag, + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + future> + DeployIndex(google::longrunning::Operation const& operation) override; + + future> + UndeployIndex(google::cloud::visionai::v1::UndeployIndexRequest const& + request) override; + + StatusOr UndeployIndex( + NoAwaitTag, + google::cloud::visionai::v1::UndeployIndexRequest const& request) + override; + + future> + UndeployIndex(google::longrunning::Operation const& operation) override; + + future> CreateCollection( + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + NoAwaitTag, + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + future> CreateCollection( + google::longrunning::Operation const& operation) override; + + future> + DeleteCollection(google::cloud::visionai::v1::DeleteCollectionRequest const& + request) override; + + StatusOr DeleteCollection( + NoAwaitTag, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) + override; + + future> + DeleteCollection(google::longrunning::Operation const& operation) override; + + StatusOr GetCollection( + google::cloud::visionai::v1::GetCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + google::cloud::visionai::v1::UpdateCollectionRequest const& request) + override; + + StreamRange ListCollections( + google::cloud::visionai::v1::ListCollectionsRequest request) override; + + StatusOr + AddCollectionItem(google::cloud::visionai::v1::AddCollectionItemRequest const& + request) override; + + StatusOr + RemoveCollectionItem( + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) + override; + + StreamRange ViewCollectionItems( + google::cloud::visionai::v1::ViewCollectionItemsRequest request) 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_; +}; + +/** + * 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 +MakeWarehouseTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_TRACING_CONNECTION_H diff --git a/google/cloud/visionai/v1/internal/warehouse_tracing_stub.cc b/google/cloud/visionai/v1/internal/warehouse_tracing_stub.cc new file mode 100644 index 0000000000000..ba88f8bce377d --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_tracing_stub.cc @@ -0,0 +1,1136 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#include "google/cloud/visionai/v1/internal/warehouse_tracing_stub.h" +#include "google/cloud/internal/async_read_write_stream_tracing.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WarehouseTracingStub::WarehouseTracingStub(std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr WarehouseTracingStub::CreateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAssetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CreateAsset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateAsset(context, options, request)); +} + +StatusOr WarehouseTracingStub::UpdateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAssetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UpdateAsset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateAsset(context, options, request)); +} + +StatusOr WarehouseTracingStub::GetAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAssetRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", "GetAsset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetAsset(context, options, request)); +} + +StatusOr +WarehouseTracingStub::ListAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAssetsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ListAssets"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListAssets(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncDeleteAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteAsset"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteAsset(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::DeleteAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteAsset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteAsset(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncUploadAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UploadAsset"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUploadAsset(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::UploadAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UploadAssetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UploadAsset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UploadAsset(context, options, request)); +} + +StatusOr +WarehouseTracingStub::GenerateRetrievalUrl( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "GenerateRetrievalUrl"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->GenerateRetrievalUrl(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncAnalyzeAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "AnalyzeAsset"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncAnalyzeAsset(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::AnalyzeAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "AnalyzeAsset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->AnalyzeAsset(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::IndexAssetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "IndexAsset"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncIndexAsset(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::IndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::IndexAssetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "IndexAsset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->IndexAsset(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncRemoveIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "RemoveIndexAsset"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncRemoveIndexAsset(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::RemoveIndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "RemoveIndexAsset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->RemoveIndexAsset(context, options, request)); +} + +StatusOr +WarehouseTracingStub::ViewIndexedAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewIndexedAssetsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ViewIndexedAssets"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ViewIndexedAssets(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CreateIndex"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateIndex(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CreateIndex"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateIndex(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncUpdateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UpdateIndex"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateIndex(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::UpdateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UpdateIndex"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateIndex(context, options, request)); +} + +StatusOr WarehouseTracingStub::GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", "GetIndex"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetIndex(context, options, request)); +} + +StatusOr +WarehouseTracingStub::ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexesRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ListIndexes"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListIndexes(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteIndex"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteIndex(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteIndex"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteIndex(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncCreateCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CreateCorpus"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateCorpus(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::CreateCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CreateCorpus"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateCorpus(context, options, request)); +} + +StatusOr WarehouseTracingStub::GetCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCorpusRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", "GetCorpus"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetCorpus(context, options, request)); +} + +StatusOr +WarehouseTracingStub::UpdateCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCorpusRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UpdateCorpus"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateCorpus(context, options, request)); +} + +StatusOr +WarehouseTracingStub::ListCorpora( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCorporaRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ListCorpora"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListCorpora(context, options, request)); +} + +Status WarehouseTracingStub::DeleteCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCorpusRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteCorpus"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteCorpus(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncAnalyzeCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "AnalyzeCorpus"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncAnalyzeCorpus(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::AnalyzeCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "AnalyzeCorpus"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->AnalyzeCorpus(context, options, request)); +} + +StatusOr +WarehouseTracingStub::CreateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CreateDataSchema"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateDataSchema(context, options, request)); +} + +StatusOr +WarehouseTracingStub::UpdateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UpdateDataSchema"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateDataSchema(context, options, request)); +} + +StatusOr +WarehouseTracingStub::GetDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDataSchemaRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "GetDataSchema"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetDataSchema(context, options, request)); +} + +Status WarehouseTracingStub::DeleteDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteDataSchema"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteDataSchema(context, options, request)); +} + +StatusOr +WarehouseTracingStub::ListDataSchemas( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDataSchemasRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ListDataSchemas"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListDataSchemas(context, options, request)); +} + +StatusOr +WarehouseTracingStub::CreateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnnotationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CreateAnnotation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateAnnotation(context, options, request)); +} + +StatusOr +WarehouseTracingStub::GetAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnnotationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "GetAnnotation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetAnnotation(context, options, request)); +} + +StatusOr +WarehouseTracingStub::ListAnnotations( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnnotationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ListAnnotations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListAnnotations(context, options, request)); +} + +StatusOr +WarehouseTracingStub::UpdateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UpdateAnnotation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateAnnotation(context, options, request)); +} + +Status WarehouseTracingStub::DeleteAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteAnnotation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteAnnotation(context, options, request)); +} + +std::unique_ptr> +WarehouseTracingStub::AsyncIngestAsset( + CompletionQueue const& cq, std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "IngestAsset"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto stream = child_->AsyncIngestAsset(cq, context, std::move(options)); + return std::make_unique>( + std::move(context), std::move(stream), std::move(span)); +} + +StatusOr +WarehouseTracingStub::ClipAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ClipAssetRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", "ClipAsset"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ClipAsset(context, options, request)); +} + +StatusOr +WarehouseTracingStub::GenerateHlsUri( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "GenerateHlsUri"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GenerateHlsUri(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncImportAssets( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ImportAssets"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncImportAssets(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::ImportAssets( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ImportAssets"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ImportAssets(context, options, request)); +} + +StatusOr +WarehouseTracingStub::CreateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CreateSearchConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->CreateSearchConfig(context, options, request)); +} + +StatusOr +WarehouseTracingStub::UpdateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UpdateSearchConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UpdateSearchConfig(context, options, request)); +} + +StatusOr +WarehouseTracingStub::GetSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchConfigRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "GetSearchConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetSearchConfig(context, options, request)); +} + +Status WarehouseTracingStub::DeleteSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteSearchConfig"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteSearchConfig(context, options, request)); +} + +StatusOr +WarehouseTracingStub::ListSearchConfigs( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchConfigsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ListSearchConfigs"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListSearchConfigs(context, options, request)); +} + +StatusOr +WarehouseTracingStub::CreateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CreateSearchHypernym"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->CreateSearchHypernym(context, options, request)); +} + +StatusOr +WarehouseTracingStub::UpdateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UpdateSearchHypernym"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UpdateSearchHypernym(context, options, request)); +} + +StatusOr +WarehouseTracingStub::GetSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "GetSearchHypernym"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->GetSearchHypernym(context, options, request)); +} + +Status WarehouseTracingStub::DeleteSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteSearchHypernym"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteSearchHypernym(context, options, request)); +} + +StatusOr +WarehouseTracingStub::ListSearchHypernyms( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchHypernymsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ListSearchHypernyms"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListSearchHypernyms(context, options, request)); +} + +StatusOr +WarehouseTracingStub::SearchAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchAssetsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "SearchAssets"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->SearchAssets(context, options, request)); +} + +StatusOr +WarehouseTracingStub::SearchIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchIndexEndpointRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "SearchIndexEndpoint"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->SearchIndexEndpoint(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncCreateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CreateIndexEndpoint"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateIndexEndpoint(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +WarehouseTracingStub::CreateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CreateIndexEndpoint"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->CreateIndexEndpoint(context, options, request)); +} + +StatusOr +WarehouseTracingStub::GetIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "GetIndexEndpoint"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetIndexEndpoint(context, options, request)); +} + +StatusOr +WarehouseTracingStub::ListIndexEndpoints( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexEndpointsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ListIndexEndpoints"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListIndexEndpoints(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncUpdateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UpdateIndexEndpoint"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateIndexEndpoint(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +WarehouseTracingStub::UpdateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UpdateIndexEndpoint"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UpdateIndexEndpoint(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncDeleteIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteIndexEndpoint"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteIndexEndpoint(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +WarehouseTracingStub::DeleteIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteIndexEndpoint"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteIndexEndpoint(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncDeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeployIndex"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeployIndex(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::DeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployIndexRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeployIndex"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeployIndex(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncUndeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UndeployIndex"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUndeployIndex(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::UndeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UndeployIndex"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UndeployIndex(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CreateCollection"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateCollection(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CreateCollection"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateCollection(context, options, request)); +} + +future> +WarehouseTracingStub::AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteCollection"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteCollection(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr WarehouseTracingStub::DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteCollection"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteCollection(context, options, request)); +} + +StatusOr +WarehouseTracingStub::GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCollectionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "GetCollection"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetCollection(context, options, request)); +} + +StatusOr +WarehouseTracingStub::UpdateCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCollectionRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "UpdateCollection"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateCollection(context, options, request)); +} + +StatusOr +WarehouseTracingStub::ListCollections( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCollectionsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ListCollections"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListCollections(context, options, request)); +} + +StatusOr +WarehouseTracingStub::AddCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddCollectionItemRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "AddCollectionItem"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->AddCollectionItem(context, options, request)); +} + +StatusOr +WarehouseTracingStub::RemoveCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "RemoveCollectionItem"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->RemoveCollectionItem(context, options, request)); +} + +StatusOr +WarehouseTracingStub::ViewCollectionItems( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewCollectionItemsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ViewCollectionItems"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ViewCollectionItems(context, options, request)); +} + +StatusOr +WarehouseTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr WarehouseTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +WarehouseTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr WarehouseTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status WarehouseTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status WarehouseTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.cloud.visionai.v1.Warehouse", + "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +WarehouseTracingStub::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 WarehouseTracingStub::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)); +} + +std::shared_ptr MakeWarehouseTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/visionai/v1/internal/warehouse_tracing_stub.h b/google/cloud/visionai/v1/internal/warehouse_tracing_stub.h new file mode 100644 index 0000000000000..444ec1db99292 --- /dev/null +++ b/google/cloud/visionai/v1/internal/warehouse_tracing_stub.h @@ -0,0 +1,517 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_TRACING_STUB_H + +#include "google/cloud/visionai/v1/internal/warehouse_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace visionai_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WarehouseTracingStub : public WarehouseStub { + public: + ~WarehouseTracingStub() override = default; + + explicit WarehouseTracingStub(std::shared_ptr child); + + StatusOr CreateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAssetRequest const& request) override; + + StatusOr UpdateAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAssetRequest const& request) override; + + StatusOr GetAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAssetRequest const& request) override; + + StatusOr ListAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAssetsRequest const& request) override; + + future> AsyncDeleteAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + StatusOr DeleteAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteAssetRequest const& request) override; + + future> AsyncUploadAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + StatusOr UploadAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UploadAssetRequest const& request) override; + + StatusOr + GenerateRetrievalUrl( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request) + override; + + future> AsyncAnalyzeAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + StatusOr AnalyzeAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request) override; + + future> AsyncIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + StatusOr IndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::IndexAssetRequest const& request) override; + + future> AsyncRemoveIndexAsset( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) + override; + + StatusOr RemoveIndexAsset( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request) + override; + + StatusOr + ViewIndexedAssets(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewIndexedAssetsRequest const& + request) override; + + future> AsyncCreateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + StatusOr CreateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexRequest const& request) override; + + future> AsyncUpdateIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + StatusOr UpdateIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexRequest const& request) override; + + StatusOr GetIndex( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexRequest const& request) override; + + StatusOr ListIndexes( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexesRequest const& request) override; + + future> AsyncDeleteIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + StatusOr DeleteIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexRequest const& request) override; + + future> AsyncCreateCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + StatusOr CreateCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCorpusRequest const& request) override; + + StatusOr GetCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCorpusRequest const& request) override; + + StatusOr UpdateCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCorpusRequest const& request) override; + + StatusOr ListCorpora( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCorporaRequest const& request) override; + + Status DeleteCorpus( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteCorpusRequest const& request) override; + + future> AsyncAnalyzeCorpus( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) + override; + + StatusOr AnalyzeCorpus( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request) + override; + + StatusOr CreateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateDataSchemaRequest const& request) + override; + + StatusOr UpdateDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request) + override; + + StatusOr GetDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetDataSchemaRequest const& request) + override; + + Status DeleteDataSchema( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request) + override; + + StatusOr + ListDataSchemas(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListDataSchemasRequest const& + request) override; + + StatusOr CreateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateAnnotationRequest const& request) + override; + + StatusOr GetAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetAnnotationRequest const& request) + override; + + StatusOr + ListAnnotations(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListAnnotationsRequest const& + request) override; + + StatusOr UpdateAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateAnnotationRequest const& request) + override; + + Status DeleteAnnotation( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteAnnotationRequest const& request) + override; + + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> + AsyncIngestAsset(google::cloud::CompletionQueue const& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options) override; + + StatusOr ClipAsset( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ClipAssetRequest const& request) override; + + StatusOr GenerateHlsUri( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GenerateHlsUriRequest const& request) + override; + + future> AsyncImportAssets( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + StatusOr ImportAssets( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::ImportAssetsRequest const& request) override; + + StatusOr CreateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchConfigRequest const& request) + override; + + StatusOr UpdateSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request) + override; + + StatusOr GetSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchConfigRequest const& request) + override; + + Status DeleteSearchConfig( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request) + override; + + StatusOr + ListSearchConfigs(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchConfigsRequest const& + request) override; + + StatusOr CreateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request) + override; + + StatusOr UpdateSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request) + override; + + StatusOr GetSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetSearchHypernymRequest const& request) + override; + + Status DeleteSearchHypernym( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request) + override; + + StatusOr + ListSearchHypernyms( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListSearchHypernymsRequest const& request) + override; + + StatusOr SearchAssets( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchAssetsRequest const& request) override; + + StatusOr + SearchIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::SearchIndexEndpointRequest const& request) + override; + + future> AsyncCreateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + StatusOr CreateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request) + override; + + StatusOr GetIndexEndpoint( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetIndexEndpointRequest const& request) + override; + + StatusOr + ListIndexEndpoints( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListIndexEndpointsRequest const& request) + override; + + future> AsyncUpdateIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + StatusOr UpdateIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request) + override; + + future> AsyncDeleteIndexEndpoint( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + StatusOr DeleteIndexEndpoint( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request) + override; + + future> AsyncDeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + StatusOr DeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeployIndexRequest const& request) override; + + future> AsyncUndeployIndex( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) + override; + + StatusOr UndeployIndex( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::UndeployIndexRequest const& request) + override; + + future> AsyncCreateCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + StatusOr CreateCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::CreateCollectionRequest const& request) + override; + + future> AsyncDeleteCollection( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) + override; + + StatusOr DeleteCollection( + grpc::ClientContext& context, Options options, + google::cloud::visionai::v1::DeleteCollectionRequest const& request) + override; + + StatusOr GetCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::GetCollectionRequest const& request) + override; + + StatusOr UpdateCollection( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::UpdateCollectionRequest const& request) + override; + + StatusOr + ListCollections(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ListCollectionsRequest const& + request) override; + + StatusOr + AddCollectionItem(grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::AddCollectionItemRequest const& + request) override; + + StatusOr + RemoveCollectionItem( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request) + override; + + StatusOr + ViewCollectionItems( + grpc::ClientContext& context, Options const& options, + google::cloud::visionai::v1::ViewCollectionItemsRequest 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_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeWarehouseTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_INTERNAL_WAREHOUSE_TRACING_STUB_H diff --git a/google/cloud/visionai/v1/live_video_analytics_client.cc b/google/cloud/visionai/v1/live_video_analytics_client.cc new file mode 100644 index 0000000000000..e6e252fb40a2d --- /dev/null +++ b/google/cloud/visionai/v1/live_video_analytics_client.cc @@ -0,0 +1,708 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#include "google/cloud/visionai/v1/live_video_analytics_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +LiveVideoAnalyticsClient::LiveVideoAnalyticsClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +LiveVideoAnalyticsClient::~LiveVideoAnalyticsClient() = default; + +StreamRange +LiveVideoAnalyticsClient::ListPublicOperators(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListPublicOperatorsRequest request; + request.set_parent(parent); + return connection_->ListPublicOperators(request); +} + +StreamRange +LiveVideoAnalyticsClient::ListPublicOperators( + google::cloud::visionai::v1::ListPublicOperatorsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListPublicOperators(std::move(request)); +} + +StatusOr +LiveVideoAnalyticsClient::ResolveOperatorInfo( + std::string const& parent, + std::vector const& queries, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ResolveOperatorInfoRequest request; + request.set_parent(parent); + *request.mutable_queries() = {queries.begin(), queries.end()}; + return connection_->ResolveOperatorInfo(request); +} + +StatusOr +LiveVideoAnalyticsClient::ResolveOperatorInfo( + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ResolveOperatorInfo(request); +} + +StreamRange +LiveVideoAnalyticsClient::ListOperators(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListOperatorsRequest request; + request.set_parent(parent); + return connection_->ListOperators(request); +} + +StreamRange +LiveVideoAnalyticsClient::ListOperators( + google::cloud::visionai::v1::ListOperatorsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperators(std::move(request)); +} + +StatusOr +LiveVideoAnalyticsClient::GetOperator(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetOperatorRequest request; + request.set_name(name); + return connection_->GetOperator(request); +} + +StatusOr +LiveVideoAnalyticsClient::GetOperator( + google::cloud::visionai::v1::GetOperatorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperator(request); +} + +future> +LiveVideoAnalyticsClient::CreateOperator( + std::string const& parent, + google::cloud::visionai::v1::Operator const& operator_, + std::string const& operator_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateOperatorRequest request; + request.set_parent(parent); + *request.mutable_operator_() = operator_; + request.set_operator_id(operator_id); + return connection_->CreateOperator(request); +} + +StatusOr +LiveVideoAnalyticsClient::CreateOperator( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Operator const& operator_, + std::string const& operator_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateOperatorRequest request; + request.set_parent(parent); + *request.mutable_operator_() = operator_; + request.set_operator_id(operator_id); + return connection_->CreateOperator(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::CreateOperator( + google::cloud::visionai::v1::CreateOperatorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateOperator(request); +} + +StatusOr +LiveVideoAnalyticsClient::CreateOperator( + NoAwaitTag, + google::cloud::visionai::v1::CreateOperatorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateOperator(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::CreateOperator( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateOperator(operation); +} + +future> +LiveVideoAnalyticsClient::UpdateOperator( + google::cloud::visionai::v1::Operator const& operator_, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateOperatorRequest request; + *request.mutable_operator_() = operator_; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateOperator(request); +} + +StatusOr +LiveVideoAnalyticsClient::UpdateOperator( + NoAwaitTag, google::cloud::visionai::v1::Operator const& operator_, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateOperatorRequest request; + *request.mutable_operator_() = operator_; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateOperator(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::UpdateOperator( + google::cloud::visionai::v1::UpdateOperatorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateOperator(request); +} + +StatusOr +LiveVideoAnalyticsClient::UpdateOperator( + NoAwaitTag, + google::cloud::visionai::v1::UpdateOperatorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateOperator(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::UpdateOperator( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateOperator(operation); +} + +future> +LiveVideoAnalyticsClient::DeleteOperator(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteOperatorRequest request; + request.set_name(name); + return connection_->DeleteOperator(request); +} + +StatusOr +LiveVideoAnalyticsClient::DeleteOperator(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteOperatorRequest request; + request.set_name(name); + return connection_->DeleteOperator(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::DeleteOperator( + google::cloud::visionai::v1::DeleteOperatorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperator(request); +} + +StatusOr +LiveVideoAnalyticsClient::DeleteOperator( + NoAwaitTag, + google::cloud::visionai::v1::DeleteOperatorRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperator(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::DeleteOperator( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperator(operation); +} + +StreamRange +LiveVideoAnalyticsClient::ListAnalyses(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListAnalysesRequest request; + request.set_parent(parent); + return connection_->ListAnalyses(request); +} + +StreamRange +LiveVideoAnalyticsClient::ListAnalyses( + google::cloud::visionai::v1::ListAnalysesRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListAnalyses(std::move(request)); +} + +StatusOr +LiveVideoAnalyticsClient::GetAnalysis(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetAnalysisRequest request; + request.set_name(name); + return connection_->GetAnalysis(request); +} + +StatusOr +LiveVideoAnalyticsClient::GetAnalysis( + google::cloud::visionai::v1::GetAnalysisRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetAnalysis(request); +} + +future> +LiveVideoAnalyticsClient::CreateAnalysis( + std::string const& parent, + google::cloud::visionai::v1::Analysis const& analysis, + std::string const& analysis_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateAnalysisRequest request; + request.set_parent(parent); + *request.mutable_analysis() = analysis; + request.set_analysis_id(analysis_id); + return connection_->CreateAnalysis(request); +} + +StatusOr +LiveVideoAnalyticsClient::CreateAnalysis( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Analysis const& analysis, + std::string const& analysis_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateAnalysisRequest request; + request.set_parent(parent); + *request.mutable_analysis() = analysis; + request.set_analysis_id(analysis_id); + return connection_->CreateAnalysis(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::CreateAnalysis( + google::cloud::visionai::v1::CreateAnalysisRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateAnalysis(request); +} + +StatusOr +LiveVideoAnalyticsClient::CreateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::CreateAnalysisRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateAnalysis(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::CreateAnalysis( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateAnalysis(operation); +} + +future> +LiveVideoAnalyticsClient::UpdateAnalysis( + google::cloud::visionai::v1::Analysis const& analysis, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateAnalysisRequest request; + *request.mutable_analysis() = analysis; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateAnalysis(request); +} + +StatusOr +LiveVideoAnalyticsClient::UpdateAnalysis( + NoAwaitTag, google::cloud::visionai::v1::Analysis const& analysis, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateAnalysisRequest request; + *request.mutable_analysis() = analysis; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateAnalysis(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::UpdateAnalysis( + google::cloud::visionai::v1::UpdateAnalysisRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateAnalysis(request); +} + +StatusOr +LiveVideoAnalyticsClient::UpdateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateAnalysis(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::UpdateAnalysis( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateAnalysis(operation); +} + +future> +LiveVideoAnalyticsClient::DeleteAnalysis(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteAnalysisRequest request; + request.set_name(name); + return connection_->DeleteAnalysis(request); +} + +StatusOr +LiveVideoAnalyticsClient::DeleteAnalysis(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteAnalysisRequest request; + request.set_name(name); + return connection_->DeleteAnalysis(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::DeleteAnalysis( + google::cloud::visionai::v1::DeleteAnalysisRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteAnalysis(request); +} + +StatusOr +LiveVideoAnalyticsClient::DeleteAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteAnalysis(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::DeleteAnalysis( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteAnalysis(operation); +} + +StreamRange +LiveVideoAnalyticsClient::ListProcesses(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListProcessesRequest request; + request.set_parent(parent); + return connection_->ListProcesses(request); +} + +StreamRange +LiveVideoAnalyticsClient::ListProcesses( + google::cloud::visionai::v1::ListProcessesRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListProcesses(std::move(request)); +} + +StatusOr +LiveVideoAnalyticsClient::GetProcess(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetProcessRequest request; + request.set_name(name); + return connection_->GetProcess(request); +} + +StatusOr +LiveVideoAnalyticsClient::GetProcess( + google::cloud::visionai::v1::GetProcessRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetProcess(request); +} + +future> +LiveVideoAnalyticsClient::CreateProcess( + std::string const& parent, + google::cloud::visionai::v1::Process const& process, + std::string const& process_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateProcessRequest request; + request.set_parent(parent); + *request.mutable_process() = process; + request.set_process_id(process_id); + return connection_->CreateProcess(request); +} + +StatusOr +LiveVideoAnalyticsClient::CreateProcess( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Process const& process, + std::string const& process_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateProcessRequest request; + request.set_parent(parent); + *request.mutable_process() = process; + request.set_process_id(process_id); + return connection_->CreateProcess(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::CreateProcess( + google::cloud::visionai::v1::CreateProcessRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateProcess(request); +} + +StatusOr +LiveVideoAnalyticsClient::CreateProcess( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateProcess(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::CreateProcess( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateProcess(operation); +} + +future> +LiveVideoAnalyticsClient::UpdateProcess( + google::cloud::visionai::v1::Process const& process, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateProcessRequest request; + *request.mutable_process() = process; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateProcess(request); +} + +StatusOr +LiveVideoAnalyticsClient::UpdateProcess( + NoAwaitTag, google::cloud::visionai::v1::Process const& process, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateProcessRequest request; + *request.mutable_process() = process; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateProcess(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::UpdateProcess( + google::cloud::visionai::v1::UpdateProcessRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateProcess(request); +} + +StatusOr +LiveVideoAnalyticsClient::UpdateProcess( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateProcess(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::UpdateProcess( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateProcess(operation); +} + +future> +LiveVideoAnalyticsClient::DeleteProcess(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteProcessRequest request; + request.set_name(name); + return connection_->DeleteProcess(request); +} + +StatusOr +LiveVideoAnalyticsClient::DeleteProcess(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteProcessRequest request; + request.set_name(name); + return connection_->DeleteProcess(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::DeleteProcess( + google::cloud::visionai::v1::DeleteProcessRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteProcess(request); +} + +StatusOr +LiveVideoAnalyticsClient::DeleteProcess( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteProcess(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::DeleteProcess( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteProcess(operation); +} + +future> +LiveVideoAnalyticsClient::BatchRunProcess( + std::string const& parent, + std::vector const& + requests, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::BatchRunProcessRequest request; + request.set_parent(parent); + *request.mutable_requests() = {requests.begin(), requests.end()}; + return connection_->BatchRunProcess(request); +} + +StatusOr +LiveVideoAnalyticsClient::BatchRunProcess( + NoAwaitTag, std::string const& parent, + std::vector const& + requests, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::BatchRunProcessRequest request; + request.set_parent(parent); + *request.mutable_requests() = {requests.begin(), requests.end()}; + return connection_->BatchRunProcess(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::BatchRunProcess( + google::cloud::visionai::v1::BatchRunProcessRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->BatchRunProcess(request); +} + +StatusOr +LiveVideoAnalyticsClient::BatchRunProcess( + NoAwaitTag, + google::cloud::visionai::v1::BatchRunProcessRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->BatchRunProcess(NoAwaitTag{}, request); +} + +future> +LiveVideoAnalyticsClient::BatchRunProcess( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->BatchRunProcess(operation); +} + +StreamRange +LiveVideoAnalyticsClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr +LiveVideoAnalyticsClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange +LiveVideoAnalyticsClient::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 +LiveVideoAnalyticsClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr LiveVideoAnalyticsClient::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 LiveVideoAnalyticsClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status LiveVideoAnalyticsClient::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 LiveVideoAnalyticsClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status LiveVideoAnalyticsClient::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 LiveVideoAnalyticsClient::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 visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/live_video_analytics_client.h b/google/cloud/visionai/v1/live_video_analytics_client.h new file mode 100644 index 0000000000000..095432694ba4b --- /dev/null +++ b/google/cloud/visionai/v1/live_video_analytics_client.h @@ -0,0 +1,2142 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_LIVE_VIDEO_ANALYTICS_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_LIVE_VIDEO_ANALYTICS_CLIENT_H + +#include "google/cloud/visionai/v1/live_video_analytics_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 "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// Service describing handlers for resources. The service enables clients to +/// run Live Video Analytics (LVA) on the streaming inputs. +/// +/// @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 LiveVideoAnalyticsClient { + public: + explicit LiveVideoAnalyticsClient( + std::shared_ptr connection, + Options opts = {}); + ~LiveVideoAnalyticsClient(); + + ///@{ + /// @name Copy and move support + LiveVideoAnalyticsClient(LiveVideoAnalyticsClient const&) = default; + LiveVideoAnalyticsClient& operator=(LiveVideoAnalyticsClient const&) = + default; + LiveVideoAnalyticsClient(LiveVideoAnalyticsClient&&) = default; + LiveVideoAnalyticsClient& operator=(LiveVideoAnalyticsClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(LiveVideoAnalyticsClient const& a, + LiveVideoAnalyticsClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(LiveVideoAnalyticsClient const& a, + LiveVideoAnalyticsClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// ListPublicOperators returns all the operators in public registry. + /// + /// @param parent Required. Parent value for ListPublicOperatorsRequest. + /// @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.visionai.v1.Operator], 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.visionai.v1.ListPublicOperatorsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L736} + /// [google.cloud.visionai.v1.Operator]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L33} + /// + // clang-format on + StreamRange ListPublicOperators( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// ListPublicOperators returns all the operators in public registry. + /// + /// @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.visionai.v1.ListPublicOperatorsRequest]. + /// 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.visionai.v1.Operator], 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.visionai.v1.ListPublicOperatorsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L736} + /// [google.cloud.visionai.v1.Operator]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L33} + /// + // clang-format on + StreamRange ListPublicOperators( + google::cloud::visionai::v1::ListPublicOperatorsRequest request, + Options opts = {}); + + // clang-format off + /// + /// ResolveOperatorInfo returns the operator information based on the request. + /// + /// @param parent Required. Parent value for ResolveOperatorInfoRequest. + /// @param queries Required. The operator queries. + /// @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.visionai.v1.ResolveOperatorInfoResponse]) + /// 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.visionai.v1.ResolveOperatorInfoRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L704} + /// [google.cloud.visionai.v1.ResolveOperatorInfoResponse]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L730} + /// + // clang-format on + StatusOr + ResolveOperatorInfo( + std::string const& parent, + std::vector const& queries, + Options opts = {}); + + // clang-format off + /// + /// ResolveOperatorInfo returns the operator information based on the request. + /// + /// @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.visionai.v1.ResolveOperatorInfoRequest]. + /// 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.visionai.v1.ResolveOperatorInfoResponse]) + /// 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.visionai.v1.ResolveOperatorInfoRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L704} + /// [google.cloud.visionai.v1.ResolveOperatorInfoResponse]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L730} + /// + // clang-format on + StatusOr + ResolveOperatorInfo( + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists Operators in a given project and location. + /// + /// @param parent Required. Parent value for ListOperatorsRequest. + /// @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.visionai.v1.Operator], 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.visionai.v1.ListOperatorsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L263} + /// [google.cloud.visionai.v1.Operator]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L33} + /// + // clang-format on + StreamRange ListOperators( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Operators 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.visionai.v1.ListOperatorsRequest]. + /// 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.visionai.v1.Operator], 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.visionai.v1.ListOperatorsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L263} + /// [google.cloud.visionai.v1.Operator]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L33} + /// + // clang-format on + StreamRange ListOperators( + google::cloud::visionai::v1::ListOperatorsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Operator. + /// + /// @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.visionai.v1.Operator]) + /// 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.visionai.v1.GetOperatorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L299} + /// [google.cloud.visionai.v1.Operator]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L33} + /// + // clang-format on + StatusOr GetOperator( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Operator. + /// + /// @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.visionai.v1.GetOperatorRequest]. + /// 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.visionai.v1.Operator]) + /// 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.visionai.v1.GetOperatorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L299} + /// [google.cloud.visionai.v1.Operator]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L33} + /// + // clang-format on + StatusOr GetOperator( + google::cloud::visionai::v1::GetOperatorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Operator in a given project and location. + /// + /// @param parent Required. Value for parent. + /// @param operator_ Required. The resource being created. + /// @param operator_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.visionai.v1.Operator] 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.visionai.v1.CreateOperatorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L310} + /// [google.cloud.visionai.v1.Operator]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L33} + /// + // clang-format on + future> CreateOperator( + std::string const& parent, + google::cloud::visionai::v1::Operator const& operator_, + std::string const& operator_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateOperator + /// + /// 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 CreateOperator( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Operator const& operator_, + std::string const& operator_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Operator 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.visionai.v1.CreateOperatorRequest]. + /// 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.visionai.v1.Operator] 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.visionai.v1.CreateOperatorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L310} + /// [google.cloud.visionai.v1.Operator]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L33} + /// + // clang-format on + future> CreateOperator( + google::cloud::visionai::v1::CreateOperatorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateOperator + /// + /// 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 CreateOperator( + NoAwaitTag, + google::cloud::visionai::v1::CreateOperatorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateOperator + /// + /// 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> CreateOperator( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Operator. + /// + /// @param operator_ Required. The resource being updated + /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// Operator 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.visionai.v1.Operator] 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.visionai.v1.Operator]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L33} + /// [google.cloud.visionai.v1.UpdateOperatorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L342} + /// + // clang-format on + future> UpdateOperator( + google::cloud::visionai::v1::Operator const& operator_, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateOperator + /// + /// 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 UpdateOperator( + NoAwaitTag, google::cloud::visionai::v1::Operator const& operator_, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Operator. + /// + /// @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.visionai.v1.UpdateOperatorRequest]. + /// 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.visionai.v1.Operator] 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.visionai.v1.Operator]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L33} + /// [google.cloud.visionai.v1.UpdateOperatorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L342} + /// + // clang-format on + future> UpdateOperator( + google::cloud::visionai::v1::UpdateOperatorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateOperator + /// + /// 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 UpdateOperator( + NoAwaitTag, + google::cloud::visionai::v1::UpdateOperatorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateOperator + /// + /// 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> UpdateOperator( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Operator. + /// + /// @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.visionai.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.visionai.v1.DeleteOperatorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L371} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> + DeleteOperator(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteOperator + /// + /// 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 DeleteOperator( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Operator. + /// + /// @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.visionai.v1.DeleteOperatorRequest]. + /// 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.visionai.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.visionai.v1.DeleteOperatorRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L371} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> + DeleteOperator( + google::cloud::visionai::v1::DeleteOperatorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteOperator + /// + /// 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 DeleteOperator( + NoAwaitTag, + google::cloud::visionai::v1::DeleteOperatorRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteOperator + /// + /// 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> + DeleteOperator(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists Analyses in a given project and location. + /// + /// @param parent Required. Parent value for ListAnalysesRequest + /// @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.visionai.v1.Analysis], 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.visionai.v1.Analysis]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L61} + /// [google.cloud.visionai.v1.ListAnalysesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L397} + /// + // clang-format on + StreamRange ListAnalyses( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Analyses 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.visionai.v1.ListAnalysesRequest]. + /// 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.visionai.v1.Analysis], 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.visionai.v1.Analysis]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L61} + /// [google.cloud.visionai.v1.ListAnalysesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L397} + /// + // clang-format on + StreamRange ListAnalyses( + google::cloud::visionai::v1::ListAnalysesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Analysis. + /// + /// @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.visionai.v1.Analysis]) + /// 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.visionai.v1.Analysis]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L61} + /// [google.cloud.visionai.v1.GetAnalysisRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L433} + /// + // clang-format on + StatusOr GetAnalysis( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Analysis. + /// + /// @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.visionai.v1.GetAnalysisRequest]. + /// 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.visionai.v1.Analysis]) + /// 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.visionai.v1.Analysis]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L61} + /// [google.cloud.visionai.v1.GetAnalysisRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L433} + /// + // clang-format on + StatusOr GetAnalysis( + google::cloud::visionai::v1::GetAnalysisRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Analysis in a given project and location. + /// + /// @param parent Required. Value for parent. + /// @param analysis Required. The resource being created. + /// @param analysis_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.visionai.v1.Analysis] 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.visionai.v1.Analysis]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L61} + /// [google.cloud.visionai.v1.CreateAnalysisRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L444} + /// + // clang-format on + future> CreateAnalysis( + std::string const& parent, + google::cloud::visionai::v1::Analysis const& analysis, + std::string const& analysis_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateAnalysis + /// + /// 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 CreateAnalysis( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Analysis const& analysis, + std::string const& analysis_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Analysis 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.visionai.v1.CreateAnalysisRequest]. + /// 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.visionai.v1.Analysis] 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.visionai.v1.Analysis]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L61} + /// [google.cloud.visionai.v1.CreateAnalysisRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L444} + /// + // clang-format on + future> CreateAnalysis( + google::cloud::visionai::v1::CreateAnalysisRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateAnalysis + /// + /// 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 CreateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::CreateAnalysisRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateAnalysis + /// + /// 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> CreateAnalysis( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Analysis. + /// + /// @param analysis Required. The resource being updated. + /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// Analysis 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.visionai.v1.Analysis] 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.visionai.v1.Analysis]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L61} + /// [google.cloud.visionai.v1.UpdateAnalysisRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L476} + /// + // clang-format on + future> UpdateAnalysis( + google::cloud::visionai::v1::Analysis const& analysis, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateAnalysis + /// + /// 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 UpdateAnalysis( + NoAwaitTag, google::cloud::visionai::v1::Analysis const& analysis, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Analysis. + /// + /// @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.visionai.v1.UpdateAnalysisRequest]. + /// 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.visionai.v1.Analysis] 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.visionai.v1.Analysis]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L61} + /// [google.cloud.visionai.v1.UpdateAnalysisRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L476} + /// + // clang-format on + future> UpdateAnalysis( + google::cloud::visionai::v1::UpdateAnalysisRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateAnalysis + /// + /// 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 UpdateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateAnalysis + /// + /// 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> UpdateAnalysis( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Analysis. + /// + /// @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.visionai.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.visionai.v1.DeleteAnalysisRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L505} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> + DeleteAnalysis(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteAnalysis + /// + /// 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 DeleteAnalysis( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Analysis. + /// + /// @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.visionai.v1.DeleteAnalysisRequest]. + /// 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.visionai.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.visionai.v1.DeleteAnalysisRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L505} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> + DeleteAnalysis( + google::cloud::visionai::v1::DeleteAnalysisRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteAnalysis + /// + /// 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 DeleteAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteAnalysis + /// + /// 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> + DeleteAnalysis(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists Processes in a given project and location. + /// + /// @param parent Required. Parent value for ListProcessesRequest. + /// @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.visionai.v1.Process], 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.visionai.v1.ListProcessesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L531} + /// [google.cloud.visionai.v1.Process]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L104} + /// + // clang-format on + StreamRange ListProcesses( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Processes 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.visionai.v1.ListProcessesRequest]. + /// 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.visionai.v1.Process], 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.visionai.v1.ListProcessesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L531} + /// [google.cloud.visionai.v1.Process]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L104} + /// + // clang-format on + StreamRange ListProcesses( + google::cloud::visionai::v1::ListProcessesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Process. + /// + /// @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.visionai.v1.Process]) + /// 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.visionai.v1.GetProcessRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L567} + /// [google.cloud.visionai.v1.Process]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L104} + /// + // clang-format on + StatusOr GetProcess( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Process. + /// + /// @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.visionai.v1.GetProcessRequest]. + /// 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.visionai.v1.Process]) + /// 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.visionai.v1.GetProcessRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L567} + /// [google.cloud.visionai.v1.Process]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L104} + /// + // clang-format on + StatusOr GetProcess( + google::cloud::visionai::v1::GetProcessRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Process in a given project and location. + /// + /// @param parent Required. Value for parent. + /// @param process Required. The resource being created. + /// @param process_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.visionai.v1.Process] 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.visionai.v1.CreateProcessRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L578} + /// [google.cloud.visionai.v1.Process]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L104} + /// + // clang-format on + future> CreateProcess( + std::string const& parent, + google::cloud::visionai::v1::Process const& process, + std::string const& process_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateProcess + /// + /// 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 CreateProcess( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Process const& process, + std::string const& process_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Process 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.visionai.v1.CreateProcessRequest]. + /// 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.visionai.v1.Process] 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.visionai.v1.CreateProcessRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L578} + /// [google.cloud.visionai.v1.Process]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L104} + /// + // clang-format on + future> CreateProcess( + google::cloud::visionai::v1::CreateProcessRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateProcess + /// + /// 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 CreateProcess( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateProcess + /// + /// 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> CreateProcess( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Process. + /// + /// @param process Required. The resource being updated. + /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// Process 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.visionai.v1.Process] 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.visionai.v1.Process]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L104} + /// [google.cloud.visionai.v1.UpdateProcessRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L610} + /// + // clang-format on + future> UpdateProcess( + google::cloud::visionai::v1::Process const& process, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateProcess + /// + /// 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 UpdateProcess( + NoAwaitTag, google::cloud::visionai::v1::Process const& process, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Process. + /// + /// @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.visionai.v1.UpdateProcessRequest]. + /// 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.visionai.v1.Process] 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.visionai.v1.Process]: @googleapis_reference_link{google/cloud/visionai/v1/lva_resources.proto#L104} + /// [google.cloud.visionai.v1.UpdateProcessRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L610} + /// + // clang-format on + future> UpdateProcess( + google::cloud::visionai::v1::UpdateProcessRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateProcess + /// + /// 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 UpdateProcess( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateProcess + /// + /// 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> UpdateProcess( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Process. + /// + /// @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.visionai.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.visionai.v1.DeleteProcessRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L639} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> + DeleteProcess(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteProcess + /// + /// 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 DeleteProcess( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Process. + /// + /// @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.visionai.v1.DeleteProcessRequest]. + /// 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.visionai.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.visionai.v1.DeleteProcessRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L639} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> + DeleteProcess( + google::cloud::visionai::v1::DeleteProcessRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteProcess + /// + /// 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 DeleteProcess( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteProcess + /// + /// 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> + DeleteProcess(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Run all of the processes to "completion". Max time for each process is + /// the LRO time limit. + /// + /// @param parent Required. The parent resource shared by all processes being created. + /// @param requests Required. The create process requests. + /// @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.visionai.v1.BatchRunProcessResponse] 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.visionai.v1.BatchRunProcessRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L665} + /// [google.cloud.visionai.v1.BatchRunProcessResponse]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L695} + /// + // clang-format on + future> + BatchRunProcess( + std::string const& parent, + std::vector const& + requests, + Options opts = {}); + + // clang-format off + /// + /// @copybrief BatchRunProcess + /// + /// 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 BatchRunProcess( + NoAwaitTag, std::string const& parent, + std::vector const& + requests, + Options opts = {}); + + // clang-format off + /// + /// Run all of the processes to "completion". Max time for each process is + /// the LRO time limit. + /// + /// @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.visionai.v1.BatchRunProcessRequest]. + /// 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.visionai.v1.BatchRunProcessResponse] 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.visionai.v1.BatchRunProcessRequest]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L665} + /// [google.cloud.visionai.v1.BatchRunProcessResponse]: @googleapis_reference_link{google/cloud/visionai/v1/lva_service.proto#L695} + /// + // clang-format on + future> + BatchRunProcess( + google::cloud::visionai::v1::BatchRunProcessRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief BatchRunProcess + /// + /// 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 BatchRunProcess( + NoAwaitTag, + google::cloud::visionai::v1::BatchRunProcessRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief BatchRunProcess + /// + /// 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> + BatchRunProcess(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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_LIVE_VIDEO_ANALYTICS_CLIENT_H diff --git a/google/cloud/visionai/v1/live_video_analytics_connection.cc b/google/cloud/visionai/v1/live_video_analytics_connection.cc new file mode 100644 index 0000000000000..468cb0ad78c35 --- /dev/null +++ b/google/cloud/visionai/v1/live_video_analytics_connection.cc @@ -0,0 +1,385 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#include "google/cloud/visionai/v1/live_video_analytics_connection.h" +#include "google/cloud/visionai/v1/internal/live_video_analytics_connection_impl.h" +#include "google/cloud/visionai/v1/internal/live_video_analytics_option_defaults.h" +#include "google/cloud/visionai/v1/internal/live_video_analytics_stub_factory.h" +#include "google/cloud/visionai/v1/internal/live_video_analytics_tracing_connection.h" +#include "google/cloud/visionai/v1/live_video_analytics_options.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 visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +LiveVideoAnalyticsConnection::~LiveVideoAnalyticsConnection() = default; + +StreamRange +LiveVideoAnalyticsConnection::ListPublicOperators( + google::cloud::visionai::v1:: + ListPublicOperatorsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +LiveVideoAnalyticsConnection::ResolveOperatorInfo( + google::cloud::visionai::v1::ResolveOperatorInfoRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +LiveVideoAnalyticsConnection::ListOperators( + google::cloud::visionai::v1:: + ListOperatorsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +LiveVideoAnalyticsConnection::GetOperator( + google::cloud::visionai::v1::GetOperatorRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +LiveVideoAnalyticsConnection::CreateOperator( + google::cloud::visionai::v1::CreateOperatorRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +LiveVideoAnalyticsConnection::CreateOperator( + NoAwaitTag, google::cloud::visionai::v1::CreateOperatorRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::CreateOperator( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::UpdateOperator( + google::cloud::visionai::v1::UpdateOperatorRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +LiveVideoAnalyticsConnection::UpdateOperator( + NoAwaitTag, google::cloud::visionai::v1::UpdateOperatorRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::UpdateOperator( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::DeleteOperator( + google::cloud::visionai::v1::DeleteOperatorRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +LiveVideoAnalyticsConnection::DeleteOperator( + NoAwaitTag, google::cloud::visionai::v1::DeleteOperatorRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::DeleteOperator( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +LiveVideoAnalyticsConnection::ListAnalyses( + google::cloud::visionai::v1:: + ListAnalysesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +LiveVideoAnalyticsConnection::GetAnalysis( + google::cloud::visionai::v1::GetAnalysisRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +LiveVideoAnalyticsConnection::CreateAnalysis( + google::cloud::visionai::v1::CreateAnalysisRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +LiveVideoAnalyticsConnection::CreateAnalysis( + NoAwaitTag, google::cloud::visionai::v1::CreateAnalysisRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::CreateAnalysis( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::UpdateAnalysis( + google::cloud::visionai::v1::UpdateAnalysisRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +LiveVideoAnalyticsConnection::UpdateAnalysis( + NoAwaitTag, google::cloud::visionai::v1::UpdateAnalysisRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::UpdateAnalysis( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::DeleteAnalysis( + google::cloud::visionai::v1::DeleteAnalysisRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +LiveVideoAnalyticsConnection::DeleteAnalysis( + NoAwaitTag, google::cloud::visionai::v1::DeleteAnalysisRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::DeleteAnalysis( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +LiveVideoAnalyticsConnection::ListProcesses( + google::cloud::visionai::v1:: + ListProcessesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +LiveVideoAnalyticsConnection::GetProcess( + google::cloud::visionai::v1::GetProcessRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +LiveVideoAnalyticsConnection::CreateProcess( + google::cloud::visionai::v1::CreateProcessRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +LiveVideoAnalyticsConnection::CreateProcess( + NoAwaitTag, google::cloud::visionai::v1::CreateProcessRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::CreateProcess( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::UpdateProcess( + google::cloud::visionai::v1::UpdateProcessRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +LiveVideoAnalyticsConnection::UpdateProcess( + NoAwaitTag, google::cloud::visionai::v1::UpdateProcessRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::UpdateProcess( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::DeleteProcess( + google::cloud::visionai::v1::DeleteProcessRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +LiveVideoAnalyticsConnection::DeleteProcess( + NoAwaitTag, google::cloud::visionai::v1::DeleteProcessRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::DeleteProcess( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::BatchRunProcess( + google::cloud::visionai::v1::BatchRunProcessRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +LiveVideoAnalyticsConnection::BatchRunProcess( + NoAwaitTag, google::cloud::visionai::v1::BatchRunProcessRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +LiveVideoAnalyticsConnection::BatchRunProcess( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +LiveVideoAnalyticsConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +LiveVideoAnalyticsConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +LiveVideoAnalyticsConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +LiveVideoAnalyticsConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status LiveVideoAnalyticsConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status LiveVideoAnalyticsConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeLiveVideoAnalyticsConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = visionai_v1_internal::LiveVideoAnalyticsDefaultOptions( + std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = visionai_v1_internal::CreateDefaultLiveVideoAnalyticsStub( + std::move(auth), options); + return visionai_v1_internal::MakeLiveVideoAnalyticsTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/live_video_analytics_connection.h b/google/cloud/visionai/v1/live_video_analytics_connection.h new file mode 100644 index 0000000000000..913338aaeac82 --- /dev/null +++ b/google/cloud/visionai/v1/live_video_analytics_connection.h @@ -0,0 +1,376 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_LIVE_VIDEO_ANALYTICS_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_LIVE_VIDEO_ANALYTICS_CONNECTION_H + +#include "google/cloud/visionai/v1/internal/live_video_analytics_retry_traits.h" +#include "google/cloud/visionai/v1/live_video_analytics_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/lva_service.pb.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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `LiveVideoAnalyticsConnection`. +class LiveVideoAnalyticsRetryPolicy : 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 `LiveVideoAnalyticsConnection` 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 LiveVideoAnalyticsLimitedErrorCountRetryPolicy + : public LiveVideoAnalyticsRetryPolicy { + 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 LiveVideoAnalyticsLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + LiveVideoAnalyticsLimitedErrorCountRetryPolicy( + LiveVideoAnalyticsLimitedErrorCountRetryPolicy&& rhs) noexcept + : LiveVideoAnalyticsLimitedErrorCountRetryPolicy(rhs.maximum_failures()) { + } + LiveVideoAnalyticsLimitedErrorCountRetryPolicy( + LiveVideoAnalyticsLimitedErrorCountRetryPolicy const& rhs) noexcept + : LiveVideoAnalyticsLimitedErrorCountRetryPolicy(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 = LiveVideoAnalyticsRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + visionai_v1_internal::LiveVideoAnalyticsRetryTraits> + impl_; +}; + +/** + * A retry policy for `LiveVideoAnalyticsConnection` 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 LiveVideoAnalyticsLimitedTimeRetryPolicy + : public LiveVideoAnalyticsRetryPolicy { + 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 LiveVideoAnalyticsLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + LiveVideoAnalyticsLimitedTimeRetryPolicy( + LiveVideoAnalyticsLimitedTimeRetryPolicy&& rhs) noexcept + : LiveVideoAnalyticsLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + LiveVideoAnalyticsLimitedTimeRetryPolicy( + LiveVideoAnalyticsLimitedTimeRetryPolicy const& rhs) noexcept + : LiveVideoAnalyticsLimitedTimeRetryPolicy(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 = LiveVideoAnalyticsRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + visionai_v1_internal::LiveVideoAnalyticsRetryTraits> + impl_; +}; + +/** + * The `LiveVideoAnalyticsConnection` object for `LiveVideoAnalyticsClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `LiveVideoAnalyticsClient`. This allows users to inject custom + * behavior (e.g., with a Google Mock object) when writing tests that use + * objects of type `LiveVideoAnalyticsClient`. + * + * To create a concrete instance, see `MakeLiveVideoAnalyticsConnection()`. + * + * For mocking, see `visionai_v1_mocks::MockLiveVideoAnalyticsConnection`. + */ +class LiveVideoAnalyticsConnection { + public: + virtual ~LiveVideoAnalyticsConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StreamRange + ListPublicOperators( + google::cloud::visionai::v1::ListPublicOperatorsRequest request); + + virtual StatusOr + ResolveOperatorInfo( + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request); + + virtual StreamRange ListOperators( + google::cloud::visionai::v1::ListOperatorsRequest request); + + virtual StatusOr GetOperator( + google::cloud::visionai::v1::GetOperatorRequest const& request); + + virtual future> + CreateOperator( + google::cloud::visionai::v1::CreateOperatorRequest const& request); + + virtual StatusOr CreateOperator( + NoAwaitTag, + google::cloud::visionai::v1::CreateOperatorRequest const& request); + + virtual future> + CreateOperator(google::longrunning::Operation const& operation); + + virtual future> + UpdateOperator( + google::cloud::visionai::v1::UpdateOperatorRequest const& request); + + virtual StatusOr UpdateOperator( + NoAwaitTag, + google::cloud::visionai::v1::UpdateOperatorRequest const& request); + + virtual future> + UpdateOperator(google::longrunning::Operation const& operation); + + virtual future> + DeleteOperator( + google::cloud::visionai::v1::DeleteOperatorRequest const& request); + + virtual StatusOr DeleteOperator( + NoAwaitTag, + google::cloud::visionai::v1::DeleteOperatorRequest const& request); + + virtual future> + DeleteOperator(google::longrunning::Operation const& operation); + + virtual StreamRange ListAnalyses( + google::cloud::visionai::v1::ListAnalysesRequest request); + + virtual StatusOr GetAnalysis( + google::cloud::visionai::v1::GetAnalysisRequest const& request); + + virtual future> + CreateAnalysis( + google::cloud::visionai::v1::CreateAnalysisRequest const& request); + + virtual StatusOr CreateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::CreateAnalysisRequest const& request); + + virtual future> + CreateAnalysis(google::longrunning::Operation const& operation); + + virtual future> + UpdateAnalysis( + google::cloud::visionai::v1::UpdateAnalysisRequest const& request); + + virtual StatusOr UpdateAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request); + + virtual future> + UpdateAnalysis(google::longrunning::Operation const& operation); + + virtual future> + DeleteAnalysis( + google::cloud::visionai::v1::DeleteAnalysisRequest const& request); + + virtual StatusOr DeleteAnalysis( + NoAwaitTag, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request); + + virtual future> + DeleteAnalysis(google::longrunning::Operation const& operation); + + virtual StreamRange ListProcesses( + google::cloud::visionai::v1::ListProcessesRequest request); + + virtual StatusOr GetProcess( + google::cloud::visionai::v1::GetProcessRequest const& request); + + virtual future> CreateProcess( + google::cloud::visionai::v1::CreateProcessRequest const& request); + + virtual StatusOr CreateProcess( + NoAwaitTag, + google::cloud::visionai::v1::CreateProcessRequest const& request); + + virtual future> CreateProcess( + google::longrunning::Operation const& operation); + + virtual future> UpdateProcess( + google::cloud::visionai::v1::UpdateProcessRequest const& request); + + virtual StatusOr UpdateProcess( + NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessRequest const& request); + + virtual future> UpdateProcess( + google::longrunning::Operation const& operation); + + virtual future> + DeleteProcess( + google::cloud::visionai::v1::DeleteProcessRequest const& request); + + virtual StatusOr DeleteProcess( + NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessRequest const& request); + + virtual future> + DeleteProcess(google::longrunning::Operation const& operation); + + virtual future> + BatchRunProcess( + google::cloud::visionai::v1::BatchRunProcessRequest const& request); + + virtual StatusOr BatchRunProcess( + NoAwaitTag, + google::cloud::visionai::v1::BatchRunProcessRequest const& request); + + virtual future> + BatchRunProcess(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 + * `LiveVideoAnalyticsConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of + * LiveVideoAnalyticsClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `LiveVideoAnalyticsConnection`. Expected options are any of the + * types in the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::visionai_v1::LiveVideoAnalyticsPolicyOptionList` + * + * @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 `LiveVideoAnalyticsConnection` + * created by this function. + */ +std::shared_ptr MakeLiveVideoAnalyticsConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_LIVE_VIDEO_ANALYTICS_CONNECTION_H diff --git a/google/cloud/visionai/v1/live_video_analytics_connection_idempotency_policy.cc b/google/cloud/visionai/v1/live_video_analytics_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..0c556308ff7a5 --- /dev/null +++ b/google/cloud/visionai/v1/live_video_analytics_connection_idempotency_policy.cc @@ -0,0 +1,165 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#include "google/cloud/visionai/v1/live_video_analytics_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +LiveVideoAnalyticsConnectionIdempotencyPolicy:: + ~LiveVideoAnalyticsConnectionIdempotencyPolicy() = default; + +std::unique_ptr +LiveVideoAnalyticsConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::ListPublicOperators( + google::cloud::visionai::v1::ListPublicOperatorsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::ResolveOperatorInfo( + google::cloud::visionai::v1::ResolveOperatorInfoRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::ListOperators( + google::cloud::visionai::v1::ListOperatorsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::GetOperator( + google::cloud::visionai::v1::GetOperatorRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::CreateOperator( + google::cloud::visionai::v1::CreateOperatorRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::UpdateOperator( + google::cloud::visionai::v1::UpdateOperatorRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::DeleteOperator( + google::cloud::visionai::v1::DeleteOperatorRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::ListAnalyses( + google::cloud::visionai::v1::ListAnalysesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::GetAnalysis( + google::cloud::visionai::v1::GetAnalysisRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::CreateAnalysis( + google::cloud::visionai::v1::CreateAnalysisRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::UpdateAnalysis( + google::cloud::visionai::v1::UpdateAnalysisRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::DeleteAnalysis( + google::cloud::visionai::v1::DeleteAnalysisRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::ListProcesses( + google::cloud::visionai::v1::ListProcessesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::GetProcess( + google::cloud::visionai::v1::GetProcessRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::CreateProcess( + google::cloud::visionai::v1::CreateProcessRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::UpdateProcess( + google::cloud::visionai::v1::UpdateProcessRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::DeleteProcess( + google::cloud::visionai::v1::DeleteProcessRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::BatchRunProcess( + google::cloud::visionai::v1::BatchRunProcessRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency LiveVideoAnalyticsConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultLiveVideoAnalyticsConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/live_video_analytics_connection_idempotency_policy.h b/google/cloud/visionai/v1/live_video_analytics_connection_idempotency_policy.h new file mode 100644 index 0000000000000..a9f4e5bca7290 --- /dev/null +++ b/google/cloud/visionai/v1/live_video_analytics_connection_idempotency_policy.h @@ -0,0 +1,123 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_LIVE_VIDEO_ANALYTICS_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_LIVE_VIDEO_ANALYTICS_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/lva_service.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class LiveVideoAnalyticsConnectionIdempotencyPolicy { + public: + virtual ~LiveVideoAnalyticsConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() + const; + + virtual google::cloud::Idempotency ListPublicOperators( + google::cloud::visionai::v1::ListPublicOperatorsRequest request); + + virtual google::cloud::Idempotency ResolveOperatorInfo( + google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request); + + virtual google::cloud::Idempotency ListOperators( + google::cloud::visionai::v1::ListOperatorsRequest request); + + virtual google::cloud::Idempotency GetOperator( + google::cloud::visionai::v1::GetOperatorRequest const& request); + + virtual google::cloud::Idempotency CreateOperator( + google::cloud::visionai::v1::CreateOperatorRequest const& request); + + virtual google::cloud::Idempotency UpdateOperator( + google::cloud::visionai::v1::UpdateOperatorRequest const& request); + + virtual google::cloud::Idempotency DeleteOperator( + google::cloud::visionai::v1::DeleteOperatorRequest const& request); + + virtual google::cloud::Idempotency ListAnalyses( + google::cloud::visionai::v1::ListAnalysesRequest request); + + virtual google::cloud::Idempotency GetAnalysis( + google::cloud::visionai::v1::GetAnalysisRequest const& request); + + virtual google::cloud::Idempotency CreateAnalysis( + google::cloud::visionai::v1::CreateAnalysisRequest const& request); + + virtual google::cloud::Idempotency UpdateAnalysis( + google::cloud::visionai::v1::UpdateAnalysisRequest const& request); + + virtual google::cloud::Idempotency DeleteAnalysis( + google::cloud::visionai::v1::DeleteAnalysisRequest const& request); + + virtual google::cloud::Idempotency ListProcesses( + google::cloud::visionai::v1::ListProcessesRequest request); + + virtual google::cloud::Idempotency GetProcess( + google::cloud::visionai::v1::GetProcessRequest const& request); + + virtual google::cloud::Idempotency CreateProcess( + google::cloud::visionai::v1::CreateProcessRequest const& request); + + virtual google::cloud::Idempotency UpdateProcess( + google::cloud::visionai::v1::UpdateProcessRequest const& request); + + virtual google::cloud::Idempotency DeleteProcess( + google::cloud::visionai::v1::DeleteProcessRequest const& request); + + virtual google::cloud::Idempotency BatchRunProcess( + google::cloud::visionai::v1::BatchRunProcessRequest 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 +MakeDefaultLiveVideoAnalyticsConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_LIVE_VIDEO_ANALYTICS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/visionai/v1/live_video_analytics_options.h b/google/cloud/visionai/v1/live_video_analytics_options.h new file mode 100644 index 0000000000000..d642e6e4171a9 --- /dev/null +++ b/google/cloud/visionai/v1/live_video_analytics_options.h @@ -0,0 +1,87 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_LIVE_VIDEO_ANALYTICS_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_LIVE_VIDEO_ANALYTICS_OPTIONS_H + +#include "google/cloud/visionai/v1/live_video_analytics_connection.h" +#include "google/cloud/visionai/v1/live_video_analytics_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 visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-visionai-options + */ +struct LiveVideoAnalyticsRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-visionai-options + */ +struct LiveVideoAnalyticsBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-visionai-options + */ +struct LiveVideoAnalyticsConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-visionai-options + */ +struct LiveVideoAnalyticsPollingPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to LiveVideoAnalytics. + * + * @ingroup google-cloud-visionai-options + */ +using LiveVideoAnalyticsPolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_LIVE_VIDEO_ANALYTICS_OPTIONS_H diff --git a/google/cloud/visionai/v1/mocks/mock_app_platform_connection.h b/google/cloud/visionai/v1/mocks/mock_app_platform_connection.h new file mode 100644 index 0000000000000..a1ed5136df2ab --- /dev/null +++ b/google/cloud/visionai/v1/mocks/mock_app_platform_connection.h @@ -0,0 +1,809 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_APP_PLATFORM_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_APP_PLATFORM_CONNECTION_H + +#include "google/cloud/visionai/v1/app_platform_connection.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `AppPlatformConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `AppPlatformClient`. To do so, + * construct an object of type `AppPlatformClient` 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 MockAppPlatformConnection : public visionai_v1::AppPlatformConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD((StreamRange), + ListApplications, + (google::cloud::visionai::v1::ListApplicationsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, GetApplication, + (google::cloud::visionai::v1::GetApplicationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateApplication(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateApplication, + (google::cloud::visionai::v1::CreateApplicationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateApplication(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateApplication, + (NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateApplication(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateApplication, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateApplication(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateApplication, + (google::cloud::visionai::v1::UpdateApplicationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateApplication(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateApplication, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateApplication(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateApplication, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteApplication(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteApplication, + (google::cloud::visionai::v1::DeleteApplicationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteApplication(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteApplication, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteApplication(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteApplication, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeployApplication(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeployApplication, + (google::cloud::visionai::v1::DeployApplicationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeployApplication(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeployApplication, + (NoAwaitTag, + google::cloud::visionai::v1::DeployApplicationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeployApplication(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeployApplication, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UndeployApplication(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + UndeployApplication, + (google::cloud::visionai::v1::UndeployApplicationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UndeployApplication(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UndeployApplication, + (NoAwaitTag, + google::cloud::visionai::v1::UndeployApplicationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UndeployApplication(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + UndeployApplication, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// AddApplicationStreamInput(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + AddApplicationStreamInput, + (google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, AddApplicationStreamInput(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, AddApplicationStreamInput, + (NoAwaitTag, + google::cloud::visionai::v1::AddApplicationStreamInputRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// AddApplicationStreamInput(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + AddApplicationStreamInput, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// RemoveApplicationStreamInput(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + RemoveApplicationStreamInput, + (google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, RemoveApplicationStreamInput(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, RemoveApplicationStreamInput, + (NoAwaitTag, + google::cloud::visionai::v1::RemoveApplicationStreamInputRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// RemoveApplicationStreamInput(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + RemoveApplicationStreamInput, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateApplicationStreamInput(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateApplicationStreamInput, + (google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateApplicationStreamInput(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateApplicationStreamInput, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationStreamInputRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateApplicationStreamInput(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateApplicationStreamInput, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD((StreamRange), + ListInstances, + (google::cloud::visionai::v1::ListInstancesRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetInstance, + (google::cloud::visionai::v1::GetInstanceRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateApplicationInstances(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateApplicationInstances, + (google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateApplicationInstances(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateApplicationInstances, + (NoAwaitTag, + google::cloud::visionai::v1::CreateApplicationInstancesRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateApplicationInstances(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateApplicationInstances, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteApplicationInstances(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteApplicationInstances, + (google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteApplicationInstances(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteApplicationInstances, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteApplicationInstancesRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteApplicationInstances(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteApplicationInstances, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateApplicationInstances(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateApplicationInstances, + (google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateApplicationInstances(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateApplicationInstances, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateApplicationInstancesRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateApplicationInstances(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateApplicationInstances, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD((StreamRange), ListDrafts, + (google::cloud::visionai::v1::ListDraftsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetDraft, + (google::cloud::visionai::v1::GetDraftRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateDraft(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, CreateDraft, + (google::cloud::visionai::v1::CreateDraftRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateDraft(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, CreateDraft, + (NoAwaitTag, + google::cloud::visionai::v1::CreateDraftRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateDraft(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, CreateDraft, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateDraft(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, UpdateDraft, + (google::cloud::visionai::v1::UpdateDraftRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateDraft(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, UpdateDraft, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateDraftRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateDraft(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, UpdateDraft, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteDraft(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteDraft, + (google::cloud::visionai::v1::DeleteDraftRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteDraft(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteDraft, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteDraftRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteDraft(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteDraft, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), + ListProcessors, + (google::cloud::visionai::v1::ListProcessorsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, + ListPrebuiltProcessors, + (google::cloud::visionai::v1::ListPrebuiltProcessorsRequest const& + request), + (override)); + + MOCK_METHOD(StatusOr, GetProcessor, + (google::cloud::visionai::v1::GetProcessorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateProcessor(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, CreateProcessor, + (google::cloud::visionai::v1::CreateProcessorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateProcessor(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateProcessor, + (NoAwaitTag, + google::cloud::visionai::v1::CreateProcessorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateProcessor(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateProcessor, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateProcessor(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, UpdateProcessor, + (google::cloud::visionai::v1::UpdateProcessorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateProcessor(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateProcessor, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateProcessor(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateProcessor, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteProcessor(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteProcessor, + (google::cloud::visionai::v1::DeleteProcessorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteProcessor(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteProcessor, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteProcessor(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteProcessor, + (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 visionai_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_APP_PLATFORM_CONNECTION_H diff --git a/google/cloud/visionai/v1/mocks/mock_health_check_connection.h b/google/cloud/visionai/v1/mocks/mock_health_check_connection.h new file mode 100644 index 0000000000000..50ab15f04a39c --- /dev/null +++ b/google/cloud/visionai/v1/mocks/mock_health_check_connection.h @@ -0,0 +1,84 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_HEALTH_CHECK_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_HEALTH_CHECK_CONNECTION_H + +#include "google/cloud/visionai/v1/health_check_connection.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `HealthCheckServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `HealthCheckServiceClient`. To do + * so, construct an object of type `HealthCheckServiceClient` 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 MockHealthCheckServiceConnection + : public visionai_v1::HealthCheckServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD(StatusOr, + HealthCheck, + (google::cloud::visionai::v1::HealthCheckRequest const& request), + (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 visionai_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_HEALTH_CHECK_CONNECTION_H diff --git a/google/cloud/visionai/v1/mocks/mock_live_video_analytics_connection.h b/google/cloud/visionai/v1/mocks/mock_live_video_analytics_connection.h new file mode 100644 index 0000000000000..654de76575c31 --- /dev/null +++ b/google/cloud/visionai/v1/mocks/mock_live_video_analytics_connection.h @@ -0,0 +1,502 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_LIVE_VIDEO_ANALYTICS_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_LIVE_VIDEO_ANALYTICS_CONNECTION_H + +#include "google/cloud/visionai/v1/live_video_analytics_connection.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `LiveVideoAnalyticsConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `LiveVideoAnalyticsClient`. To do + * so, construct an object of type `LiveVideoAnalyticsClient` 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 MockLiveVideoAnalyticsConnection + : public visionai_v1::LiveVideoAnalyticsConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD((StreamRange), + ListPublicOperators, + (google::cloud::visionai::v1::ListPublicOperatorsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, + ResolveOperatorInfo, + (google::cloud::visionai::v1::ResolveOperatorInfoRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListOperators, + (google::cloud::visionai::v1::ListOperatorsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetOperator, + (google::cloud::visionai::v1::GetOperatorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateOperator(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, CreateOperator, + (google::cloud::visionai::v1::CreateOperatorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateOperator(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateOperator, + (NoAwaitTag, + google::cloud::visionai::v1::CreateOperatorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateOperator(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateOperator, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateOperator(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, UpdateOperator, + (google::cloud::visionai::v1::UpdateOperatorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateOperator(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateOperator, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateOperatorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateOperator(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateOperator, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteOperator(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteOperator, + (google::cloud::visionai::v1::DeleteOperatorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteOperator(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteOperator, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteOperatorRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteOperator(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteOperator, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), + ListAnalyses, + (google::cloud::visionai::v1::ListAnalysesRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetAnalysis, + (google::cloud::visionai::v1::GetAnalysisRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateAnalysis(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, CreateAnalysis, + (google::cloud::visionai::v1::CreateAnalysisRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateAnalysis(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateAnalysis, + (NoAwaitTag, + google::cloud::visionai::v1::CreateAnalysisRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateAnalysis(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateAnalysis, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateAnalysis(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, UpdateAnalysis, + (google::cloud::visionai::v1::UpdateAnalysisRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateAnalysis(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateAnalysis, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateAnalysisRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateAnalysis(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateAnalysis, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteAnalysis(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteAnalysis, + (google::cloud::visionai::v1::DeleteAnalysisRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteAnalysis(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteAnalysis, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteAnalysisRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteAnalysis(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteAnalysis, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), + ListProcesses, + (google::cloud::visionai::v1::ListProcessesRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetProcess, + (google::cloud::visionai::v1::GetProcessRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateProcess(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, CreateProcess, + (google::cloud::visionai::v1::CreateProcessRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateProcess(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateProcess, + (NoAwaitTag, + google::cloud::visionai::v1::CreateProcessRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateProcess(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateProcess, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateProcess(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, UpdateProcess, + (google::cloud::visionai::v1::UpdateProcessRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateProcess(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateProcess, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateProcessRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateProcess(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateProcess, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteProcess(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteProcess, + (google::cloud::visionai::v1::DeleteProcessRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteProcess(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteProcess, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteProcessRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteProcess(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteProcess, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// BatchRunProcess(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + BatchRunProcess, + (google::cloud::visionai::v1::BatchRunProcessRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, BatchRunProcess(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, BatchRunProcess, + (NoAwaitTag, + google::cloud::visionai::v1::BatchRunProcessRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, BatchRunProcess(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + BatchRunProcess, (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 visionai_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_LIVE_VIDEO_ANALYTICS_CONNECTION_H diff --git a/google/cloud/visionai/v1/mocks/mock_streaming_connection.h b/google/cloud/visionai/v1/mocks/mock_streaming_connection.h new file mode 100644 index 0000000000000..d1d4a51931e95 --- /dev/null +++ b/google/cloud/visionai/v1/mocks/mock_streaming_connection.h @@ -0,0 +1,107 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_STREAMING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_STREAMING_CONNECTION_H + +#include "google/cloud/visionai/v1/streaming_connection.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `StreamingServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `StreamingServiceClient`. To do so, + * construct an object of type `StreamingServiceClient` 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 MockStreamingServiceConnection + : public visionai_v1::StreamingServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD((std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>>), + AsyncSendPackets, (), (override)); + + MOCK_METHOD((std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>>), + AsyncReceivePackets, (), (override)); + + MOCK_METHOD((std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>>), + AsyncReceiveEvents, (), (override)); + + MOCK_METHOD(StatusOr, AcquireLease, + (google::cloud::visionai::v1::AcquireLeaseRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, RenewLease, + (google::cloud::visionai::v1::RenewLeaseRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, + ReleaseLease, + (google::cloud::visionai::v1::ReleaseLeaseRequest const& request), + (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 visionai_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_STREAMING_CONNECTION_H diff --git a/google/cloud/visionai/v1/mocks/mock_streams_connection.h b/google/cloud/visionai/v1/mocks/mock_streams_connection.h new file mode 100644 index 0000000000000..373f70ede5a0d --- /dev/null +++ b/google/cloud/visionai/v1/mocks/mock_streams_connection.h @@ -0,0 +1,641 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_STREAMS_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_STREAMS_CONNECTION_H + +#include "google/cloud/visionai/v1/streams_connection.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `StreamsServiceConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `StreamsServiceClient`. To do so, + * construct an object of type `StreamsServiceClient` 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 MockStreamsServiceConnection + : public visionai_v1::StreamsServiceConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD((StreamRange), ListClusters, + (google::cloud::visionai::v1::ListClustersRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetCluster, + (google::cloud::visionai::v1::GetClusterRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateCluster(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, CreateCluster, + (google::cloud::visionai::v1::CreateClusterRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateCluster(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateCluster, + (NoAwaitTag, + google::cloud::visionai::v1::CreateClusterRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateCluster(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateCluster, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateCluster(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, UpdateCluster, + (google::cloud::visionai::v1::UpdateClusterRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateCluster(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateCluster, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateClusterRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateCluster(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateCluster, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteCluster(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteCluster, + (google::cloud::visionai::v1::DeleteClusterRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteCluster(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteCluster, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteClusterRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteCluster(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteCluster, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), ListStreams, + (google::cloud::visionai::v1::ListStreamsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetStream, + (google::cloud::visionai::v1::GetStreamRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateStream(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateStream, + (google::cloud::visionai::v1::CreateStreamRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateStream(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, CreateStream, + (NoAwaitTag, + google::cloud::visionai::v1::CreateStreamRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateStream(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateStream, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateStream(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateStream, + (google::cloud::visionai::v1::UpdateStreamRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateStream(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, UpdateStream, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateStreamRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateStream(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateStream, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteStream(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteStream, + (google::cloud::visionai::v1::DeleteStreamRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteStream(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteStream, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteStreamRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteStream(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteStream, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// GetStreamThumbnail(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + GetStreamThumbnail, + (google::cloud::visionai::v1::GetStreamThumbnailRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, GetStreamThumbnail(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, GetStreamThumbnail, + (NoAwaitTag, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// GetStreamThumbnail(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + GetStreamThumbnail, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + StatusOr, + GenerateStreamHlsToken, + (google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& + request), + (override)); + + MOCK_METHOD((StreamRange), ListEvents, + (google::cloud::visionai::v1::ListEventsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetEvent, + (google::cloud::visionai::v1::GetEventRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateEvent(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, CreateEvent, + (google::cloud::visionai::v1::CreateEventRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateEvent(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, CreateEvent, + (NoAwaitTag, + google::cloud::visionai::v1::CreateEventRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateEvent(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, CreateEvent, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateEvent(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, UpdateEvent, + (google::cloud::visionai::v1::UpdateEventRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateEvent(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, UpdateEvent, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateEventRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateEvent(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, UpdateEvent, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteEvent(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteEvent, + (google::cloud::visionai::v1::DeleteEventRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteEvent(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteEvent, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteEventRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteEvent(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteEvent, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), ListSeries, + (google::cloud::visionai::v1::ListSeriesRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetSeries, + (google::cloud::visionai::v1::GetSeriesRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateSeries(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateSeries, + (google::cloud::visionai::v1::CreateSeriesRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateSeries(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, CreateSeries, + (NoAwaitTag, + google::cloud::visionai::v1::CreateSeriesRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateSeries(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateSeries, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateSeries(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateSeries, + (google::cloud::visionai::v1::UpdateSeriesRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateSeries(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, UpdateSeries, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateSeriesRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateSeries(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateSeries, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteSeries(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteSeries, + (google::cloud::visionai::v1::DeleteSeriesRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteSeries(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteSeries, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteSeriesRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteSeries(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + DeleteSeries, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// MaterializeChannel(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + MaterializeChannel, + (google::cloud::visionai::v1::MaterializeChannelRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, MaterializeChannel(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, MaterializeChannel, + (NoAwaitTag, + google::cloud::visionai::v1::MaterializeChannelRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// MaterializeChannel(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + MaterializeChannel, + (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 visionai_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_STREAMS_CONNECTION_H diff --git a/google/cloud/visionai/v1/mocks/mock_warehouse_connection.h b/google/cloud/visionai/v1/mocks/mock_warehouse_connection.h new file mode 100644 index 0000000000000..9ab70c23d1278 --- /dev/null +++ b/google/cloud/visionai/v1/mocks/mock_warehouse_connection.h @@ -0,0 +1,996 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_WAREHOUSE_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_WAREHOUSE_CONNECTION_H + +#include "google/cloud/visionai/v1/warehouse_connection.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `WarehouseConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `WarehouseClient`. To do so, + * construct an object of type `WarehouseClient` 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 MockWarehouseConnection : public visionai_v1::WarehouseConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD(StatusOr, CreateAsset, + (google::cloud::visionai::v1::CreateAssetRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, UpdateAsset, + (google::cloud::visionai::v1::UpdateAssetRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, GetAsset, + (google::cloud::visionai::v1::GetAssetRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), ListAssets, + (google::cloud::visionai::v1::ListAssetsRequest request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteAsset(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteAsset, + (google::cloud::visionai::v1::DeleteAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteAsset(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteAsset, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteAsset(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteAsset, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UploadAsset(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UploadAsset, + (google::cloud::visionai::v1::UploadAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UploadAsset(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, UploadAsset, + (NoAwaitTag, + google::cloud::visionai::v1::UploadAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UploadAsset(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UploadAsset, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + StatusOr, + GenerateRetrievalUrl, + (google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// AnalyzeAsset(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + AnalyzeAsset, + (google::cloud::visionai::v1::AnalyzeAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, AnalyzeAsset(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, AnalyzeAsset, + (NoAwaitTag, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, AnalyzeAsset(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + AnalyzeAsset, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// IndexAsset(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + IndexAsset, + (google::cloud::visionai::v1::IndexAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, IndexAsset(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, IndexAsset, + (NoAwaitTag, + google::cloud::visionai::v1::IndexAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, IndexAsset(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + IndexAsset, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// RemoveIndexAsset(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + RemoveIndexAsset, + (google::cloud::visionai::v1::RemoveIndexAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, RemoveIndexAsset(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, RemoveIndexAsset, + (NoAwaitTag, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, RemoveIndexAsset(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + RemoveIndexAsset, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), + ViewIndexedAssets, + (google::cloud::visionai::v1::ViewIndexedAssetsRequest request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateIndex(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, CreateIndex, + (google::cloud::visionai::v1::CreateIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateIndex(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, CreateIndex, + (NoAwaitTag, + google::cloud::visionai::v1::CreateIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateIndex(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, CreateIndex, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateIndex(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, UpdateIndex, + (google::cloud::visionai::v1::UpdateIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateIndex(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, UpdateIndex, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateIndex(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, UpdateIndex, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD(StatusOr, GetIndex, + (google::cloud::visionai::v1::GetIndexRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), ListIndexes, + (google::cloud::visionai::v1::ListIndexesRequest request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteIndex(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteIndex, + (google::cloud::visionai::v1::DeleteIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteIndex(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteIndex, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteIndex(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteIndex, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateCorpus(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateCorpus, + (google::cloud::visionai::v1::CreateCorpusRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateCorpus(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, CreateCorpus, + (NoAwaitTag, + google::cloud::visionai::v1::CreateCorpusRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateCorpus(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateCorpus, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD(StatusOr, GetCorpus, + (google::cloud::visionai::v1::GetCorpusRequest const& request), + (override)); + + MOCK_METHOD(StatusOr, UpdateCorpus, + (google::cloud::visionai::v1::UpdateCorpusRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), ListCorpora, + (google::cloud::visionai::v1::ListCorporaRequest request), + (override)); + + MOCK_METHOD(Status, DeleteCorpus, + (google::cloud::visionai::v1::DeleteCorpusRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// AnalyzeCorpus(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + AnalyzeCorpus, + (google::cloud::visionai::v1::AnalyzeCorpusRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, AnalyzeCorpus(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, AnalyzeCorpus, + (NoAwaitTag, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, AnalyzeCorpus(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + AnalyzeCorpus, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + StatusOr, CreateDataSchema, + (google::cloud::visionai::v1::CreateDataSchemaRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, UpdateDataSchema, + (google::cloud::visionai::v1::UpdateDataSchemaRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, GetDataSchema, + (google::cloud::visionai::v1::GetDataSchemaRequest const& request), + (override)); + + MOCK_METHOD( + Status, DeleteDataSchema, + (google::cloud::visionai::v1::DeleteDataSchemaRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListDataSchemas, + (google::cloud::visionai::v1::ListDataSchemasRequest request), + (override)); + + MOCK_METHOD( + StatusOr, CreateAnnotation, + (google::cloud::visionai::v1::CreateAnnotationRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, GetAnnotation, + (google::cloud::visionai::v1::GetAnnotationRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListAnnotations, + (google::cloud::visionai::v1::ListAnnotationsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, UpdateAnnotation, + (google::cloud::visionai::v1::UpdateAnnotationRequest const& request), + (override)); + + MOCK_METHOD( + Status, DeleteAnnotation, + (google::cloud::visionai::v1::DeleteAnnotationRequest const& request), + (override)); + + MOCK_METHOD((std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>>), + AsyncIngestAsset, (), (override)); + + MOCK_METHOD(StatusOr, + ClipAsset, + (google::cloud::visionai::v1::ClipAssetRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, + GenerateHlsUri, + (google::cloud::visionai::v1::GenerateHlsUriRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ImportAssets(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + ImportAssets, + (google::cloud::visionai::v1::ImportAssetsRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, ImportAssets(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, ImportAssets, + (NoAwaitTag, + google::cloud::visionai::v1::ImportAssetsRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, ImportAssets(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + ImportAssets, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + StatusOr, CreateSearchConfig, + (google::cloud::visionai::v1::CreateSearchConfigRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, UpdateSearchConfig, + (google::cloud::visionai::v1::UpdateSearchConfigRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, GetSearchConfig, + (google::cloud::visionai::v1::GetSearchConfigRequest const& request), + (override)); + + MOCK_METHOD( + Status, DeleteSearchConfig, + (google::cloud::visionai::v1::DeleteSearchConfigRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListSearchConfigs, + (google::cloud::visionai::v1::ListSearchConfigsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, + CreateSearchHypernym, + (google::cloud::visionai::v1::CreateSearchHypernymRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, + UpdateSearchHypernym, + (google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, GetSearchHypernym, + (google::cloud::visionai::v1::GetSearchHypernymRequest const& request), + (override)); + + MOCK_METHOD( + Status, DeleteSearchHypernym, + (google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListSearchHypernyms, + (google::cloud::visionai::v1::ListSearchHypernymsRequest request), + (override)); + + MOCK_METHOD((StreamRange), + SearchAssets, + (google::cloud::visionai::v1::SearchAssetsRequest request), + (override)); + + MOCK_METHOD((StreamRange), + SearchIndexEndpoint, + (google::cloud::visionai::v1::SearchIndexEndpointRequest request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateIndexEndpoint(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateIndexEndpoint, + (google::cloud::visionai::v1::CreateIndexEndpointRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateIndexEndpoint(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateIndexEndpoint, + (NoAwaitTag, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateIndexEndpoint(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateIndexEndpoint, + (google::longrunning::Operation const& operation), (override)); + + MOCK_METHOD( + StatusOr, GetIndexEndpoint, + (google::cloud::visionai::v1::GetIndexEndpointRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListIndexEndpoints, + (google::cloud::visionai::v1::ListIndexEndpointsRequest request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateIndexEndpoint(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateIndexEndpoint, + (google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateIndexEndpoint(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateIndexEndpoint, + (NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateIndexEndpoint(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateIndexEndpoint, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteIndexEndpoint(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + DeleteIndexEndpoint, + (google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteIndexEndpoint(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteIndexEndpoint, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteIndexEndpoint(Matcher(_))) + /// @endcode + MOCK_METHOD( + future< + StatusOr>, + DeleteIndexEndpoint, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeployIndex(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeployIndex, + (google::cloud::visionai::v1::DeployIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeployIndex(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeployIndex, + (NoAwaitTag, + google::cloud::visionai::v1::DeployIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeployIndex(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeployIndex, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UndeployIndex(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UndeployIndex, + (google::cloud::visionai::v1::UndeployIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UndeployIndex(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UndeployIndex, + (NoAwaitTag, + google::cloud::visionai::v1::UndeployIndexRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UndeployIndex(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UndeployIndex, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateCollection(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateCollection, + (google::cloud::visionai::v1::CreateCollectionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateCollection(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateCollection, + (NoAwaitTag, + google::cloud::visionai::v1::CreateCollectionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateCollection(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateCollection, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteCollection(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteCollection, + (google::cloud::visionai::v1::DeleteCollectionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteCollection(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteCollection, + (NoAwaitTag, + google::cloud::visionai::v1::DeleteCollectionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteCollection(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteCollection, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + StatusOr, GetCollection, + (google::cloud::visionai::v1::GetCollectionRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, UpdateCollection, + (google::cloud::visionai::v1::UpdateCollectionRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ListCollections, + (google::cloud::visionai::v1::ListCollectionsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, + AddCollectionItem, + (google::cloud::visionai::v1::AddCollectionItemRequest const& request), + (override)); + + MOCK_METHOD( + StatusOr, + RemoveCollectionItem, + (google::cloud::visionai::v1::RemoveCollectionItemRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), + ViewCollectionItems, + (google::cloud::visionai::v1::ViewCollectionItemsRequest request), + (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 visionai_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_MOCKS_MOCK_WAREHOUSE_CONNECTION_H diff --git a/google/cloud/visionai/v1/samples/app_platform_client_samples.cc b/google/cloud/visionai/v1/samples/app_platform_client_samples.cc new file mode 100644 index 0000000000000..9f8b6bdfea075 --- /dev/null +++ b/google/cloud/visionai/v1/samples/app_platform_client_samples.cc @@ -0,0 +1,225 @@ +// Copyright 2026 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/visionai/v1/platform.proto + +#include "google/cloud/visionai/v1/app_platform_client.h" +#include "google/cloud/visionai/v1/app_platform_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/app_platform_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 "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: visionai_v1::AppPlatformClient +// 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::visionai_v1::AppPlatformClient( + google::cloud::visionai_v1::MakeAppPlatformConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::visionai_v1::AppPlatformClient( + google::cloud::visionai_v1::MakeAppPlatformConnection(*ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy : public google::cloud::visionai_v1:: + AppPlatformConnectionIdempotencyPolicy { + public: + ~CustomIdempotencyPolicy() override = default; + std::unique_ptr< + google::cloud::visionai_v1::AppPlatformConnectionIdempotencyPolicy> + 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::visionai_v1:: + AppPlatformLimitedErrorCountRetryPolicy(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::visionai_v1::MakeAppPlatformConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::visionai_v1::AppPlatformClient(connection); + auto c2 = google::cloud::visionai_v1::AppPlatformClient(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::visionai_v1::AppPlatformClient( + connection, + google::cloud::Options{} + .set( + google::cloud::visionai_v1::AppPlatformLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::visionai_v1::AppPlatformLimitedErrorCountRetryPolicy(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::visionai_v1::AppPlatformRetryPolicyOption:: + Type, + google::cloud::visionai_v1::AppPlatformBackoffPolicyOption:: + Type>( + google::cloud::visionai_v1::AppPlatformLimitedTimeRetryPolicy( + /*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::visionai_v1::MakeAppPlatformConnection(options); + + // c1 and c2 share the same polling policies. + auto c1 = google::cloud::visionai_v1::AppPlatformClient(connection); + auto c2 = google::cloud::visionai_v1::AppPlatformClient(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::visionai_v1::AppPlatformClient( + google::cloud::visionai_v1::MakeAppPlatformConnection(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}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/visionai/v1/samples/health_check_client_samples.cc b/google/cloud/visionai/v1/samples/health_check_client_samples.cc new file mode 100644 index 0000000000000..fd42c15e20edf --- /dev/null +++ b/google/cloud/visionai/v1/samples/health_check_client_samples.cc @@ -0,0 +1,184 @@ +// Copyright 2026 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/visionai/v1/health_service.proto + +#include "google/cloud/visionai/v1/health_check_client.h" +#include "google/cloud/visionai/v1/health_check_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/health_check_options.h" +#include "google/cloud/common_options.h" +#include "google/cloud/credentials.h" +#include "google/cloud/internal/getenv.h" +#include "google/cloud/testing_util/example_driver.h" +#include "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: visionai_v1::HealthCheckServiceClient +// 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::visionai_v1::HealthCheckServiceClient( + google::cloud::visionai_v1::MakeHealthCheckServiceConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::visionai_v1::HealthCheckServiceClient( + google::cloud::visionai_v1::MakeHealthCheckServiceConnection( + *ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::visionai_v1:: + HealthCheckServiceConnectionIdempotencyPolicy { + public: + ~CustomIdempotencyPolicy() override = default; + std::unique_ptr< + google::cloud::visionai_v1::HealthCheckServiceConnectionIdempotencyPolicy> + 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::visionai_v1:: + HealthCheckServiceLimitedErrorCountRetryPolicy(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::visionai_v1::MakeHealthCheckServiceConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::visionai_v1::HealthCheckServiceClient(connection); + auto c2 = google::cloud::visionai_v1::HealthCheckServiceClient(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::visionai_v1::HealthCheckServiceClient( + connection, + google::cloud::Options{} + .set( + google::cloud::visionai_v1:: + HealthCheckServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::visionai_v1::HealthCheckServiceLimitedErrorCountRetryPolicy(10).clone())); + //! [set-retry-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::visionai_v1::HealthCheckServiceClient( + google::cloud::visionai_v1::MakeHealthCheckServiceConnection(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 WithServiceAccount() example" << std::endl; + WithServiceAccount({keyfile}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"with-service-account", WithServiceAccount}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/visionai/v1/samples/live_video_analytics_client_samples.cc b/google/cloud/visionai/v1/samples/live_video_analytics_client_samples.cc new file mode 100644 index 0000000000000..d4af3bc20753b --- /dev/null +++ b/google/cloud/visionai/v1/samples/live_video_analytics_client_samples.cc @@ -0,0 +1,231 @@ +// Copyright 2026 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/visionai/v1/lva_service.proto + +#include "google/cloud/visionai/v1/live_video_analytics_client.h" +#include "google/cloud/visionai/v1/live_video_analytics_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/live_video_analytics_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 "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: visionai_v1::LiveVideoAnalyticsClient +// 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::visionai_v1::LiveVideoAnalyticsClient( + google::cloud::visionai_v1::MakeLiveVideoAnalyticsConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::visionai_v1::LiveVideoAnalyticsClient( + google::cloud::visionai_v1::MakeLiveVideoAnalyticsConnection( + *ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::visionai_v1:: + LiveVideoAnalyticsConnectionIdempotencyPolicy { + public: + ~CustomIdempotencyPolicy() override = default; + std::unique_ptr< + google::cloud::visionai_v1::LiveVideoAnalyticsConnectionIdempotencyPolicy> + 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::visionai_v1:: + LiveVideoAnalyticsLimitedErrorCountRetryPolicy(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::visionai_v1::MakeLiveVideoAnalyticsConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::visionai_v1::LiveVideoAnalyticsClient(connection); + auto c2 = google::cloud::visionai_v1::LiveVideoAnalyticsClient(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::visionai_v1::LiveVideoAnalyticsClient( + connection, + google::cloud::Options{} + .set( + google::cloud::visionai_v1:: + LiveVideoAnalyticsLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::visionai_v1::LiveVideoAnalyticsLimitedErrorCountRetryPolicy(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::visionai_v1:: + LiveVideoAnalyticsRetryPolicyOption::Type, + google::cloud::visionai_v1:: + LiveVideoAnalyticsBackoffPolicyOption::Type>( + google::cloud::visionai_v1:: + LiveVideoAnalyticsLimitedTimeRetryPolicy( + /*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::visionai_v1::MakeLiveVideoAnalyticsConnection(options); + + // c1 and c2 share the same polling policies. + auto c1 = google::cloud::visionai_v1::LiveVideoAnalyticsClient(connection); + auto c2 = google::cloud::visionai_v1::LiveVideoAnalyticsClient(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::visionai_v1::LiveVideoAnalyticsClient( + google::cloud::visionai_v1::MakeLiveVideoAnalyticsConnection(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}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/visionai/v1/samples/streaming_client_samples.cc b/google/cloud/visionai/v1/samples/streaming_client_samples.cc new file mode 100644 index 0000000000000..e047675d9843a --- /dev/null +++ b/google/cloud/visionai/v1/samples/streaming_client_samples.cc @@ -0,0 +1,182 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#include "google/cloud/visionai/v1/streaming_client.h" +#include "google/cloud/visionai/v1/streaming_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/streaming_options.h" +#include "google/cloud/common_options.h" +#include "google/cloud/credentials.h" +#include "google/cloud/internal/getenv.h" +#include "google/cloud/testing_util/example_driver.h" +#include "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: visionai_v1::StreamingServiceClient +// 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::visionai_v1::StreamingServiceClient( + google::cloud::visionai_v1::MakeStreamingServiceConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::visionai_v1::StreamingServiceClient( + google::cloud::visionai_v1::MakeStreamingServiceConnection(*ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::visionai_v1:: + StreamingServiceConnectionIdempotencyPolicy { + public: + ~CustomIdempotencyPolicy() override = default; + std::unique_ptr< + google::cloud::visionai_v1::StreamingServiceConnectionIdempotencyPolicy> + 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::visionai_v1:: + StreamingServiceLimitedErrorCountRetryPolicy(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::visionai_v1::MakeStreamingServiceConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::visionai_v1::StreamingServiceClient(connection); + auto c2 = google::cloud::visionai_v1::StreamingServiceClient(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::visionai_v1::StreamingServiceClient( + connection, + google::cloud::Options{} + .set( + google::cloud::visionai_v1:: + StreamingServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::visionai_v1::StreamingServiceLimitedErrorCountRetryPolicy(10).clone())); + //! [set-retry-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::visionai_v1::StreamingServiceClient( + google::cloud::visionai_v1::MakeStreamingServiceConnection(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 WithServiceAccount() example" << std::endl; + WithServiceAccount({keyfile}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"with-service-account", WithServiceAccount}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/visionai/v1/samples/streams_client_samples.cc b/google/cloud/visionai/v1/samples/streams_client_samples.cc new file mode 100644 index 0000000000000..4e3027ab42a92 --- /dev/null +++ b/google/cloud/visionai/v1/samples/streams_client_samples.cc @@ -0,0 +1,226 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#include "google/cloud/visionai/v1/streams_client.h" +#include "google/cloud/visionai/v1/streams_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/streams_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 "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: visionai_v1::StreamsServiceClient +// 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::visionai_v1::StreamsServiceClient( + google::cloud::visionai_v1::MakeStreamsServiceConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::visionai_v1::StreamsServiceClient( + google::cloud::visionai_v1::MakeStreamsServiceConnection(*ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy : public google::cloud::visionai_v1:: + StreamsServiceConnectionIdempotencyPolicy { + public: + ~CustomIdempotencyPolicy() override = default; + std::unique_ptr< + google::cloud::visionai_v1::StreamsServiceConnectionIdempotencyPolicy> + 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::visionai_v1:: + StreamsServiceLimitedErrorCountRetryPolicy(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::visionai_v1::MakeStreamsServiceConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::visionai_v1::StreamsServiceClient(connection); + auto c2 = google::cloud::visionai_v1::StreamsServiceClient(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::visionai_v1::StreamsServiceClient( + connection, + google::cloud::Options{} + .set( + google::cloud::visionai_v1::StreamsServiceLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::visionai_v1::StreamsServiceLimitedErrorCountRetryPolicy(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::visionai_v1::StreamsServiceRetryPolicyOption:: + Type, + google::cloud::visionai_v1:: + StreamsServiceBackoffPolicyOption::Type>( + google::cloud::visionai_v1:: + StreamsServiceLimitedTimeRetryPolicy( + /*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::visionai_v1::MakeStreamsServiceConnection(options); + + // c1 and c2 share the same polling policies. + auto c1 = google::cloud::visionai_v1::StreamsServiceClient(connection); + auto c2 = google::cloud::visionai_v1::StreamsServiceClient(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::visionai_v1::StreamsServiceClient( + google::cloud::visionai_v1::MakeStreamsServiceConnection(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}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/visionai/v1/samples/warehouse_client_samples.cc b/google/cloud/visionai/v1/samples/warehouse_client_samples.cc new file mode 100644 index 0000000000000..6c307a14e9c72 --- /dev/null +++ b/google/cloud/visionai/v1/samples/warehouse_client_samples.cc @@ -0,0 +1,224 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#include "google/cloud/visionai/v1/warehouse_client.h" +#include "google/cloud/visionai/v1/warehouse_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/warehouse_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 "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: visionai_v1::WarehouseClient +// 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::visionai_v1::WarehouseClient( + google::cloud::visionai_v1::MakeWarehouseConnection(options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::visionai_v1::WarehouseClient( + google::cloud::visionai_v1::MakeWarehouseConnection(*ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy + : public google::cloud::visionai_v1::WarehouseConnectionIdempotencyPolicy { + public: + ~CustomIdempotencyPolicy() override = default; + std::unique_ptr< + google::cloud::visionai_v1::WarehouseConnectionIdempotencyPolicy> + 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::visionai_v1::WarehouseLimitedErrorCountRetryPolicy( + 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::visionai_v1::MakeWarehouseConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::visionai_v1::WarehouseClient(connection); + auto c2 = google::cloud::visionai_v1::WarehouseClient(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::visionai_v1::WarehouseClient( + connection, + google::cloud::Options{} + .set( + google::cloud::visionai_v1::WarehouseLimitedTimeRetryPolicy( + std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::visionai_v1::WarehouseLimitedErrorCountRetryPolicy(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::visionai_v1::WarehouseRetryPolicyOption::Type, + google::cloud::visionai_v1::WarehouseBackoffPolicyOption:: + Type>( + google::cloud::visionai_v1::WarehouseLimitedTimeRetryPolicy( + /*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::visionai_v1::MakeWarehouseConnection(options); + + // c1 and c2 share the same polling policies. + auto c1 = google::cloud::visionai_v1::WarehouseClient(connection); + auto c2 = google::cloud::visionai_v1::WarehouseClient(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::visionai_v1::WarehouseClient( + google::cloud::visionai_v1::MakeWarehouseConnection(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}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/visionai/v1/streaming_client.cc b/google/cloud/visionai/v1/streaming_client.cc new file mode 100644 index 0000000000000..0d14f439fea5e --- /dev/null +++ b/google/cloud/visionai/v1/streaming_client.cc @@ -0,0 +1,158 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#include "google/cloud/visionai/v1/streaming_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamingServiceClient::StreamingServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +StreamingServiceClient::~StreamingServiceClient() = default; + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> +StreamingServiceClient::AsyncSendPackets(Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AsyncSendPackets(); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> +StreamingServiceClient::AsyncReceivePackets(Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AsyncReceivePackets(); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> +StreamingServiceClient::AsyncReceiveEvents(Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AsyncReceiveEvents(); +} + +StatusOr +StreamingServiceClient::AcquireLease( + google::cloud::visionai::v1::AcquireLeaseRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AcquireLease(request); +} + +StatusOr StreamingServiceClient::RenewLease( + google::cloud::visionai::v1::RenewLeaseRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RenewLease(request); +} + +StatusOr +StreamingServiceClient::ReleaseLease( + google::cloud::visionai::v1::ReleaseLeaseRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ReleaseLease(request); +} + +StreamRange +StreamingServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr StreamingServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange +StreamingServiceClient::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 +StreamingServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr StreamingServiceClient::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 StreamingServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status StreamingServiceClient::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 StreamingServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status StreamingServiceClient::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 StreamingServiceClient::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 visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/streaming_client.h b/google/cloud/visionai/v1/streaming_client.h new file mode 100644 index 0000000000000..a5b8dcd93a974 --- /dev/null +++ b/google/cloud/visionai/v1/streaming_client.h @@ -0,0 +1,619 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMING_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMING_CLIENT_H + +#include "google/cloud/visionai/v1/streaming_connection.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/version.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// Streaming service for receiving and sending packets. +/// +/// @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 StreamingServiceClient { + public: + explicit StreamingServiceClient( + std::shared_ptr connection, + Options opts = {}); + ~StreamingServiceClient(); + + ///@{ + /// @name Copy and move support + StreamingServiceClient(StreamingServiceClient const&) = default; + StreamingServiceClient& operator=(StreamingServiceClient const&) = default; + StreamingServiceClient(StreamingServiceClient&&) = default; + StreamingServiceClient& operator=(StreamingServiceClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(StreamingServiceClient const& a, + StreamingServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(StreamingServiceClient const& a, + StreamingServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Send packets to the series. + /// + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return An object representing the bidirectional streaming + /// RPC. Applications can send multiple request messages and receive + /// multiple response messages through this API. Bidirectional streaming + /// RPCs can impose restrictions on the sequence of request and response + /// messages. Please consult the service documentation for details. + /// The request message type ([google.cloud.visionai.v1.SendPacketsRequest]) and response messages + /// ([google.cloud.visionai.v1.SendPacketsResponse]) are mapped to C++ classes 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 + /// [`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.visionai.v1.SendPacketsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streaming_service.proto#L272} + /// [google.cloud.visionai.v1.SendPacketsResponse]: @googleapis_reference_link{google/cloud/visionai/v1/streaming_service.proto#L283} + /// + // clang-format on + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> + AsyncSendPackets(Options opts = {}); + + // clang-format off + /// + /// Receive packets from the series. + /// + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return An object representing the bidirectional streaming + /// RPC. Applications can send multiple request messages and receive + /// multiple response messages through this API. Bidirectional streaming + /// RPCs can impose restrictions on the sequence of request and response + /// messages. Please consult the service documentation for details. + /// The request message type ([google.cloud.visionai.v1.ReceivePacketsRequest]) and response messages + /// ([google.cloud.visionai.v1.ReceivePacketsResponse]) are mapped to C++ classes 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 + /// [`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.visionai.v1.ReceivePacketsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streaming_service.proto#L286} + /// [google.cloud.visionai.v1.ReceivePacketsResponse]: @googleapis_reference_link{google/cloud/visionai/v1/streaming_service.proto#L356} + /// + // clang-format on + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> + AsyncReceivePackets(Options opts = {}); + + // clang-format off + /// + /// Receive events given the stream name. + /// + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return An object representing the bidirectional streaming + /// RPC. Applications can send multiple request messages and receive + /// multiple response messages through this API. Bidirectional streaming + /// RPCs can impose restrictions on the sequence of request and response + /// messages. Please consult the service documentation for details. + /// The request message type ([google.cloud.visionai.v1.ReceiveEventsRequest]) and response messages + /// ([google.cloud.visionai.v1.ReceiveEventsResponse]) are mapped to C++ classes 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 + /// [`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.visionai.v1.ReceiveEventsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streaming_service.proto#L89} + /// [google.cloud.visionai.v1.ReceiveEventsResponse]: @googleapis_reference_link{google/cloud/visionai/v1/streaming_service.proto#L173} + /// + // clang-format on + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> + AsyncReceiveEvents(Options opts = {}); + + // clang-format off + /// + /// AcquireLease acquires a lease. + /// + /// @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.visionai.v1.AcquireLeaseRequest]. + /// 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.visionai.v1.Lease]) + /// 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.visionai.v1.AcquireLeaseRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streaming_service.proto#L203} + /// [google.cloud.visionai.v1.Lease]: @googleapis_reference_link{google/cloud/visionai/v1/streaming_service.proto#L185} + /// + // clang-format on + StatusOr AcquireLease( + google::cloud::visionai::v1::AcquireLeaseRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// RenewLease renews a lease. + /// + /// @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.visionai.v1.RenewLeaseRequest]. + /// 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.visionai.v1.Lease]) + /// 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.visionai.v1.Lease]: @googleapis_reference_link{google/cloud/visionai/v1/streaming_service.proto#L185} + /// [google.cloud.visionai.v1.RenewLeaseRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streaming_service.proto#L218} + /// + // clang-format on + StatusOr RenewLease( + google::cloud::visionai::v1::RenewLeaseRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// RleaseLease releases a lease. + /// + /// @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.visionai.v1.ReleaseLeaseRequest]. + /// 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.visionai.v1.ReleaseLeaseResponse]) + /// 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.visionai.v1.ReleaseLeaseRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streaming_service.proto#L233} + /// [google.cloud.visionai.v1.ReleaseLeaseResponse]: @googleapis_reference_link{google/cloud/visionai/v1/streaming_service.proto#L245} + /// + // clang-format on + StatusOr ReleaseLease( + google::cloud::visionai::v1::ReleaseLeaseRequest const& request, + 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMING_CLIENT_H diff --git a/google/cloud/visionai/v1/streaming_connection.cc b/google/cloud/visionai/v1/streaming_connection.cc new file mode 100644 index 0000000000000..b6286c8a089c8 --- /dev/null +++ b/google/cloud/visionai/v1/streaming_connection.cc @@ -0,0 +1,150 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#include "google/cloud/visionai/v1/streaming_connection.h" +#include "google/cloud/visionai/v1/internal/streaming_connection_impl.h" +#include "google/cloud/visionai/v1/internal/streaming_option_defaults.h" +#include "google/cloud/visionai/v1/internal/streaming_stub_factory.h" +#include "google/cloud/visionai/v1/internal/streaming_tracing_connection.h" +#include "google/cloud/visionai/v1/streaming_options.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 visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamingServiceConnection::~StreamingServiceConnection() = default; + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> +StreamingServiceConnection::AsyncSendPackets() { + return std::make_unique< + ::google::cloud::internal::AsyncStreamingReadWriteRpcError< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> +StreamingServiceConnection::AsyncReceivePackets() { + return std::make_unique< + ::google::cloud::internal::AsyncStreamingReadWriteRpcError< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> +StreamingServiceConnection::AsyncReceiveEvents() { + return std::make_unique< + ::google::cloud::internal::AsyncStreamingReadWriteRpcError< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +StreamingServiceConnection::AcquireLease( + google::cloud::visionai::v1::AcquireLeaseRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +StreamingServiceConnection::RenewLease( + google::cloud::visionai::v1::RenewLeaseRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +StreamingServiceConnection::ReleaseLease( + google::cloud::visionai::v1::ReleaseLeaseRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +StreamingServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +StreamingServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +StreamingServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +StreamingServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status StreamingServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status StreamingServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeStreamingServiceConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = + visionai_v1_internal::StreamingServiceDefaultOptions(std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = visionai_v1_internal::CreateDefaultStreamingServiceStub( + std::move(auth), options); + return visionai_v1_internal::MakeStreamingServiceTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/streaming_connection.h b/google/cloud/visionai/v1/streaming_connection.h new file mode 100644 index 0000000000000..bc42a878c985d --- /dev/null +++ b/google/cloud/visionai/v1/streaming_connection.h @@ -0,0 +1,260 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMING_CONNECTION_H + +#include "google/cloud/visionai/v1/internal/streaming_retry_traits.h" +#include "google/cloud/visionai/v1/streaming_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/streaming_service.pb.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/internal/async_read_write_stream_impl.h" +#include "google/cloud/internal/retry_policy_impl.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `StreamingServiceConnection`. +class StreamingServiceRetryPolicy : 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 `StreamingServiceConnection` 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 StreamingServiceLimitedErrorCountRetryPolicy + : public StreamingServiceRetryPolicy { + 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 StreamingServiceLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + StreamingServiceLimitedErrorCountRetryPolicy( + StreamingServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : StreamingServiceLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + StreamingServiceLimitedErrorCountRetryPolicy( + StreamingServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : StreamingServiceLimitedErrorCountRetryPolicy(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 = StreamingServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + visionai_v1_internal::StreamingServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `StreamingServiceConnection` 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 StreamingServiceLimitedTimeRetryPolicy + : public StreamingServiceRetryPolicy { + 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 StreamingServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + StreamingServiceLimitedTimeRetryPolicy( + StreamingServiceLimitedTimeRetryPolicy&& rhs) noexcept + : StreamingServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + StreamingServiceLimitedTimeRetryPolicy( + StreamingServiceLimitedTimeRetryPolicy const& rhs) noexcept + : StreamingServiceLimitedTimeRetryPolicy(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 = StreamingServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + visionai_v1_internal::StreamingServiceRetryTraits> + impl_; +}; + +/** + * The `StreamingServiceConnection` object for `StreamingServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `StreamingServiceClient`. This allows users to inject custom behavior + * (e.g., with a Google Mock object) when writing tests that use objects of type + * `StreamingServiceClient`. + * + * To create a concrete instance, see `MakeStreamingServiceConnection()`. + * + * For mocking, see `visionai_v1_mocks::MockStreamingServiceConnection`. + */ +class StreamingServiceConnection { + public: + virtual ~StreamingServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::SendPacketsRequest, + google::cloud::visionai::v1::SendPacketsResponse>> + AsyncSendPackets(); + + virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceivePacketsRequest, + google::cloud::visionai::v1::ReceivePacketsResponse>> + AsyncReceivePackets(); + + virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::ReceiveEventsRequest, + google::cloud::visionai::v1::ReceiveEventsResponse>> + AsyncReceiveEvents(); + + virtual StatusOr AcquireLease( + google::cloud::visionai::v1::AcquireLeaseRequest const& request); + + virtual StatusOr RenewLease( + google::cloud::visionai::v1::RenewLeaseRequest const& request); + + virtual StatusOr + ReleaseLease(google::cloud::visionai::v1::ReleaseLeaseRequest const& request); + + 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 + * `StreamingServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of StreamingServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `StreamingServiceConnection`. Expected options are any of the types + * in the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::visionai_v1::StreamingServicePolicyOptionList` + * + * @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 `StreamingServiceConnection` created + * by this function. + */ +std::shared_ptr MakeStreamingServiceConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMING_CONNECTION_H diff --git a/google/cloud/visionai/v1/streaming_connection_idempotency_policy.cc b/google/cloud/visionai/v1/streaming_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..826c588174b59 --- /dev/null +++ b/google/cloud/visionai/v1/streaming_connection_idempotency_policy.cc @@ -0,0 +1,90 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#include "google/cloud/visionai/v1/streaming_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +StreamingServiceConnectionIdempotencyPolicy:: + ~StreamingServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +StreamingServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency StreamingServiceConnectionIdempotencyPolicy::AcquireLease( + google::cloud::visionai::v1::AcquireLeaseRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamingServiceConnectionIdempotencyPolicy::RenewLease( + google::cloud::visionai::v1::RenewLeaseRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamingServiceConnectionIdempotencyPolicy::ReleaseLease( + google::cloud::visionai::v1::ReleaseLeaseRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamingServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency StreamingServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency StreamingServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency StreamingServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency StreamingServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamingServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultStreamingServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/streaming_connection_idempotency_policy.h b/google/cloud/visionai/v1/streaming_connection_idempotency_policy.h new file mode 100644 index 0000000000000..7aa1ad4545a9b --- /dev/null +++ b/google/cloud/visionai/v1/streaming_connection_idempotency_policy.h @@ -0,0 +1,78 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMING_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMING_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/streaming_service.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamingServiceConnectionIdempotencyPolicy { + public: + virtual ~StreamingServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() + const; + + virtual google::cloud::Idempotency AcquireLease( + google::cloud::visionai::v1::AcquireLeaseRequest const& request); + + virtual google::cloud::Idempotency RenewLease( + google::cloud::visionai::v1::RenewLeaseRequest const& request); + + virtual google::cloud::Idempotency ReleaseLease( + google::cloud::visionai::v1::ReleaseLeaseRequest 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 +MakeDefaultStreamingServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMING_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/visionai/v1/streaming_options.h b/google/cloud/visionai/v1/streaming_options.h new file mode 100644 index 0000000000000..dc22cb9144462 --- /dev/null +++ b/google/cloud/visionai/v1/streaming_options.h @@ -0,0 +1,76 @@ +// Copyright 2026 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/visionai/v1/streaming_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMING_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMING_OPTIONS_H + +#include "google/cloud/visionai/v1/streaming_connection.h" +#include "google/cloud/visionai/v1/streaming_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 visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-visionai-options + */ +struct StreamingServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-visionai-options + */ +struct StreamingServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-visionai-options + */ +struct StreamingServiceConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to StreamingService. + * + * @ingroup google-cloud-visionai-options + */ +using StreamingServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMING_OPTIONS_H diff --git a/google/cloud/visionai/v1/streams_client.cc b/google/cloud/visionai/v1/streams_client.cc new file mode 100644 index 0000000000000..625c45eaeaf16 --- /dev/null +++ b/google/cloud/visionai/v1/streams_client.cc @@ -0,0 +1,856 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#include "google/cloud/visionai/v1/streams_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamsServiceClient::StreamsServiceClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +StreamsServiceClient::~StreamsServiceClient() = default; + +StreamRange +StreamsServiceClient::ListClusters(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListClustersRequest request; + request.set_parent(parent); + return connection_->ListClusters(request); +} + +StreamRange +StreamsServiceClient::ListClusters( + google::cloud::visionai::v1::ListClustersRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListClusters(std::move(request)); +} + +StatusOr StreamsServiceClient::GetCluster( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetClusterRequest request; + request.set_name(name); + return connection_->GetCluster(request); +} + +StatusOr StreamsServiceClient::GetCluster( + google::cloud::visionai::v1::GetClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetCluster(request); +} + +future> +StreamsServiceClient::CreateCluster( + std::string const& parent, + google::cloud::visionai::v1::Cluster const& cluster, + std::string const& cluster_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateClusterRequest request; + request.set_parent(parent); + *request.mutable_cluster() = cluster; + request.set_cluster_id(cluster_id); + return connection_->CreateCluster(request); +} + +StatusOr StreamsServiceClient::CreateCluster( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Cluster const& cluster, + std::string const& cluster_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateClusterRequest request; + request.set_parent(parent); + *request.mutable_cluster() = cluster; + request.set_cluster_id(cluster_id); + return connection_->CreateCluster(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::CreateCluster( + google::cloud::visionai::v1::CreateClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCluster(request); +} + +StatusOr StreamsServiceClient::CreateCluster( + NoAwaitTag, + google::cloud::visionai::v1::CreateClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCluster(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::CreateCluster( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCluster(operation); +} + +future> +StreamsServiceClient::UpdateCluster( + google::cloud::visionai::v1::Cluster const& cluster, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateClusterRequest request; + *request.mutable_cluster() = cluster; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateCluster(request); +} + +StatusOr StreamsServiceClient::UpdateCluster( + NoAwaitTag, google::cloud::visionai::v1::Cluster const& cluster, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateClusterRequest request; + *request.mutable_cluster() = cluster; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateCluster(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::UpdateCluster( + google::cloud::visionai::v1::UpdateClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateCluster(request); +} + +StatusOr StreamsServiceClient::UpdateCluster( + NoAwaitTag, + google::cloud::visionai::v1::UpdateClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateCluster(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::UpdateCluster( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateCluster(operation); +} + +future> +StreamsServiceClient::DeleteCluster(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteClusterRequest request; + request.set_name(name); + return connection_->DeleteCluster(request); +} + +StatusOr StreamsServiceClient::DeleteCluster( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteClusterRequest request; + request.set_name(name); + return connection_->DeleteCluster(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::DeleteCluster( + google::cloud::visionai::v1::DeleteClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCluster(request); +} + +StatusOr StreamsServiceClient::DeleteCluster( + NoAwaitTag, + google::cloud::visionai::v1::DeleteClusterRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCluster(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::DeleteCluster( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCluster(operation); +} + +StreamRange +StreamsServiceClient::ListStreams(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListStreamsRequest request; + request.set_parent(parent); + return connection_->ListStreams(request); +} + +StreamRange +StreamsServiceClient::ListStreams( + google::cloud::visionai::v1::ListStreamsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListStreams(std::move(request)); +} + +StatusOr StreamsServiceClient::GetStream( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetStreamRequest request; + request.set_name(name); + return connection_->GetStream(request); +} + +StatusOr StreamsServiceClient::GetStream( + google::cloud::visionai::v1::GetStreamRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetStream(request); +} + +future> +StreamsServiceClient::CreateStream( + std::string const& parent, + google::cloud::visionai::v1::Stream const& stream, + std::string const& stream_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateStreamRequest request; + request.set_parent(parent); + *request.mutable_stream() = stream; + request.set_stream_id(stream_id); + return connection_->CreateStream(request); +} + +StatusOr StreamsServiceClient::CreateStream( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Stream const& stream, + std::string const& stream_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateStreamRequest request; + request.set_parent(parent); + *request.mutable_stream() = stream; + request.set_stream_id(stream_id); + return connection_->CreateStream(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::CreateStream( + google::cloud::visionai::v1::CreateStreamRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateStream(request); +} + +StatusOr StreamsServiceClient::CreateStream( + NoAwaitTag, google::cloud::visionai::v1::CreateStreamRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateStream(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::CreateStream( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateStream(operation); +} + +future> +StreamsServiceClient::UpdateStream( + google::cloud::visionai::v1::Stream const& stream, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateStreamRequest request; + *request.mutable_stream() = stream; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateStream(request); +} + +StatusOr StreamsServiceClient::UpdateStream( + NoAwaitTag, google::cloud::visionai::v1::Stream const& stream, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateStreamRequest request; + *request.mutable_stream() = stream; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateStream(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::UpdateStream( + google::cloud::visionai::v1::UpdateStreamRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateStream(request); +} + +StatusOr StreamsServiceClient::UpdateStream( + NoAwaitTag, google::cloud::visionai::v1::UpdateStreamRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateStream(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::UpdateStream( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateStream(operation); +} + +future> +StreamsServiceClient::DeleteStream(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteStreamRequest request; + request.set_name(name); + return connection_->DeleteStream(request); +} + +StatusOr StreamsServiceClient::DeleteStream( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteStreamRequest request; + request.set_name(name); + return connection_->DeleteStream(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::DeleteStream( + google::cloud::visionai::v1::DeleteStreamRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteStream(request); +} + +StatusOr StreamsServiceClient::DeleteStream( + NoAwaitTag, google::cloud::visionai::v1::DeleteStreamRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteStream(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::DeleteStream( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteStream(operation); +} + +future> +StreamsServiceClient::GetStreamThumbnail(std::string const& stream, + std::string const& gcs_object_name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetStreamThumbnailRequest request; + request.set_stream(stream); + request.set_gcs_object_name(gcs_object_name); + return connection_->GetStreamThumbnail(request); +} + +StatusOr +StreamsServiceClient::GetStreamThumbnail(NoAwaitTag, std::string const& stream, + std::string const& gcs_object_name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetStreamThumbnailRequest request; + request.set_stream(stream); + request.set_gcs_object_name(gcs_object_name); + return connection_->GetStreamThumbnail(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::GetStreamThumbnail( + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetStreamThumbnail(request); +} + +StatusOr +StreamsServiceClient::GetStreamThumbnail( + NoAwaitTag, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetStreamThumbnail(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::GetStreamThumbnail( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetStreamThumbnail(operation); +} + +StatusOr +StreamsServiceClient::GenerateStreamHlsToken(std::string const& stream, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest request; + request.set_stream(stream); + return connection_->GenerateStreamHlsToken(request); +} + +StatusOr +StreamsServiceClient::GenerateStreamHlsToken( + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GenerateStreamHlsToken(request); +} + +StreamRange +StreamsServiceClient::ListEvents(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListEventsRequest request; + request.set_parent(parent); + return connection_->ListEvents(request); +} + +StreamRange +StreamsServiceClient::ListEvents( + google::cloud::visionai::v1::ListEventsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListEvents(std::move(request)); +} + +StatusOr StreamsServiceClient::GetEvent( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetEventRequest request; + request.set_name(name); + return connection_->GetEvent(request); +} + +StatusOr StreamsServiceClient::GetEvent( + google::cloud::visionai::v1::GetEventRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetEvent(request); +} + +future> +StreamsServiceClient::CreateEvent( + std::string const& parent, google::cloud::visionai::v1::Event const& event, + std::string const& event_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateEventRequest request; + request.set_parent(parent); + *request.mutable_event() = event; + request.set_event_id(event_id); + return connection_->CreateEvent(request); +} + +StatusOr StreamsServiceClient::CreateEvent( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Event const& event, + std::string const& event_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateEventRequest request; + request.set_parent(parent); + *request.mutable_event() = event; + request.set_event_id(event_id); + return connection_->CreateEvent(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::CreateEvent( + google::cloud::visionai::v1::CreateEventRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateEvent(request); +} + +StatusOr StreamsServiceClient::CreateEvent( + NoAwaitTag, google::cloud::visionai::v1::CreateEventRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateEvent(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::CreateEvent( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateEvent(operation); +} + +future> +StreamsServiceClient::UpdateEvent( + google::cloud::visionai::v1::Event const& event, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateEventRequest request; + *request.mutable_event() = event; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateEvent(request); +} + +StatusOr StreamsServiceClient::UpdateEvent( + NoAwaitTag, google::cloud::visionai::v1::Event const& event, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateEventRequest request; + *request.mutable_event() = event; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateEvent(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::UpdateEvent( + google::cloud::visionai::v1::UpdateEventRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateEvent(request); +} + +StatusOr StreamsServiceClient::UpdateEvent( + NoAwaitTag, google::cloud::visionai::v1::UpdateEventRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateEvent(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::UpdateEvent( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateEvent(operation); +} + +future> +StreamsServiceClient::DeleteEvent(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteEventRequest request; + request.set_name(name); + return connection_->DeleteEvent(request); +} + +StatusOr StreamsServiceClient::DeleteEvent( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteEventRequest request; + request.set_name(name); + return connection_->DeleteEvent(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::DeleteEvent( + google::cloud::visionai::v1::DeleteEventRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteEvent(request); +} + +StatusOr StreamsServiceClient::DeleteEvent( + NoAwaitTag, google::cloud::visionai::v1::DeleteEventRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteEvent(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::DeleteEvent( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteEvent(operation); +} + +StreamRange +StreamsServiceClient::ListSeries(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListSeriesRequest request; + request.set_parent(parent); + return connection_->ListSeries(request); +} + +StreamRange +StreamsServiceClient::ListSeries( + google::cloud::visionai::v1::ListSeriesRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListSeries(std::move(request)); +} + +StatusOr StreamsServiceClient::GetSeries( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetSeriesRequest request; + request.set_name(name); + return connection_->GetSeries(request); +} + +StatusOr StreamsServiceClient::GetSeries( + google::cloud::visionai::v1::GetSeriesRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetSeries(request); +} + +future> +StreamsServiceClient::CreateSeries( + std::string const& parent, + google::cloud::visionai::v1::Series const& series, + std::string const& series_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateSeriesRequest request; + request.set_parent(parent); + *request.mutable_series() = series; + request.set_series_id(series_id); + return connection_->CreateSeries(request); +} + +StatusOr StreamsServiceClient::CreateSeries( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Series const& series, + std::string const& series_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateSeriesRequest request; + request.set_parent(parent); + *request.mutable_series() = series; + request.set_series_id(series_id); + return connection_->CreateSeries(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::CreateSeries( + google::cloud::visionai::v1::CreateSeriesRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateSeries(request); +} + +StatusOr StreamsServiceClient::CreateSeries( + NoAwaitTag, google::cloud::visionai::v1::CreateSeriesRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateSeries(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::CreateSeries( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateSeries(operation); +} + +future> +StreamsServiceClient::UpdateSeries( + google::cloud::visionai::v1::Series const& series, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateSeriesRequest request; + *request.mutable_series() = series; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateSeries(request); +} + +StatusOr StreamsServiceClient::UpdateSeries( + NoAwaitTag, google::cloud::visionai::v1::Series const& series, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateSeriesRequest request; + *request.mutable_series() = series; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateSeries(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::UpdateSeries( + google::cloud::visionai::v1::UpdateSeriesRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateSeries(request); +} + +StatusOr StreamsServiceClient::UpdateSeries( + NoAwaitTag, google::cloud::visionai::v1::UpdateSeriesRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateSeries(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::UpdateSeries( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateSeries(operation); +} + +future> +StreamsServiceClient::DeleteSeries(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteSeriesRequest request; + request.set_name(name); + return connection_->DeleteSeries(request); +} + +StatusOr StreamsServiceClient::DeleteSeries( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteSeriesRequest request; + request.set_name(name); + return connection_->DeleteSeries(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::DeleteSeries( + google::cloud::visionai::v1::DeleteSeriesRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteSeries(request); +} + +StatusOr StreamsServiceClient::DeleteSeries( + NoAwaitTag, google::cloud::visionai::v1::DeleteSeriesRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteSeries(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::DeleteSeries( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteSeries(operation); +} + +future> +StreamsServiceClient::MaterializeChannel( + std::string const& parent, + google::cloud::visionai::v1::Channel const& channel, + std::string const& channel_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::MaterializeChannelRequest request; + request.set_parent(parent); + *request.mutable_channel() = channel; + request.set_channel_id(channel_id); + return connection_->MaterializeChannel(request); +} + +StatusOr +StreamsServiceClient::MaterializeChannel( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Channel const& channel, + std::string const& channel_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::MaterializeChannelRequest request; + request.set_parent(parent); + *request.mutable_channel() = channel; + request.set_channel_id(channel_id); + return connection_->MaterializeChannel(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::MaterializeChannel( + google::cloud::visionai::v1::MaterializeChannelRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->MaterializeChannel(request); +} + +StatusOr +StreamsServiceClient::MaterializeChannel( + NoAwaitTag, + google::cloud::visionai::v1::MaterializeChannelRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->MaterializeChannel(NoAwaitTag{}, request); +} + +future> +StreamsServiceClient::MaterializeChannel( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->MaterializeChannel(operation); +} + +StreamRange +StreamsServiceClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr StreamsServiceClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange +StreamsServiceClient::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 +StreamsServiceClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr StreamsServiceClient::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 StreamsServiceClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status StreamsServiceClient::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 StreamsServiceClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status StreamsServiceClient::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 StreamsServiceClient::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 visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/streams_client.h b/google/cloud/visionai/v1/streams_client.h new file mode 100644 index 0000000000000..d1268ff2ae5d7 --- /dev/null +++ b/google/cloud/visionai/v1/streams_client.h @@ -0,0 +1,2653 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMS_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMS_CLIENT_H + +#include "google/cloud/visionai/v1/streams_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 "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// Service describing handlers for resources. +/// Vision API and Vision AI API are two independent APIs developed by the same +/// team. Vision API is for people to annotate their image while Vision AI is an +/// e2e solution for customer to build their own computer vision application. +/// +/// @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 StreamsServiceClient { + public: + explicit StreamsServiceClient( + std::shared_ptr connection, Options opts = {}); + ~StreamsServiceClient(); + + ///@{ + /// @name Copy and move support + StreamsServiceClient(StreamsServiceClient const&) = default; + StreamsServiceClient& operator=(StreamsServiceClient const&) = default; + StreamsServiceClient(StreamsServiceClient&&) = default; + StreamsServiceClient& operator=(StreamsServiceClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(StreamsServiceClient const& a, + StreamsServiceClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(StreamsServiceClient const& a, + StreamsServiceClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Lists Clusters in a given project and location. + /// + /// @param parent Required. Parent value for ListClustersRequest. + /// @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.visionai.v1.Cluster], 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.visionai.v1.Cluster]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L32} + /// [google.cloud.visionai.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L306} + /// + // clang-format on + StreamRange ListClusters( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Clusters 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.visionai.v1.ListClustersRequest]. + /// 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.visionai.v1.Cluster], 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.visionai.v1.Cluster]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L32} + /// [google.cloud.visionai.v1.ListClustersRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L306} + /// + // clang-format on + StreamRange ListClusters( + google::cloud::visionai::v1::ListClustersRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Cluster. + /// + /// @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.visionai.v1.Cluster]) + /// 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.visionai.v1.Cluster]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L32} + /// [google.cloud.visionai.v1.GetClusterRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L342} + /// + // clang-format on + StatusOr GetCluster( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Cluster. + /// + /// @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.visionai.v1.GetClusterRequest]. + /// 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.visionai.v1.Cluster]) + /// 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.visionai.v1.Cluster]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L32} + /// [google.cloud.visionai.v1.GetClusterRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L342} + /// + // clang-format on + StatusOr GetCluster( + google::cloud::visionai::v1::GetClusterRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Cluster in a given project and location. + /// + /// @param parent Required. Value for parent. + /// @param cluster Required. The resource being created. + /// @param cluster_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.visionai.v1.Cluster] 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.visionai.v1.Cluster]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L32} + /// [google.cloud.visionai.v1.CreateClusterRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L353} + /// + // clang-format on + future> CreateCluster( + std::string const& parent, + google::cloud::visionai::v1::Cluster const& cluster, + std::string const& cluster_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCluster + /// + /// 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 CreateCluster( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Cluster const& cluster, + std::string const& cluster_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Cluster 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.visionai.v1.CreateClusterRequest]. + /// 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.visionai.v1.Cluster] 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.visionai.v1.Cluster]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L32} + /// [google.cloud.visionai.v1.CreateClusterRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L353} + /// + // clang-format on + future> CreateCluster( + google::cloud::visionai::v1::CreateClusterRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCluster + /// + /// 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 CreateCluster( + NoAwaitTag, + google::cloud::visionai::v1::CreateClusterRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCluster + /// + /// 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> CreateCluster( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Cluster. + /// + /// @param cluster Required. The resource being updated + /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// Cluster 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.visionai.v1.Cluster] 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.visionai.v1.Cluster]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L32} + /// [google.cloud.visionai.v1.UpdateClusterRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L385} + /// + // clang-format on + future> UpdateCluster( + google::cloud::visionai::v1::Cluster const& cluster, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateCluster + /// + /// 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 UpdateCluster( + NoAwaitTag, google::cloud::visionai::v1::Cluster const& cluster, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Cluster. + /// + /// @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.visionai.v1.UpdateClusterRequest]. + /// 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.visionai.v1.Cluster] 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.visionai.v1.Cluster]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L32} + /// [google.cloud.visionai.v1.UpdateClusterRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L385} + /// + // clang-format on + future> UpdateCluster( + google::cloud::visionai::v1::UpdateClusterRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateCluster + /// + /// 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 UpdateCluster( + NoAwaitTag, + google::cloud::visionai::v1::UpdateClusterRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateCluster + /// + /// 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> UpdateCluster( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Cluster. + /// + /// @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.visionai.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.visionai.v1.DeleteClusterRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L414} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> + DeleteCluster(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCluster + /// + /// 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 DeleteCluster( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Cluster. + /// + /// @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.visionai.v1.DeleteClusterRequest]. + /// 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.visionai.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.visionai.v1.DeleteClusterRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L414} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> + DeleteCluster( + google::cloud::visionai::v1::DeleteClusterRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCluster + /// + /// 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 DeleteCluster( + NoAwaitTag, + google::cloud::visionai::v1::DeleteClusterRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCluster + /// + /// 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> + DeleteCluster(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists Streams in a given project and location. + /// + /// @param parent Required. Parent value for ListStreamsRequest. + /// @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.visionai.v1.Stream], 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.visionai.v1.ListStreamsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L440} + /// [google.cloud.visionai.v1.Stream]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L35} + /// + // clang-format on + StreamRange ListStreams( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Streams 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.visionai.v1.ListStreamsRequest]. + /// 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.visionai.v1.Stream], 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.visionai.v1.ListStreamsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L440} + /// [google.cloud.visionai.v1.Stream]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L35} + /// + // clang-format on + StreamRange ListStreams( + google::cloud::visionai::v1::ListStreamsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Stream. + /// + /// @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.visionai.v1.Stream]) + /// 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.visionai.v1.GetStreamRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L476} + /// [google.cloud.visionai.v1.Stream]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L35} + /// + // clang-format on + StatusOr GetStream( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Stream. + /// + /// @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.visionai.v1.GetStreamRequest]. + /// 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.visionai.v1.Stream]) + /// 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.visionai.v1.GetStreamRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L476} + /// [google.cloud.visionai.v1.Stream]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L35} + /// + // clang-format on + StatusOr GetStream( + google::cloud::visionai::v1::GetStreamRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Stream in a given project and location. + /// + /// @param parent Required. Value for parent. + /// @param stream Required. The resource being created. + /// @param stream_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.visionai.v1.Stream] 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.visionai.v1.CreateStreamRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L485} + /// [google.cloud.visionai.v1.Stream]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L35} + /// + // clang-format on + future> CreateStream( + std::string const& parent, + google::cloud::visionai::v1::Stream const& stream, + std::string const& stream_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateStream + /// + /// 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 CreateStream( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Stream const& stream, + std::string const& stream_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Stream 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.visionai.v1.CreateStreamRequest]. + /// 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.visionai.v1.Stream] 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.visionai.v1.CreateStreamRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L485} + /// [google.cloud.visionai.v1.Stream]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L35} + /// + // clang-format on + future> CreateStream( + google::cloud::visionai::v1::CreateStreamRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateStream + /// + /// 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 CreateStream( + NoAwaitTag, + google::cloud::visionai::v1::CreateStreamRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateStream + /// + /// 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> CreateStream( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Stream. + /// + /// @param stream Required. The resource being updated. + /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// Stream 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.visionai.v1.Stream] 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.visionai.v1.Stream]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L35} + /// [google.cloud.visionai.v1.UpdateStreamRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L517} + /// + // clang-format on + future> UpdateStream( + google::cloud::visionai::v1::Stream const& stream, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateStream + /// + /// 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 UpdateStream( + NoAwaitTag, google::cloud::visionai::v1::Stream const& stream, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Stream. + /// + /// @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.visionai.v1.UpdateStreamRequest]. + /// 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.visionai.v1.Stream] 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.visionai.v1.Stream]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L35} + /// [google.cloud.visionai.v1.UpdateStreamRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L517} + /// + // clang-format on + future> UpdateStream( + google::cloud::visionai::v1::UpdateStreamRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateStream + /// + /// 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 UpdateStream( + NoAwaitTag, + google::cloud::visionai::v1::UpdateStreamRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateStream + /// + /// 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> UpdateStream( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Stream. + /// + /// @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.visionai.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.visionai.v1.DeleteStreamRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L546} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> DeleteStream( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteStream + /// + /// 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 DeleteStream(NoAwaitTag, + std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single Stream. + /// + /// @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.visionai.v1.DeleteStreamRequest]. + /// 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.visionai.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.visionai.v1.DeleteStreamRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L546} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> DeleteStream( + google::cloud::visionai::v1::DeleteStreamRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteStream + /// + /// 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 DeleteStream( + NoAwaitTag, + google::cloud::visionai::v1::DeleteStreamRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteStream + /// + /// 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> DeleteStream( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Gets the thumbnail (image snapshot) of a single Stream. + /// + /// @param stream Required. The name of the stream for to get the thumbnail from. + /// @param gcs_object_name Required. The name of the GCS object to store the thumbnail image. + /// @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.visionai.v1.GetStreamThumbnailResponse] 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.visionai.v1.GetStreamThumbnailRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L570} + /// [google.cloud.visionai.v1.GetStreamThumbnailResponse]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L599} + /// + // clang-format on + future> + GetStreamThumbnail(std::string const& stream, + std::string const& gcs_object_name, Options opts = {}); + + // clang-format off + /// + /// @copybrief GetStreamThumbnail + /// + /// 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 GetStreamThumbnail( + NoAwaitTag, std::string const& stream, std::string const& gcs_object_name, + Options opts = {}); + + // clang-format off + /// + /// Gets the thumbnail (image snapshot) of a single Stream. + /// + /// @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.visionai.v1.GetStreamThumbnailRequest]. + /// 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.visionai.v1.GetStreamThumbnailResponse] 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.visionai.v1.GetStreamThumbnailRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L570} + /// [google.cloud.visionai.v1.GetStreamThumbnailResponse]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L599} + /// + // clang-format on + future> + GetStreamThumbnail( + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief GetStreamThumbnail + /// + /// 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 GetStreamThumbnail( + NoAwaitTag, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief GetStreamThumbnail + /// + /// 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> + GetStreamThumbnail(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Generate the JWT auth token required to get the stream HLS contents. + /// + /// @param stream Required. The name of the stream. + /// @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.visionai.v1.GenerateStreamHlsTokenResponse]) + /// 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.visionai.v1.GenerateStreamHlsTokenRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L602} + /// [google.cloud.visionai.v1.GenerateStreamHlsTokenResponse]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L608} + /// + // clang-format on + StatusOr + GenerateStreamHlsToken(std::string const& stream, Options opts = {}); + + // clang-format off + /// + /// Generate the JWT auth token required to get the stream HLS contents. + /// + /// @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.visionai.v1.GenerateStreamHlsTokenRequest]. + /// 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.visionai.v1.GenerateStreamHlsTokenResponse]) + /// 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.visionai.v1.GenerateStreamHlsTokenRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L602} + /// [google.cloud.visionai.v1.GenerateStreamHlsTokenResponse]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L608} + /// + // clang-format on + StatusOr + GenerateStreamHlsToken( + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists Events in a given project and location. + /// + /// @param parent Required. Parent value for ListEventsRequest. + /// @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.visionai.v1.Event], 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.visionai.v1.Event]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L71} + /// [google.cloud.visionai.v1.ListEventsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L622} + /// + // clang-format on + StreamRange ListEvents( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Events 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.visionai.v1.ListEventsRequest]. + /// 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.visionai.v1.Event], 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.visionai.v1.Event]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L71} + /// [google.cloud.visionai.v1.ListEventsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L622} + /// + // clang-format on + StreamRange ListEvents( + google::cloud::visionai::v1::ListEventsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Event. + /// + /// @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.visionai.v1.Event]) + /// 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.visionai.v1.Event]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L71} + /// [google.cloud.visionai.v1.GetEventRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L658} + /// + // clang-format on + StatusOr GetEvent(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Event. + /// + /// @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.visionai.v1.GetEventRequest]. + /// 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.visionai.v1.Event]) + /// 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.visionai.v1.Event]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L71} + /// [google.cloud.visionai.v1.GetEventRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L658} + /// + // clang-format on + StatusOr GetEvent( + google::cloud::visionai::v1::GetEventRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Event in a given project and location. + /// + /// @param parent Required. Value for parent. + /// @param event Required. The resource being created. + /// @param event_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.visionai.v1.Event] 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.visionai.v1.CreateEventRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L667} + /// [google.cloud.visionai.v1.Event]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L71} + /// + // clang-format on + future> CreateEvent( + std::string const& parent, + google::cloud::visionai::v1::Event const& event, + std::string const& event_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateEvent + /// + /// 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 CreateEvent( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Event const& event, + std::string const& event_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Event 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.visionai.v1.CreateEventRequest]. + /// 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.visionai.v1.Event] 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.visionai.v1.CreateEventRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L667} + /// [google.cloud.visionai.v1.Event]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L71} + /// + // clang-format on + future> CreateEvent( + google::cloud::visionai::v1::CreateEventRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateEvent + /// + /// 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 CreateEvent( + NoAwaitTag, + google::cloud::visionai::v1::CreateEventRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateEvent + /// + /// 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> CreateEvent( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Event. + /// + /// @param event Required. The resource being updated. + /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// Event 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.visionai.v1.Event] 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.visionai.v1.Event]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L71} + /// [google.cloud.visionai.v1.UpdateEventRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L699} + /// + // clang-format on + future> UpdateEvent( + google::cloud::visionai::v1::Event const& event, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateEvent + /// + /// 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 UpdateEvent( + NoAwaitTag, google::cloud::visionai::v1::Event const& event, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Event. + /// + /// @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.visionai.v1.UpdateEventRequest]. + /// 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.visionai.v1.Event] 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.visionai.v1.Event]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L71} + /// [google.cloud.visionai.v1.UpdateEventRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L699} + /// + // clang-format on + future> UpdateEvent( + google::cloud::visionai::v1::UpdateEventRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateEvent + /// + /// 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 UpdateEvent( + NoAwaitTag, + google::cloud::visionai::v1::UpdateEventRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateEvent + /// + /// 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> UpdateEvent( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Event. + /// + /// @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.visionai.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.visionai.v1.DeleteEventRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L728} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> DeleteEvent( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteEvent + /// + /// 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 DeleteEvent(NoAwaitTag, + std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single Event. + /// + /// @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.visionai.v1.DeleteEventRequest]. + /// 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.visionai.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.visionai.v1.DeleteEventRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L728} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> DeleteEvent( + google::cloud::visionai::v1::DeleteEventRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteEvent + /// + /// 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 DeleteEvent( + NoAwaitTag, + google::cloud::visionai::v1::DeleteEventRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteEvent + /// + /// 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> DeleteEvent( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Lists Series in a given project and location. + /// + /// @param parent Required. Parent value for ListSeriesRequest. + /// @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.visionai.v1.Series], 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.visionai.v1.ListSeriesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L752} + /// [google.cloud.visionai.v1.Series]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L118} + /// + // clang-format on + StreamRange ListSeries( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Series 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.visionai.v1.ListSeriesRequest]. + /// 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.visionai.v1.Series], 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.visionai.v1.ListSeriesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L752} + /// [google.cloud.visionai.v1.Series]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L118} + /// + // clang-format on + StreamRange ListSeries( + google::cloud::visionai::v1::ListSeriesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Series. + /// + /// @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.visionai.v1.Series]) + /// 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.visionai.v1.GetSeriesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L788} + /// [google.cloud.visionai.v1.Series]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L118} + /// + // clang-format on + StatusOr GetSeries( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Series. + /// + /// @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.visionai.v1.GetSeriesRequest]. + /// 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.visionai.v1.Series]) + /// 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.visionai.v1.GetSeriesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L788} + /// [google.cloud.visionai.v1.Series]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L118} + /// + // clang-format on + StatusOr GetSeries( + google::cloud::visionai::v1::GetSeriesRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Series in a given project and location. + /// + /// @param parent Required. Value for parent. + /// @param series Required. The resource being created. + /// @param series_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.visionai.v1.Series] 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.visionai.v1.CreateSeriesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L797} + /// [google.cloud.visionai.v1.Series]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L118} + /// + // clang-format on + future> CreateSeries( + std::string const& parent, + google::cloud::visionai::v1::Series const& series, + std::string const& series_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateSeries + /// + /// 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 CreateSeries( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Series const& series, + std::string const& series_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Series 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.visionai.v1.CreateSeriesRequest]. + /// 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.visionai.v1.Series] 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.visionai.v1.CreateSeriesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L797} + /// [google.cloud.visionai.v1.Series]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L118} + /// + // clang-format on + future> CreateSeries( + google::cloud::visionai::v1::CreateSeriesRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateSeries + /// + /// 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 CreateSeries( + NoAwaitTag, + google::cloud::visionai::v1::CreateSeriesRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateSeries + /// + /// 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> CreateSeries( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Event. + /// + /// @param series Required. The resource being updated + /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// Series 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.visionai.v1.Series] 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.visionai.v1.Series]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L118} + /// [google.cloud.visionai.v1.UpdateSeriesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L829} + /// + // clang-format on + future> UpdateSeries( + google::cloud::visionai::v1::Series const& series, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateSeries + /// + /// 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 UpdateSeries( + NoAwaitTag, google::cloud::visionai::v1::Series const& series, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Event. + /// + /// @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.visionai.v1.UpdateSeriesRequest]. + /// 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.visionai.v1.Series] 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.visionai.v1.Series]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L118} + /// [google.cloud.visionai.v1.UpdateSeriesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L829} + /// + // clang-format on + future> UpdateSeries( + google::cloud::visionai::v1::UpdateSeriesRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateSeries + /// + /// 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 UpdateSeries( + NoAwaitTag, + google::cloud::visionai::v1::UpdateSeriesRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateSeries + /// + /// 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> UpdateSeries( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Series. + /// + /// @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.visionai.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.visionai.v1.DeleteSeriesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L858} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> DeleteSeries( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteSeries + /// + /// 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 DeleteSeries(NoAwaitTag, + std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single Series. + /// + /// @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.visionai.v1.DeleteSeriesRequest]. + /// 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.visionai.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.visionai.v1.DeleteSeriesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L858} + /// [google.cloud.visionai.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/common.proto#L87} + /// + // clang-format on + future> DeleteSeries( + google::cloud::visionai::v1::DeleteSeriesRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteSeries + /// + /// 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 DeleteSeries( + NoAwaitTag, + google::cloud::visionai::v1::DeleteSeriesRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteSeries + /// + /// 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> DeleteSeries( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Materialize a channel. + /// + /// @param parent Required. Value for parent. + /// @param channel Required. The resource being created. + /// @param channel_id Required. Id of the channel. + /// @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.visionai.v1.Channel] 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.visionai.v1.Channel]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L155} + /// [google.cloud.visionai.v1.MaterializeChannelRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L882} + /// + // clang-format on + future> MaterializeChannel( + std::string const& parent, + google::cloud::visionai::v1::Channel const& channel, + std::string const& channel_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief MaterializeChannel + /// + /// 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 MaterializeChannel( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Channel const& channel, + std::string const& channel_id, Options opts = {}); + + // clang-format off + /// + /// Materialize a channel. + /// + /// @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.visionai.v1.MaterializeChannelRequest]. + /// 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.visionai.v1.Channel] 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.visionai.v1.Channel]: @googleapis_reference_link{google/cloud/visionai/v1/streams_resources.proto#L155} + /// [google.cloud.visionai.v1.MaterializeChannelRequest]: @googleapis_reference_link{google/cloud/visionai/v1/streams_service.proto#L882} + /// + // clang-format on + future> MaterializeChannel( + google::cloud::visionai::v1::MaterializeChannelRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief MaterializeChannel + /// + /// 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 MaterializeChannel( + NoAwaitTag, + google::cloud::visionai::v1::MaterializeChannelRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief MaterializeChannel + /// + /// 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> MaterializeChannel( + 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMS_CLIENT_H diff --git a/google/cloud/visionai/v1/streams_connection.cc b/google/cloud/visionai/v1/streams_connection.cc new file mode 100644 index 0000000000000..4a5eabca57d80 --- /dev/null +++ b/google/cloud/visionai/v1/streams_connection.cc @@ -0,0 +1,460 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#include "google/cloud/visionai/v1/streams_connection.h" +#include "google/cloud/visionai/v1/internal/streams_connection_impl.h" +#include "google/cloud/visionai/v1/internal/streams_option_defaults.h" +#include "google/cloud/visionai/v1/internal/streams_stub_factory.h" +#include "google/cloud/visionai/v1/internal/streams_tracing_connection.h" +#include "google/cloud/visionai/v1/streams_options.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 visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +StreamsServiceConnection::~StreamsServiceConnection() = default; + +StreamRange +StreamsServiceConnection::ListClusters( + google::cloud::visionai::v1:: + ListClustersRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +StreamsServiceConnection::GetCluster( + google::cloud::visionai::v1::GetClusterRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +StreamsServiceConnection::CreateCluster( + google::cloud::visionai::v1::CreateClusterRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +StreamsServiceConnection::CreateCluster( + NoAwaitTag, google::cloud::visionai::v1::CreateClusterRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::CreateCluster(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::UpdateCluster( + google::cloud::visionai::v1::UpdateClusterRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +StreamsServiceConnection::UpdateCluster( + NoAwaitTag, google::cloud::visionai::v1::UpdateClusterRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::UpdateCluster(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::DeleteCluster( + google::cloud::visionai::v1::DeleteClusterRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +StreamsServiceConnection::DeleteCluster( + NoAwaitTag, google::cloud::visionai::v1::DeleteClusterRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::DeleteCluster(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +StreamsServiceConnection::ListStreams( + google::cloud::visionai::v1:: + ListStreamsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +StreamsServiceConnection::GetStream( + google::cloud::visionai::v1::GetStreamRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +StreamsServiceConnection::CreateStream( + google::cloud::visionai::v1::CreateStreamRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr StreamsServiceConnection::CreateStream( + NoAwaitTag, google::cloud::visionai::v1::CreateStreamRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::CreateStream(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::UpdateStream( + google::cloud::visionai::v1::UpdateStreamRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr StreamsServiceConnection::UpdateStream( + NoAwaitTag, google::cloud::visionai::v1::UpdateStreamRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::UpdateStream(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::DeleteStream( + google::cloud::visionai::v1::DeleteStreamRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr StreamsServiceConnection::DeleteStream( + NoAwaitTag, google::cloud::visionai::v1::DeleteStreamRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::DeleteStream(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::GetStreamThumbnail( + google::cloud::visionai::v1::GetStreamThumbnailRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +StreamsServiceConnection::GetStreamThumbnail( + NoAwaitTag, google::cloud::visionai::v1::GetStreamThumbnailRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::GetStreamThumbnail( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +StreamsServiceConnection::GenerateStreamHlsToken( + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +StreamsServiceConnection::ListEvents( + google::cloud::visionai::v1:: + ListEventsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr StreamsServiceConnection::GetEvent( + google::cloud::visionai::v1::GetEventRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +StreamsServiceConnection::CreateEvent( + google::cloud::visionai::v1::CreateEventRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr StreamsServiceConnection::CreateEvent( + NoAwaitTag, google::cloud::visionai::v1::CreateEventRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::CreateEvent(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::UpdateEvent( + google::cloud::visionai::v1::UpdateEventRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr StreamsServiceConnection::UpdateEvent( + NoAwaitTag, google::cloud::visionai::v1::UpdateEventRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::UpdateEvent(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::DeleteEvent( + google::cloud::visionai::v1::DeleteEventRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr StreamsServiceConnection::DeleteEvent( + NoAwaitTag, google::cloud::visionai::v1::DeleteEventRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::DeleteEvent(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +StreamsServiceConnection::ListSeries( + google::cloud::visionai::v1:: + ListSeriesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +StreamsServiceConnection::GetSeries( + google::cloud::visionai::v1::GetSeriesRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +StreamsServiceConnection::CreateSeries( + google::cloud::visionai::v1::CreateSeriesRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr StreamsServiceConnection::CreateSeries( + NoAwaitTag, google::cloud::visionai::v1::CreateSeriesRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::CreateSeries(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::UpdateSeries( + google::cloud::visionai::v1::UpdateSeriesRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr StreamsServiceConnection::UpdateSeries( + NoAwaitTag, google::cloud::visionai::v1::UpdateSeriesRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::UpdateSeries(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::DeleteSeries( + google::cloud::visionai::v1::DeleteSeriesRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr StreamsServiceConnection::DeleteSeries( + NoAwaitTag, google::cloud::visionai::v1::DeleteSeriesRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::DeleteSeries(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::MaterializeChannel( + google::cloud::visionai::v1::MaterializeChannelRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +StreamsServiceConnection::MaterializeChannel( + NoAwaitTag, google::cloud::visionai::v1::MaterializeChannelRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +StreamsServiceConnection::MaterializeChannel( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +StreamsServiceConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +StreamsServiceConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +StreamsServiceConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr StreamsServiceConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status StreamsServiceConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status StreamsServiceConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeStreamsServiceConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = + visionai_v1_internal::StreamsServiceDefaultOptions(std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = visionai_v1_internal::CreateDefaultStreamsServiceStub( + std::move(auth), options); + return visionai_v1_internal::MakeStreamsServiceTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/streams_connection.h b/google/cloud/visionai/v1/streams_connection.h new file mode 100644 index 0000000000000..359f4911f1016 --- /dev/null +++ b/google/cloud/visionai/v1/streams_connection.h @@ -0,0 +1,411 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMS_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMS_CONNECTION_H + +#include "google/cloud/visionai/v1/internal/streams_retry_traits.h" +#include "google/cloud/visionai/v1/streams_connection_idempotency_policy.h" +#include "google/cloud/visionai/v1/streams_service.pb.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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `StreamsServiceConnection`. +class StreamsServiceRetryPolicy : 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 `StreamsServiceConnection` 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 StreamsServiceLimitedErrorCountRetryPolicy + : public StreamsServiceRetryPolicy { + 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 StreamsServiceLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + StreamsServiceLimitedErrorCountRetryPolicy( + StreamsServiceLimitedErrorCountRetryPolicy&& rhs) noexcept + : StreamsServiceLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + StreamsServiceLimitedErrorCountRetryPolicy( + StreamsServiceLimitedErrorCountRetryPolicy const& rhs) noexcept + : StreamsServiceLimitedErrorCountRetryPolicy(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 = StreamsServiceRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + visionai_v1_internal::StreamsServiceRetryTraits> + impl_; +}; + +/** + * A retry policy for `StreamsServiceConnection` 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 StreamsServiceLimitedTimeRetryPolicy : public StreamsServiceRetryPolicy { + 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 StreamsServiceLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + StreamsServiceLimitedTimeRetryPolicy( + StreamsServiceLimitedTimeRetryPolicy&& rhs) noexcept + : StreamsServiceLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + StreamsServiceLimitedTimeRetryPolicy( + StreamsServiceLimitedTimeRetryPolicy const& rhs) noexcept + : StreamsServiceLimitedTimeRetryPolicy(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 = StreamsServiceRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + visionai_v1_internal::StreamsServiceRetryTraits> + impl_; +}; + +/** + * The `StreamsServiceConnection` object for `StreamsServiceClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `StreamsServiceClient`. This allows users to inject custom behavior + * (e.g., with a Google Mock object) when writing tests that use objects of type + * `StreamsServiceClient`. + * + * To create a concrete instance, see `MakeStreamsServiceConnection()`. + * + * For mocking, see `visionai_v1_mocks::MockStreamsServiceConnection`. + */ +class StreamsServiceConnection { + public: + virtual ~StreamsServiceConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StreamRange ListClusters( + google::cloud::visionai::v1::ListClustersRequest request); + + virtual StatusOr GetCluster( + google::cloud::visionai::v1::GetClusterRequest const& request); + + virtual future> CreateCluster( + google::cloud::visionai::v1::CreateClusterRequest const& request); + + virtual StatusOr CreateCluster( + NoAwaitTag, + google::cloud::visionai::v1::CreateClusterRequest const& request); + + virtual future> CreateCluster( + google::longrunning::Operation const& operation); + + virtual future> UpdateCluster( + google::cloud::visionai::v1::UpdateClusterRequest const& request); + + virtual StatusOr UpdateCluster( + NoAwaitTag, + google::cloud::visionai::v1::UpdateClusterRequest const& request); + + virtual future> UpdateCluster( + google::longrunning::Operation const& operation); + + virtual future> + DeleteCluster( + google::cloud::visionai::v1::DeleteClusterRequest const& request); + + virtual StatusOr DeleteCluster( + NoAwaitTag, + google::cloud::visionai::v1::DeleteClusterRequest const& request); + + virtual future> + DeleteCluster(google::longrunning::Operation const& operation); + + virtual StreamRange ListStreams( + google::cloud::visionai::v1::ListStreamsRequest request); + + virtual StatusOr GetStream( + google::cloud::visionai::v1::GetStreamRequest const& request); + + virtual future> CreateStream( + google::cloud::visionai::v1::CreateStreamRequest const& request); + + virtual StatusOr CreateStream( + NoAwaitTag, + google::cloud::visionai::v1::CreateStreamRequest const& request); + + virtual future> CreateStream( + google::longrunning::Operation const& operation); + + virtual future> UpdateStream( + google::cloud::visionai::v1::UpdateStreamRequest const& request); + + virtual StatusOr UpdateStream( + NoAwaitTag, + google::cloud::visionai::v1::UpdateStreamRequest const& request); + + virtual future> UpdateStream( + google::longrunning::Operation const& operation); + + virtual future> + DeleteStream(google::cloud::visionai::v1::DeleteStreamRequest const& request); + + virtual StatusOr DeleteStream( + NoAwaitTag, + google::cloud::visionai::v1::DeleteStreamRequest const& request); + + virtual future> + DeleteStream(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + GetStreamThumbnail( + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request); + + virtual StatusOr GetStreamThumbnail( + NoAwaitTag, + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request); + + virtual future< + StatusOr> + GetStreamThumbnail(google::longrunning::Operation const& operation); + + virtual StatusOr + GenerateStreamHlsToken( + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& + request); + + virtual StreamRange ListEvents( + google::cloud::visionai::v1::ListEventsRequest request); + + virtual StatusOr GetEvent( + google::cloud::visionai::v1::GetEventRequest const& request); + + virtual future> CreateEvent( + google::cloud::visionai::v1::CreateEventRequest const& request); + + virtual StatusOr CreateEvent( + NoAwaitTag, + google::cloud::visionai::v1::CreateEventRequest const& request); + + virtual future> CreateEvent( + google::longrunning::Operation const& operation); + + virtual future> UpdateEvent( + google::cloud::visionai::v1::UpdateEventRequest const& request); + + virtual StatusOr UpdateEvent( + NoAwaitTag, + google::cloud::visionai::v1::UpdateEventRequest const& request); + + virtual future> UpdateEvent( + google::longrunning::Operation const& operation); + + virtual future> + DeleteEvent(google::cloud::visionai::v1::DeleteEventRequest const& request); + + virtual StatusOr DeleteEvent( + NoAwaitTag, + google::cloud::visionai::v1::DeleteEventRequest const& request); + + virtual future> + DeleteEvent(google::longrunning::Operation const& operation); + + virtual StreamRange ListSeries( + google::cloud::visionai::v1::ListSeriesRequest request); + + virtual StatusOr GetSeries( + google::cloud::visionai::v1::GetSeriesRequest const& request); + + virtual future> CreateSeries( + google::cloud::visionai::v1::CreateSeriesRequest const& request); + + virtual StatusOr CreateSeries( + NoAwaitTag, + google::cloud::visionai::v1::CreateSeriesRequest const& request); + + virtual future> CreateSeries( + google::longrunning::Operation const& operation); + + virtual future> UpdateSeries( + google::cloud::visionai::v1::UpdateSeriesRequest const& request); + + virtual StatusOr UpdateSeries( + NoAwaitTag, + google::cloud::visionai::v1::UpdateSeriesRequest const& request); + + virtual future> UpdateSeries( + google::longrunning::Operation const& operation); + + virtual future> + DeleteSeries(google::cloud::visionai::v1::DeleteSeriesRequest const& request); + + virtual StatusOr DeleteSeries( + NoAwaitTag, + google::cloud::visionai::v1::DeleteSeriesRequest const& request); + + virtual future> + DeleteSeries(google::longrunning::Operation const& operation); + + virtual future> + MaterializeChannel( + google::cloud::visionai::v1::MaterializeChannelRequest const& request); + + virtual StatusOr MaterializeChannel( + NoAwaitTag, + google::cloud::visionai::v1::MaterializeChannelRequest const& request); + + virtual future> + MaterializeChannel(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 `StreamsServiceConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of StreamsServiceClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `StreamsServiceConnection`. Expected options are any of the types in + * the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::visionai_v1::StreamsServicePolicyOptionList` + * + * @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 `StreamsServiceConnection` created by + * this function. + */ +std::shared_ptr MakeStreamsServiceConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMS_CONNECTION_H diff --git a/google/cloud/visionai/v1/streams_connection_idempotency_policy.cc b/google/cloud/visionai/v1/streams_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..37b16b6199ed3 --- /dev/null +++ b/google/cloud/visionai/v1/streams_connection_idempotency_policy.cc @@ -0,0 +1,190 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#include "google/cloud/visionai/v1/streams_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +StreamsServiceConnectionIdempotencyPolicy:: + ~StreamsServiceConnectionIdempotencyPolicy() = default; + +std::unique_ptr +StreamsServiceConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::ListClusters( + google::cloud::visionai::v1::ListClustersRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::GetCluster( + google::cloud::visionai::v1::GetClusterRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::CreateCluster( + google::cloud::visionai::v1::CreateClusterRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::UpdateCluster( + google::cloud::visionai::v1::UpdateClusterRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::DeleteCluster( + google::cloud::visionai::v1::DeleteClusterRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::ListStreams( + google::cloud::visionai::v1::ListStreamsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::GetStream( + google::cloud::visionai::v1::GetStreamRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::CreateStream( + google::cloud::visionai::v1::CreateStreamRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::UpdateStream( + google::cloud::visionai::v1::UpdateStreamRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::DeleteStream( + google::cloud::visionai::v1::DeleteStreamRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::GetStreamThumbnail( + google::cloud::visionai::v1::GetStreamThumbnailRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::GenerateStreamHlsToken( + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::ListEvents( + google::cloud::visionai::v1::ListEventsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::GetEvent( + google::cloud::visionai::v1::GetEventRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::CreateEvent( + google::cloud::visionai::v1::CreateEventRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::UpdateEvent( + google::cloud::visionai::v1::UpdateEventRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::DeleteEvent( + google::cloud::visionai::v1::DeleteEventRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::ListSeries( + google::cloud::visionai::v1::ListSeriesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::GetSeries( + google::cloud::visionai::v1::GetSeriesRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::CreateSeries( + google::cloud::visionai::v1::CreateSeriesRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::UpdateSeries( + google::cloud::visionai::v1::UpdateSeriesRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::DeleteSeries( + google::cloud::visionai::v1::DeleteSeriesRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::MaterializeChannel( + google::cloud::visionai::v1::MaterializeChannelRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency StreamsServiceConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultStreamsServiceConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/streams_connection_idempotency_policy.h b/google/cloud/visionai/v1/streams_connection_idempotency_policy.h new file mode 100644 index 0000000000000..2894d8f5883d0 --- /dev/null +++ b/google/cloud/visionai/v1/streams_connection_idempotency_policy.h @@ -0,0 +1,139 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMS_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMS_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/streams_service.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class StreamsServiceConnectionIdempotencyPolicy { + public: + virtual ~StreamsServiceConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() + const; + + virtual google::cloud::Idempotency ListClusters( + google::cloud::visionai::v1::ListClustersRequest request); + + virtual google::cloud::Idempotency GetCluster( + google::cloud::visionai::v1::GetClusterRequest const& request); + + virtual google::cloud::Idempotency CreateCluster( + google::cloud::visionai::v1::CreateClusterRequest const& request); + + virtual google::cloud::Idempotency UpdateCluster( + google::cloud::visionai::v1::UpdateClusterRequest const& request); + + virtual google::cloud::Idempotency DeleteCluster( + google::cloud::visionai::v1::DeleteClusterRequest const& request); + + virtual google::cloud::Idempotency ListStreams( + google::cloud::visionai::v1::ListStreamsRequest request); + + virtual google::cloud::Idempotency GetStream( + google::cloud::visionai::v1::GetStreamRequest const& request); + + virtual google::cloud::Idempotency CreateStream( + google::cloud::visionai::v1::CreateStreamRequest const& request); + + virtual google::cloud::Idempotency UpdateStream( + google::cloud::visionai::v1::UpdateStreamRequest const& request); + + virtual google::cloud::Idempotency DeleteStream( + google::cloud::visionai::v1::DeleteStreamRequest const& request); + + virtual google::cloud::Idempotency GetStreamThumbnail( + google::cloud::visionai::v1::GetStreamThumbnailRequest const& request); + + virtual google::cloud::Idempotency GenerateStreamHlsToken( + google::cloud::visionai::v1::GenerateStreamHlsTokenRequest const& + request); + + virtual google::cloud::Idempotency ListEvents( + google::cloud::visionai::v1::ListEventsRequest request); + + virtual google::cloud::Idempotency GetEvent( + google::cloud::visionai::v1::GetEventRequest const& request); + + virtual google::cloud::Idempotency CreateEvent( + google::cloud::visionai::v1::CreateEventRequest const& request); + + virtual google::cloud::Idempotency UpdateEvent( + google::cloud::visionai::v1::UpdateEventRequest const& request); + + virtual google::cloud::Idempotency DeleteEvent( + google::cloud::visionai::v1::DeleteEventRequest const& request); + + virtual google::cloud::Idempotency ListSeries( + google::cloud::visionai::v1::ListSeriesRequest request); + + virtual google::cloud::Idempotency GetSeries( + google::cloud::visionai::v1::GetSeriesRequest const& request); + + virtual google::cloud::Idempotency CreateSeries( + google::cloud::visionai::v1::CreateSeriesRequest const& request); + + virtual google::cloud::Idempotency UpdateSeries( + google::cloud::visionai::v1::UpdateSeriesRequest const& request); + + virtual google::cloud::Idempotency DeleteSeries( + google::cloud::visionai::v1::DeleteSeriesRequest const& request); + + virtual google::cloud::Idempotency MaterializeChannel( + google::cloud::visionai::v1::MaterializeChannelRequest 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 +MakeDefaultStreamsServiceConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMS_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/visionai/v1/streams_options.h b/google/cloud/visionai/v1/streams_options.h new file mode 100644 index 0000000000000..8aa8457921be6 --- /dev/null +++ b/google/cloud/visionai/v1/streams_options.h @@ -0,0 +1,87 @@ +// Copyright 2026 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/visionai/v1/streams_service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMS_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMS_OPTIONS_H + +#include "google/cloud/visionai/v1/streams_connection.h" +#include "google/cloud/visionai/v1/streams_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 visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-visionai-options + */ +struct StreamsServiceRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-visionai-options + */ +struct StreamsServiceBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-visionai-options + */ +struct StreamsServiceConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-visionai-options + */ +struct StreamsServicePollingPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to StreamsService. + * + * @ingroup google-cloud-visionai-options + */ +using StreamsServicePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_STREAMS_OPTIONS_H diff --git a/google/cloud/visionai/v1/warehouse_client.cc b/google/cloud/visionai/v1/warehouse_client.cc new file mode 100644 index 0000000000000..37354023d6f25 --- /dev/null +++ b/google/cloud/visionai/v1/warehouse_client.cc @@ -0,0 +1,1402 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#include "google/cloud/visionai/v1/warehouse_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WarehouseClient::WarehouseClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +WarehouseClient::~WarehouseClient() = default; + +StatusOr WarehouseClient::CreateAsset( + std::string const& parent, google::cloud::visionai::v1::Asset const& asset, + std::string const& asset_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateAssetRequest request; + request.set_parent(parent); + *request.mutable_asset() = asset; + request.set_asset_id(asset_id); + return connection_->CreateAsset(request); +} + +StatusOr WarehouseClient::CreateAsset( + google::cloud::visionai::v1::CreateAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateAsset(request); +} + +StatusOr WarehouseClient::UpdateAsset( + google::cloud::visionai::v1::Asset const& asset, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateAssetRequest request; + *request.mutable_asset() = asset; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateAsset(request); +} + +StatusOr WarehouseClient::UpdateAsset( + google::cloud::visionai::v1::UpdateAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateAsset(request); +} + +StatusOr WarehouseClient::GetAsset( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetAssetRequest request; + request.set_name(name); + return connection_->GetAsset(request); +} + +StatusOr WarehouseClient::GetAsset( + google::cloud::visionai::v1::GetAssetRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetAsset(request); +} + +StreamRange WarehouseClient::ListAssets( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListAssetsRequest request; + request.set_parent(parent); + return connection_->ListAssets(request); +} + +StreamRange WarehouseClient::ListAssets( + google::cloud::visionai::v1::ListAssetsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListAssets(std::move(request)); +} + +future> +WarehouseClient::DeleteAsset(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteAssetRequest request; + request.set_name(name); + return connection_->DeleteAsset(request); +} + +StatusOr WarehouseClient::DeleteAsset( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteAssetRequest request; + request.set_name(name); + return connection_->DeleteAsset(NoAwaitTag{}, request); +} + +future> +WarehouseClient::DeleteAsset( + google::cloud::visionai::v1::DeleteAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteAsset(request); +} + +StatusOr WarehouseClient::DeleteAsset( + NoAwaitTag, google::cloud::visionai::v1::DeleteAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteAsset(NoAwaitTag{}, request); +} + +future> +WarehouseClient::DeleteAsset(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteAsset(operation); +} + +future> +WarehouseClient::UploadAsset( + google::cloud::visionai::v1::UploadAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UploadAsset(request); +} + +StatusOr WarehouseClient::UploadAsset( + NoAwaitTag, google::cloud::visionai::v1::UploadAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UploadAsset(NoAwaitTag{}, request); +} + +future> +WarehouseClient::UploadAsset(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UploadAsset(operation); +} + +StatusOr +WarehouseClient::GenerateRetrievalUrl( + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GenerateRetrievalUrl(request); +} + +future> +WarehouseClient::AnalyzeAsset( + google::cloud::visionai::v1::AnalyzeAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AnalyzeAsset(request); +} + +StatusOr WarehouseClient::AnalyzeAsset( + NoAwaitTag, google::cloud::visionai::v1::AnalyzeAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AnalyzeAsset(NoAwaitTag{}, request); +} + +future> +WarehouseClient::AnalyzeAsset(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AnalyzeAsset(operation); +} + +future> +WarehouseClient::IndexAsset( + google::cloud::visionai::v1::IndexAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->IndexAsset(request); +} + +StatusOr WarehouseClient::IndexAsset( + NoAwaitTag, google::cloud::visionai::v1::IndexAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->IndexAsset(NoAwaitTag{}, request); +} + +future> +WarehouseClient::IndexAsset(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->IndexAsset(operation); +} + +future> +WarehouseClient::RemoveIndexAsset( + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RemoveIndexAsset(request); +} + +StatusOr WarehouseClient::RemoveIndexAsset( + NoAwaitTag, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RemoveIndexAsset(NoAwaitTag{}, request); +} + +future> +WarehouseClient::RemoveIndexAsset( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RemoveIndexAsset(operation); +} + +StreamRange +WarehouseClient::ViewIndexedAssets(std::string const& index, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ViewIndexedAssetsRequest request; + request.set_index(index); + return connection_->ViewIndexedAssets(request); +} + +StreamRange +WarehouseClient::ViewIndexedAssets( + google::cloud::visionai::v1::ViewIndexedAssetsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ViewIndexedAssets(std::move(request)); +} + +future> +WarehouseClient::CreateIndex(std::string const& parent, + google::cloud::visionai::v1::Index const& index, + std::string const& index_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateIndexRequest request; + request.set_parent(parent); + *request.mutable_index() = index; + request.set_index_id(index_id); + return connection_->CreateIndex(request); +} + +StatusOr WarehouseClient::CreateIndex( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Index const& index, + std::string const& index_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateIndexRequest request; + request.set_parent(parent); + *request.mutable_index() = index; + request.set_index_id(index_id); + return connection_->CreateIndex(NoAwaitTag{}, request); +} + +future> +WarehouseClient::CreateIndex( + google::cloud::visionai::v1::CreateIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateIndex(request); +} + +StatusOr WarehouseClient::CreateIndex( + NoAwaitTag, google::cloud::visionai::v1::CreateIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateIndex(NoAwaitTag{}, request); +} + +future> +WarehouseClient::CreateIndex(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateIndex(operation); +} + +future> +WarehouseClient::UpdateIndex(google::cloud::visionai::v1::Index const& index, + google::protobuf::FieldMask const& update_mask, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateIndexRequest request; + *request.mutable_index() = index; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateIndex(request); +} + +StatusOr WarehouseClient::UpdateIndex( + NoAwaitTag, google::cloud::visionai::v1::Index const& index, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateIndexRequest request; + *request.mutable_index() = index; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateIndex(NoAwaitTag{}, request); +} + +future> +WarehouseClient::UpdateIndex( + google::cloud::visionai::v1::UpdateIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateIndex(request); +} + +StatusOr WarehouseClient::UpdateIndex( + NoAwaitTag, google::cloud::visionai::v1::UpdateIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateIndex(NoAwaitTag{}, request); +} + +future> +WarehouseClient::UpdateIndex(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateIndex(operation); +} + +StatusOr WarehouseClient::GetIndex( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetIndexRequest request; + request.set_name(name); + return connection_->GetIndex(request); +} + +StatusOr WarehouseClient::GetIndex( + google::cloud::visionai::v1::GetIndexRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetIndex(request); +} + +StreamRange WarehouseClient::ListIndexes( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListIndexesRequest request; + request.set_parent(parent); + return connection_->ListIndexes(request); +} + +StreamRange WarehouseClient::ListIndexes( + google::cloud::visionai::v1::ListIndexesRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListIndexes(std::move(request)); +} + +future> +WarehouseClient::DeleteIndex(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteIndexRequest request; + request.set_name(name); + return connection_->DeleteIndex(request); +} + +StatusOr WarehouseClient::DeleteIndex( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteIndexRequest request; + request.set_name(name); + return connection_->DeleteIndex(NoAwaitTag{}, request); +} + +future> +WarehouseClient::DeleteIndex( + google::cloud::visionai::v1::DeleteIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteIndex(request); +} + +StatusOr WarehouseClient::DeleteIndex( + NoAwaitTag, google::cloud::visionai::v1::DeleteIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteIndex(NoAwaitTag{}, request); +} + +future> +WarehouseClient::DeleteIndex(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteIndex(operation); +} + +future> +WarehouseClient::CreateCorpus(std::string const& parent, + google::cloud::visionai::v1::Corpus const& corpus, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateCorpusRequest request; + request.set_parent(parent); + *request.mutable_corpus() = corpus; + return connection_->CreateCorpus(request); +} + +StatusOr WarehouseClient::CreateCorpus( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Corpus const& corpus, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateCorpusRequest request; + request.set_parent(parent); + *request.mutable_corpus() = corpus; + return connection_->CreateCorpus(NoAwaitTag{}, request); +} + +future> +WarehouseClient::CreateCorpus( + google::cloud::visionai::v1::CreateCorpusRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCorpus(request); +} + +StatusOr WarehouseClient::CreateCorpus( + NoAwaitTag, google::cloud::visionai::v1::CreateCorpusRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCorpus(NoAwaitTag{}, request); +} + +future> +WarehouseClient::CreateCorpus(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCorpus(operation); +} + +StatusOr WarehouseClient::GetCorpus( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetCorpusRequest request; + request.set_name(name); + return connection_->GetCorpus(request); +} + +StatusOr WarehouseClient::GetCorpus( + google::cloud::visionai::v1::GetCorpusRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetCorpus(request); +} + +StatusOr WarehouseClient::UpdateCorpus( + google::cloud::visionai::v1::Corpus const& corpus, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateCorpusRequest request; + *request.mutable_corpus() = corpus; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateCorpus(request); +} + +StatusOr WarehouseClient::UpdateCorpus( + google::cloud::visionai::v1::UpdateCorpusRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateCorpus(request); +} + +StreamRange WarehouseClient::ListCorpora( + std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListCorporaRequest request; + request.set_parent(parent); + return connection_->ListCorpora(request); +} + +StreamRange WarehouseClient::ListCorpora( + google::cloud::visionai::v1::ListCorporaRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListCorpora(std::move(request)); +} + +Status WarehouseClient::DeleteCorpus(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteCorpusRequest request; + request.set_name(name); + return connection_->DeleteCorpus(request); +} + +Status WarehouseClient::DeleteCorpus( + google::cloud::visionai::v1::DeleteCorpusRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCorpus(request); +} + +future> +WarehouseClient::AnalyzeCorpus( + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AnalyzeCorpus(request); +} + +StatusOr WarehouseClient::AnalyzeCorpus( + NoAwaitTag, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AnalyzeCorpus(NoAwaitTag{}, request); +} + +future> +WarehouseClient::AnalyzeCorpus(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AnalyzeCorpus(operation); +} + +StatusOr +WarehouseClient::CreateDataSchema( + std::string const& parent, + google::cloud::visionai::v1::DataSchema const& data_schema, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateDataSchemaRequest request; + request.set_parent(parent); + *request.mutable_data_schema() = data_schema; + return connection_->CreateDataSchema(request); +} + +StatusOr +WarehouseClient::CreateDataSchema( + google::cloud::visionai::v1::CreateDataSchemaRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateDataSchema(request); +} + +StatusOr +WarehouseClient::UpdateDataSchema( + google::cloud::visionai::v1::DataSchema const& data_schema, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateDataSchemaRequest request; + *request.mutable_data_schema() = data_schema; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateDataSchema(request); +} + +StatusOr +WarehouseClient::UpdateDataSchema( + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateDataSchema(request); +} + +StatusOr +WarehouseClient::GetDataSchema(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetDataSchemaRequest request; + request.set_name(name); + return connection_->GetDataSchema(request); +} + +StatusOr +WarehouseClient::GetDataSchema( + google::cloud::visionai::v1::GetDataSchemaRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetDataSchema(request); +} + +Status WarehouseClient::DeleteDataSchema(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteDataSchemaRequest request; + request.set_name(name); + return connection_->DeleteDataSchema(request); +} + +Status WarehouseClient::DeleteDataSchema( + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteDataSchema(request); +} + +StreamRange +WarehouseClient::ListDataSchemas(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListDataSchemasRequest request; + request.set_parent(parent); + return connection_->ListDataSchemas(request); +} + +StreamRange +WarehouseClient::ListDataSchemas( + google::cloud::visionai::v1::ListDataSchemasRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListDataSchemas(std::move(request)); +} + +StatusOr +WarehouseClient::CreateAnnotation( + std::string const& parent, + google::cloud::visionai::v1::Annotation const& annotation, + std::string const& annotation_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateAnnotationRequest request; + request.set_parent(parent); + *request.mutable_annotation() = annotation; + request.set_annotation_id(annotation_id); + return connection_->CreateAnnotation(request); +} + +StatusOr +WarehouseClient::CreateAnnotation( + google::cloud::visionai::v1::CreateAnnotationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateAnnotation(request); +} + +StatusOr +WarehouseClient::GetAnnotation(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetAnnotationRequest request; + request.set_name(name); + return connection_->GetAnnotation(request); +} + +StatusOr +WarehouseClient::GetAnnotation( + google::cloud::visionai::v1::GetAnnotationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetAnnotation(request); +} + +StreamRange +WarehouseClient::ListAnnotations(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListAnnotationsRequest request; + request.set_parent(parent); + return connection_->ListAnnotations(request); +} + +StreamRange +WarehouseClient::ListAnnotations( + google::cloud::visionai::v1::ListAnnotationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListAnnotations(std::move(request)); +} + +StatusOr +WarehouseClient::UpdateAnnotation( + google::cloud::visionai::v1::Annotation const& annotation, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateAnnotationRequest request; + *request.mutable_annotation() = annotation; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateAnnotation(request); +} + +StatusOr +WarehouseClient::UpdateAnnotation( + google::cloud::visionai::v1::UpdateAnnotationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateAnnotation(request); +} + +Status WarehouseClient::DeleteAnnotation(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteAnnotationRequest request; + request.set_name(name); + return connection_->DeleteAnnotation(request); +} + +Status WarehouseClient::DeleteAnnotation( + google::cloud::visionai::v1::DeleteAnnotationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteAnnotation(request); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> +WarehouseClient::AsyncIngestAsset(Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AsyncIngestAsset(); +} + +StatusOr +WarehouseClient::ClipAsset( + google::cloud::visionai::v1::ClipAssetRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ClipAsset(request); +} + +StatusOr +WarehouseClient::GenerateHlsUri( + google::cloud::visionai::v1::GenerateHlsUriRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GenerateHlsUri(request); +} + +future> +WarehouseClient::ImportAssets( + google::cloud::visionai::v1::ImportAssetsRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ImportAssets(request); +} + +StatusOr WarehouseClient::ImportAssets( + NoAwaitTag, google::cloud::visionai::v1::ImportAssetsRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ImportAssets(NoAwaitTag{}, request); +} + +future> +WarehouseClient::ImportAssets(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ImportAssets(operation); +} + +StatusOr +WarehouseClient::CreateSearchConfig( + std::string const& parent, + google::cloud::visionai::v1::SearchConfig const& search_config, + std::string const& search_config_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateSearchConfigRequest request; + request.set_parent(parent); + *request.mutable_search_config() = search_config; + request.set_search_config_id(search_config_id); + return connection_->CreateSearchConfig(request); +} + +StatusOr +WarehouseClient::CreateSearchConfig( + google::cloud::visionai::v1::CreateSearchConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateSearchConfig(request); +} + +StatusOr +WarehouseClient::UpdateSearchConfig( + google::cloud::visionai::v1::SearchConfig const& search_config, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateSearchConfigRequest request; + *request.mutable_search_config() = search_config; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateSearchConfig(request); +} + +StatusOr +WarehouseClient::UpdateSearchConfig( + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateSearchConfig(request); +} + +StatusOr +WarehouseClient::GetSearchConfig(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetSearchConfigRequest request; + request.set_name(name); + return connection_->GetSearchConfig(request); +} + +StatusOr +WarehouseClient::GetSearchConfig( + google::cloud::visionai::v1::GetSearchConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetSearchConfig(request); +} + +Status WarehouseClient::DeleteSearchConfig(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteSearchConfigRequest request; + request.set_name(name); + return connection_->DeleteSearchConfig(request); +} + +Status WarehouseClient::DeleteSearchConfig( + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteSearchConfig(request); +} + +StreamRange +WarehouseClient::ListSearchConfigs(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListSearchConfigsRequest request; + request.set_parent(parent); + return connection_->ListSearchConfigs(request); +} + +StreamRange +WarehouseClient::ListSearchConfigs( + google::cloud::visionai::v1::ListSearchConfigsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListSearchConfigs(std::move(request)); +} + +StatusOr +WarehouseClient::CreateSearchHypernym( + std::string const& parent, + google::cloud::visionai::v1::SearchHypernym const& search_hypernym, + std::string const& search_hypernym_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateSearchHypernymRequest request; + request.set_parent(parent); + *request.mutable_search_hypernym() = search_hypernym; + request.set_search_hypernym_id(search_hypernym_id); + return connection_->CreateSearchHypernym(request); +} + +StatusOr +WarehouseClient::CreateSearchHypernym( + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateSearchHypernym(request); +} + +StatusOr +WarehouseClient::UpdateSearchHypernym( + google::cloud::visionai::v1::SearchHypernym const& search_hypernym, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateSearchHypernymRequest request; + *request.mutable_search_hypernym() = search_hypernym; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateSearchHypernym(request); +} + +StatusOr +WarehouseClient::UpdateSearchHypernym( + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateSearchHypernym(request); +} + +StatusOr +WarehouseClient::GetSearchHypernym(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetSearchHypernymRequest request; + request.set_name(name); + return connection_->GetSearchHypernym(request); +} + +StatusOr +WarehouseClient::GetSearchHypernym( + google::cloud::visionai::v1::GetSearchHypernymRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetSearchHypernym(request); +} + +Status WarehouseClient::DeleteSearchHypernym(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteSearchHypernymRequest request; + request.set_name(name); + return connection_->DeleteSearchHypernym(request); +} + +Status WarehouseClient::DeleteSearchHypernym( + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteSearchHypernym(request); +} + +StreamRange +WarehouseClient::ListSearchHypernyms(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListSearchHypernymsRequest request; + request.set_parent(parent); + return connection_->ListSearchHypernyms(request); +} + +StreamRange +WarehouseClient::ListSearchHypernyms( + google::cloud::visionai::v1::ListSearchHypernymsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListSearchHypernyms(std::move(request)); +} + +StreamRange +WarehouseClient::SearchAssets( + google::cloud::visionai::v1::SearchAssetsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->SearchAssets(std::move(request)); +} + +StreamRange +WarehouseClient::SearchIndexEndpoint( + google::cloud::visionai::v1::SearchIndexEndpointRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->SearchIndexEndpoint(std::move(request)); +} + +future> +WarehouseClient::CreateIndexEndpoint( + std::string const& parent, + google::cloud::visionai::v1::IndexEndpoint const& index_endpoint, + std::string const& index_endpoint_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateIndexEndpointRequest request; + request.set_parent(parent); + *request.mutable_index_endpoint() = index_endpoint; + request.set_index_endpoint_id(index_endpoint_id); + return connection_->CreateIndexEndpoint(request); +} + +StatusOr WarehouseClient::CreateIndexEndpoint( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::IndexEndpoint const& index_endpoint, + std::string const& index_endpoint_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateIndexEndpointRequest request; + request.set_parent(parent); + *request.mutable_index_endpoint() = index_endpoint; + request.set_index_endpoint_id(index_endpoint_id); + return connection_->CreateIndexEndpoint(NoAwaitTag{}, request); +} + +future> +WarehouseClient::CreateIndexEndpoint( + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateIndexEndpoint(request); +} + +StatusOr WarehouseClient::CreateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateIndexEndpoint(NoAwaitTag{}, request); +} + +future> +WarehouseClient::CreateIndexEndpoint( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateIndexEndpoint(operation); +} + +StatusOr +WarehouseClient::GetIndexEndpoint(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetIndexEndpointRequest request; + request.set_name(name); + return connection_->GetIndexEndpoint(request); +} + +StatusOr +WarehouseClient::GetIndexEndpoint( + google::cloud::visionai::v1::GetIndexEndpointRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetIndexEndpoint(request); +} + +StreamRange +WarehouseClient::ListIndexEndpoints(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListIndexEndpointsRequest request; + request.set_parent(parent); + return connection_->ListIndexEndpoints(request); +} + +StreamRange +WarehouseClient::ListIndexEndpoints( + google::cloud::visionai::v1::ListIndexEndpointsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListIndexEndpoints(std::move(request)); +} + +future> +WarehouseClient::UpdateIndexEndpoint( + google::cloud::visionai::v1::IndexEndpoint const& index_endpoint, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateIndexEndpointRequest request; + *request.mutable_index_endpoint() = index_endpoint; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateIndexEndpoint(request); +} + +StatusOr WarehouseClient::UpdateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::IndexEndpoint const& index_endpoint, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateIndexEndpointRequest request; + *request.mutable_index_endpoint() = index_endpoint; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateIndexEndpoint(NoAwaitTag{}, request); +} + +future> +WarehouseClient::UpdateIndexEndpoint( + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateIndexEndpoint(request); +} + +StatusOr WarehouseClient::UpdateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateIndexEndpoint(NoAwaitTag{}, request); +} + +future> +WarehouseClient::UpdateIndexEndpoint( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateIndexEndpoint(operation); +} + +future> +WarehouseClient::DeleteIndexEndpoint(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteIndexEndpointRequest request; + request.set_name(name); + return connection_->DeleteIndexEndpoint(request); +} + +StatusOr WarehouseClient::DeleteIndexEndpoint( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteIndexEndpointRequest request; + request.set_name(name); + return connection_->DeleteIndexEndpoint(NoAwaitTag{}, request); +} + +future> +WarehouseClient::DeleteIndexEndpoint( + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteIndexEndpoint(request); +} + +StatusOr WarehouseClient::DeleteIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteIndexEndpoint(NoAwaitTag{}, request); +} + +future> +WarehouseClient::DeleteIndexEndpoint( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteIndexEndpoint(operation); +} + +future> +WarehouseClient::DeployIndex( + google::cloud::visionai::v1::DeployIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeployIndex(request); +} + +StatusOr WarehouseClient::DeployIndex( + NoAwaitTag, google::cloud::visionai::v1::DeployIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeployIndex(NoAwaitTag{}, request); +} + +future> +WarehouseClient::DeployIndex(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeployIndex(operation); +} + +future> +WarehouseClient::UndeployIndex( + google::cloud::visionai::v1::UndeployIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UndeployIndex(request); +} + +StatusOr WarehouseClient::UndeployIndex( + NoAwaitTag, + google::cloud::visionai::v1::UndeployIndexRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UndeployIndex(NoAwaitTag{}, request); +} + +future> +WarehouseClient::UndeployIndex(google::longrunning::Operation const& operation, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UndeployIndex(operation); +} + +future> +WarehouseClient::CreateCollection( + std::string const& parent, + google::cloud::visionai::v1::Collection const& collection, + std::string const& collection_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateCollectionRequest request; + request.set_parent(parent); + *request.mutable_collection() = collection; + request.set_collection_id(collection_id); + return connection_->CreateCollection(request); +} + +StatusOr WarehouseClient::CreateCollection( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Collection const& collection, + std::string const& collection_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::CreateCollectionRequest request; + request.set_parent(parent); + *request.mutable_collection() = collection; + request.set_collection_id(collection_id); + return connection_->CreateCollection(NoAwaitTag{}, request); +} + +future> +WarehouseClient::CreateCollection( + google::cloud::visionai::v1::CreateCollectionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCollection(request); +} + +StatusOr WarehouseClient::CreateCollection( + NoAwaitTag, + google::cloud::visionai::v1::CreateCollectionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCollection(NoAwaitTag{}, request); +} + +future> +WarehouseClient::CreateCollection( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateCollection(operation); +} + +future> +WarehouseClient::DeleteCollection(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteCollectionRequest request; + request.set_name(name); + return connection_->DeleteCollection(request); +} + +StatusOr WarehouseClient::DeleteCollection( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::DeleteCollectionRequest request; + request.set_name(name); + return connection_->DeleteCollection(NoAwaitTag{}, request); +} + +future> +WarehouseClient::DeleteCollection( + google::cloud::visionai::v1::DeleteCollectionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCollection(request); +} + +StatusOr WarehouseClient::DeleteCollection( + NoAwaitTag, + google::cloud::visionai::v1::DeleteCollectionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCollection(NoAwaitTag{}, request); +} + +future> +WarehouseClient::DeleteCollection( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteCollection(operation); +} + +StatusOr +WarehouseClient::GetCollection(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::GetCollectionRequest request; + request.set_name(name); + return connection_->GetCollection(request); +} + +StatusOr +WarehouseClient::GetCollection( + google::cloud::visionai::v1::GetCollectionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetCollection(request); +} + +StatusOr +WarehouseClient::UpdateCollection( + google::cloud::visionai::v1::Collection const& collection, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::UpdateCollectionRequest request; + *request.mutable_collection() = collection; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateCollection(request); +} + +StatusOr +WarehouseClient::UpdateCollection( + google::cloud::visionai::v1::UpdateCollectionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateCollection(request); +} + +StreamRange +WarehouseClient::ListCollections(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ListCollectionsRequest request; + request.set_parent(parent); + return connection_->ListCollections(request); +} + +StreamRange +WarehouseClient::ListCollections( + google::cloud::visionai::v1::ListCollectionsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListCollections(std::move(request)); +} + +StatusOr +WarehouseClient::AddCollectionItem( + google::cloud::visionai::v1::CollectionItem const& item, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::AddCollectionItemRequest request; + *request.mutable_item() = item; + return connection_->AddCollectionItem(request); +} + +StatusOr +WarehouseClient::AddCollectionItem( + google::cloud::visionai::v1::AddCollectionItemRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AddCollectionItem(request); +} + +StatusOr +WarehouseClient::RemoveCollectionItem( + google::cloud::visionai::v1::CollectionItem const& item, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::RemoveCollectionItemRequest request; + *request.mutable_item() = item; + return connection_->RemoveCollectionItem(request); +} + +StatusOr +WarehouseClient::RemoveCollectionItem( + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RemoveCollectionItem(request); +} + +StreamRange +WarehouseClient::ViewCollectionItems(std::string const& collection, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::visionai::v1::ViewCollectionItemsRequest request; + request.set_collection(collection); + return connection_->ViewCollectionItems(request); +} + +StreamRange +WarehouseClient::ViewCollectionItems( + google::cloud::visionai::v1::ViewCollectionItemsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ViewCollectionItems(std::move(request)); +} + +StreamRange WarehouseClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr WarehouseClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange WarehouseClient::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 WarehouseClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr WarehouseClient::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 WarehouseClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status WarehouseClient::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 WarehouseClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status WarehouseClient::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 WarehouseClient::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 visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/warehouse_client.h b/google/cloud/visionai/v1/warehouse_client.h new file mode 100644 index 0000000000000..7272d57939be3 --- /dev/null +++ b/google/cloud/visionai/v1/warehouse_client.h @@ -0,0 +1,4943 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_WAREHOUSE_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_WAREHOUSE_CLIENT_H + +#include "google/cloud/visionai/v1/warehouse_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 "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// Service that manages media content + metadata for streaming. +/// +/// @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 WarehouseClient { + public: + explicit WarehouseClient(std::shared_ptr connection, + Options opts = {}); + ~WarehouseClient(); + + ///@{ + /// @name Copy and move support + WarehouseClient(WarehouseClient const&) = default; + WarehouseClient& operator=(WarehouseClient const&) = default; + WarehouseClient(WarehouseClient&&) = default; + WarehouseClient& operator=(WarehouseClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(WarehouseClient const& a, WarehouseClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(WarehouseClient const& a, WarehouseClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Creates an asset inside corpus. + /// + /// @param parent Required. The parent resource where this asset will be created. + /// Format: + /// `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + /// @param asset Required. The asset to create. + /// @param asset_id Optional. The ID to use for the asset, which will become the final + /// component of the asset's resource name if user choose to specify. + /// Otherwise, asset id will be generated by system. + /// @n + /// This value should be up to 63 characters, and valid characters + /// are /[a-z][0-9]-/. The first character must be a letter, the last could be + /// a letter or a number. + /// @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.visionai.v1.Asset]) + /// 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.visionai.v1.Asset]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L916} + /// [google.cloud.visionai.v1.CreateAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L748} + /// + // clang-format on + StatusOr CreateAsset( + std::string const& parent, + google::cloud::visionai::v1::Asset const& asset, + std::string const& asset_id, Options opts = {}); + + // clang-format off + /// + /// Creates an asset inside corpus. + /// + /// @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.visionai.v1.CreateAssetRequest]. + /// 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.visionai.v1.Asset]) + /// 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.visionai.v1.Asset]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L916} + /// [google.cloud.visionai.v1.CreateAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L748} + /// + // clang-format on + StatusOr CreateAsset( + google::cloud::visionai::v1::CreateAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates an asset inside corpus. + /// + /// @param asset Required. The asset to update. + /// @n + /// The asset's `name` field is used to identify the asset to be updated. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + /// @param update_mask The list of fields to be updated. + /// @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.visionai.v1.Asset]) + /// 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.visionai.v1.Asset]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L916} + /// [google.cloud.visionai.v1.UpdateAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L824} + /// + // clang-format on + StatusOr UpdateAsset( + google::cloud::visionai::v1::Asset const& asset, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates an asset inside corpus. + /// + /// @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.visionai.v1.UpdateAssetRequest]. + /// 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.visionai.v1.Asset]) + /// 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.visionai.v1.Asset]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L916} + /// [google.cloud.visionai.v1.UpdateAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L824} + /// + // clang-format on + StatusOr UpdateAsset( + google::cloud::visionai::v1::UpdateAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Reads an asset inside corpus. + /// + /// @param name Required. The name of the asset to retrieve. + /// Format: + /// projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + /// @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.visionai.v1.Asset]) + /// 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.visionai.v1.Asset]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L916} + /// [google.cloud.visionai.v1.GetAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L771} + /// + // clang-format on + StatusOr GetAsset(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Reads an asset inside corpus. + /// + /// @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.visionai.v1.GetAssetRequest]. + /// 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.visionai.v1.Asset]) + /// 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.visionai.v1.Asset]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L916} + /// [google.cloud.visionai.v1.GetAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L771} + /// + // clang-format on + StatusOr GetAsset( + google::cloud::visionai::v1::GetAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists an list of assets inside corpus. + /// + /// @param parent Required. The parent, which owns this collection of assets. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}` + /// @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.visionai.v1.Asset], 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.visionai.v1.Asset]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L916} + /// [google.cloud.visionai.v1.ListAssetsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L782} + /// + // clang-format on + StreamRange ListAssets( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists an list of assets inside corpus. + /// + /// @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.visionai.v1.ListAssetsRequest]. + /// 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.visionai.v1.Asset], 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.visionai.v1.Asset]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L916} + /// [google.cloud.visionai.v1.ListAssetsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L782} + /// + // clang-format on + StreamRange ListAssets( + google::cloud::visionai::v1::ListAssetsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Deletes asset inside corpus. + /// + /// @param name Required. The name of the asset to delete. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + /// @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.visionai.v1.DeleteAssetMetadata] 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.visionai.v1.DeleteAssetMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L3311} + /// [google.cloud.visionai.v1.DeleteAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L837} + /// + // clang-format on + future> + DeleteAsset(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteAsset + /// + /// 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 DeleteAsset(NoAwaitTag, + std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Deletes asset inside corpus. + /// + /// @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.visionai.v1.DeleteAssetRequest]. + /// 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.visionai.v1.DeleteAssetMetadata] 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.visionai.v1.DeleteAssetMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L3311} + /// [google.cloud.visionai.v1.DeleteAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L837} + /// + // clang-format on + future> + DeleteAsset(google::cloud::visionai::v1::DeleteAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteAsset + /// + /// 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 DeleteAsset( + NoAwaitTag, + google::cloud::visionai::v1::DeleteAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteAsset + /// + /// 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> + DeleteAsset(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Upload asset by specifing the asset Cloud Storage uri. + /// For video warehouse, it requires users who call this API have read access + /// to the cloud storage file. Once it is uploaded, it can be retrieved by + /// GenerateRetrievalUrl API which by default, only can retrieve cloud storage + /// files from the same project of the warehouse. To allow retrieval cloud + /// storage files that are in a separate project, it requires to find the + /// vision ai service account (Go to IAM, check checkbox to show "Include + /// Google-provided role grants", search for "Cloud Vision AI Service Agent") + /// and grant the read access of the cloud storage files to that service + /// account. + /// + /// @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.visionai.v1.UploadAssetRequest]. + /// 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.visionai.v1.UploadAssetResponse] 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.visionai.v1.UploadAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L870} + /// [google.cloud.visionai.v1.UploadAssetResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L884} + /// + // clang-format on + future> + UploadAsset(google::cloud::visionai::v1::UploadAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UploadAsset + /// + /// 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 UploadAsset( + NoAwaitTag, + google::cloud::visionai::v1::UploadAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UploadAsset + /// + /// 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> + UploadAsset(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Generates a signed url for downloading the asset. + /// For video warehouse, please see comment of UploadAsset about how to allow + /// retrieval of cloud storage files in a different project. + /// + /// @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.visionai.v1.GenerateRetrievalUrlRequest]. + /// 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.visionai.v1.GenerateRetrievalUrlResponse]) + /// 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.visionai.v1.GenerateRetrievalUrlRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L896} + /// [google.cloud.visionai.v1.GenerateRetrievalUrlResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L907} + /// + // clang-format on + StatusOr + GenerateRetrievalUrl( + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Analyze asset to power search capability. + /// + /// @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.visionai.v1.AnalyzeAssetRequest]. + /// 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.visionai.v1.AnalyzeAssetResponse] 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.visionai.v1.AnalyzeAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L939} + /// [google.cloud.visionai.v1.AnalyzeAssetResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L987} + /// + // clang-format on + future> + AnalyzeAsset(google::cloud::visionai::v1::AnalyzeAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief AnalyzeAsset + /// + /// 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 AnalyzeAsset( + NoAwaitTag, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief AnalyzeAsset + /// + /// 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> + AnalyzeAsset(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Index one asset for search. + /// Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND + /// + /// @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.visionai.v1.IndexAssetRequest]. + /// 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.visionai.v1.IndexAssetResponse] 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.visionai.v1.IndexAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1014} + /// [google.cloud.visionai.v1.IndexAssetResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1045} + /// + // clang-format on + future> IndexAsset( + google::cloud::visionai::v1::IndexAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief IndexAsset + /// + /// 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 IndexAsset( + NoAwaitTag, google::cloud::visionai::v1::IndexAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief IndexAsset + /// + /// 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> IndexAsset( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Remove one asset's index data for search. + /// Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND + /// + /// @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.visionai.v1.RemoveIndexAssetRequest]. + /// 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.visionai.v1.RemoveIndexAssetResponse] 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.visionai.v1.RemoveIndexAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1048} + /// [google.cloud.visionai.v1.RemoveIndexAssetResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1079} + /// + // clang-format on + future> + RemoveIndexAsset( + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief RemoveIndexAsset + /// + /// 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 RemoveIndexAsset( + NoAwaitTag, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief RemoveIndexAsset + /// + /// 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> + RemoveIndexAsset(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists assets inside an index. + /// + /// @param index Required. The index that owns this collection of assets. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + /// @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.visionai.v1.IndexedAsset], 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.visionai.v1.IndexedAsset]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1082} + /// [google.cloud.visionai.v1.ViewIndexedAssetsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1109} + /// + // clang-format on + StreamRange ViewIndexedAssets( + std::string const& index, Options opts = {}); + + // clang-format off + /// + /// Lists assets inside an index. + /// + /// @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.visionai.v1.ViewIndexedAssetsRequest]. + /// 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.visionai.v1.IndexedAsset], 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.visionai.v1.IndexedAsset]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1082} + /// [google.cloud.visionai.v1.ViewIndexedAssetsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1109} + /// + // clang-format on + StreamRange ViewIndexedAssets( + google::cloud::visionai::v1::ViewIndexedAssetsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Creates an Index under the corpus. + /// + /// @param parent Required. Value for the parent. The resource name of the Corpus under which + /// this index is created. Format: + /// `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + /// @param index Required. The index being created. + /// @param index_id Optional. The ID for the index. This will become the final resource name + /// for the index. If the user does not specify this value, it will be + /// generated by system. + /// @n + /// This value should be up to 63 characters, and valid characters + /// are /[a-z][0-9]-/. The first character must be a letter, the last could be + /// a letter or a number. + /// @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.visionai.v1.Index] 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.visionai.v1.CreateIndexRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1409} + /// [google.cloud.visionai.v1.Index]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1522} + /// + // clang-format on + future> CreateIndex( + std::string const& parent, + google::cloud::visionai::v1::Index const& index, + std::string const& index_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateIndex + /// + /// 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 CreateIndex( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Index const& index, + std::string const& index_id, Options opts = {}); + + // clang-format off + /// + /// Creates an Index under the corpus. + /// + /// @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.visionai.v1.CreateIndexRequest]. + /// 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.visionai.v1.Index] 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.visionai.v1.CreateIndexRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1409} + /// [google.cloud.visionai.v1.Index]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1522} + /// + // clang-format on + future> CreateIndex( + google::cloud::visionai::v1::CreateIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateIndex + /// + /// 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 CreateIndex( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateIndex + /// + /// 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> CreateIndex( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates an Index under the corpus. + /// Users can perform a metadata-only update or trigger a full index rebuild + /// with different update_mask values. + /// + /// @param index Required. The resource being updated. + /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// Index resource by the update. The fields specified in the update_mask are + /// relative to the resource, not the full request. A field of the resource + /// will be overwritten if it is in the mask. Empty field mask is not allowed. + /// If the mask is "*", it triggers a full update of the index, and also a + /// whole rebuild of index data. + /// @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.visionai.v1.Index] 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.visionai.v1.Index]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1522} + /// [google.cloud.visionai.v1.UpdateIndexRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1438} + /// + // clang-format on + future> UpdateIndex( + google::cloud::visionai::v1::Index const& index, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateIndex + /// + /// 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 UpdateIndex( + NoAwaitTag, google::cloud::visionai::v1::Index const& index, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates an Index under the corpus. + /// Users can perform a metadata-only update or trigger a full index rebuild + /// with different update_mask values. + /// + /// @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.visionai.v1.UpdateIndexRequest]. + /// 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.visionai.v1.Index] 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.visionai.v1.Index]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1522} + /// [google.cloud.visionai.v1.UpdateIndexRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1438} + /// + // clang-format on + future> UpdateIndex( + google::cloud::visionai::v1::UpdateIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateIndex + /// + /// 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 UpdateIndex( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateIndex + /// + /// 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> UpdateIndex( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Gets the details of a single Index under a Corpus. + /// + /// @param name Required. Name of the Index resource. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + /// @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.visionai.v1.Index]) + /// 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.visionai.v1.GetIndexRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1459} + /// [google.cloud.visionai.v1.Index]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1522} + /// + // clang-format on + StatusOr GetIndex(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Gets the details of a single Index under a Corpus. + /// + /// @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.visionai.v1.GetIndexRequest]. + /// 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.visionai.v1.Index]) + /// 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.visionai.v1.GetIndexRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1459} + /// [google.cloud.visionai.v1.Index]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1522} + /// + // clang-format on + StatusOr GetIndex( + google::cloud::visionai::v1::GetIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// List all Indexes in a given Corpus. + /// + /// @param parent Required. The parent corpus that owns this collection of indexes. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}` + /// @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.visionai.v1.Index], 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.visionai.v1.Index]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1522} + /// [google.cloud.visionai.v1.ListIndexesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1470} + /// + // clang-format on + StreamRange ListIndexes( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// List all Indexes in a given Corpus. + /// + /// @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.visionai.v1.ListIndexesRequest]. + /// 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.visionai.v1.Index], 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.visionai.v1.Index]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1522} + /// [google.cloud.visionai.v1.ListIndexesRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1470} + /// + // clang-format on + StreamRange ListIndexes( + google::cloud::visionai::v1::ListIndexesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Delete a single Index. In order to delete an index, the caller must + /// make sure that it is not deployed to any index endpoint. + /// + /// @param name Required. The name of the index to delete. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + /// @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.visionai.v1.DeleteIndexMetadata] 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.visionai.v1.DeleteIndexMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1517} + /// [google.cloud.visionai.v1.DeleteIndexRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1506} + /// + // clang-format on + future> + DeleteIndex(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteIndex + /// + /// 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 DeleteIndex(NoAwaitTag, + std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Delete a single Index. In order to delete an index, the caller must + /// make sure that it is not deployed to any index endpoint. + /// + /// @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.visionai.v1.DeleteIndexRequest]. + /// 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.visionai.v1.DeleteIndexMetadata] 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.visionai.v1.DeleteIndexMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1517} + /// [google.cloud.visionai.v1.DeleteIndexRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1506} + /// + // clang-format on + future> + DeleteIndex(google::cloud::visionai::v1::DeleteIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteIndex + /// + /// 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 DeleteIndex( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteIndex + /// + /// 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> + DeleteIndex(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Creates a corpus inside a project. + /// + /// @param parent Required. Form: `projects/{project_number}/locations/{location_id}` + /// @param corpus Required. The corpus to be created. + /// @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.visionai.v1.Corpus] 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.visionai.v1.Corpus]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1606} + /// [google.cloud.visionai.v1.CreateCorpusRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1149} + /// + // clang-format on + future> CreateCorpus( + std::string const& parent, + google::cloud::visionai::v1::Corpus const& corpus, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCorpus + /// + /// 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 CreateCorpus( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Corpus const& corpus, Options opts = {}); + + // clang-format off + /// + /// Creates a corpus inside a project. + /// + /// @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.visionai.v1.CreateCorpusRequest]. + /// 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.visionai.v1.Corpus] 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.visionai.v1.Corpus]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1606} + /// [google.cloud.visionai.v1.CreateCorpusRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1149} + /// + // clang-format on + future> CreateCorpus( + google::cloud::visionai::v1::CreateCorpusRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCorpus + /// + /// 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 CreateCorpus( + NoAwaitTag, + google::cloud::visionai::v1::CreateCorpusRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCorpus + /// + /// 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> CreateCorpus( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Gets corpus details inside a project. + /// + /// @param name Required. The resource name of the corpus to retrieve. + /// @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.visionai.v1.Corpus]) + /// 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.visionai.v1.Corpus]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1606} + /// [google.cloud.visionai.v1.GetCorpusRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1665} + /// + // clang-format on + StatusOr GetCorpus( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets corpus details inside a project. + /// + /// @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.visionai.v1.GetCorpusRequest]. + /// 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.visionai.v1.Corpus]) + /// 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.visionai.v1.Corpus]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1606} + /// [google.cloud.visionai.v1.GetCorpusRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1665} + /// + // clang-format on + StatusOr GetCorpus( + google::cloud::visionai::v1::GetCorpusRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates a corpus in a project. + /// + /// @param corpus Required. The corpus which replaces the resource on the server. + /// @param update_mask The list of fields to be updated. + /// @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.visionai.v1.Corpus]) + /// 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.visionai.v1.Corpus]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1606} + /// [google.cloud.visionai.v1.UpdateCorpusRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1674} + /// + // clang-format on + StatusOr UpdateCorpus( + google::cloud::visionai::v1::Corpus const& corpus, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a corpus in a project. + /// + /// @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.visionai.v1.UpdateCorpusRequest]. + /// 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.visionai.v1.Corpus]) + /// 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.visionai.v1.Corpus]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1606} + /// [google.cloud.visionai.v1.UpdateCorpusRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1674} + /// + // clang-format on + StatusOr UpdateCorpus( + google::cloud::visionai::v1::UpdateCorpusRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists all corpora in a project. + /// + /// @param parent Required. The resource name of the project from which to list corpora. + /// @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.visionai.v1.Corpus], 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.visionai.v1.Corpus]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1606} + /// [google.cloud.visionai.v1.ListCorporaRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1683} + /// + // clang-format on + StreamRange ListCorpora( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists all corpora in a project. + /// + /// @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.visionai.v1.ListCorporaRequest]. + /// 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.visionai.v1.Corpus], 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.visionai.v1.Corpus]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1606} + /// [google.cloud.visionai.v1.ListCorporaRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1683} + /// + // clang-format on + StreamRange ListCorpora( + google::cloud::visionai::v1::ListCorporaRequest request, + Options opts = {}); + + // clang-format off + /// + /// Deletes a corpus only if its empty. + /// Returns empty response. + /// + /// @param name Required. The resource name of the corpus to delete. + /// @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.cloud.visionai.v1.DeleteCorpusRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1722} + /// + // clang-format on + Status DeleteCorpus(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a corpus only if its empty. + /// Returns empty response. + /// + /// @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.visionai.v1.DeleteCorpusRequest]. + /// 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.cloud.visionai.v1.DeleteCorpusRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1722} + /// + // clang-format on + Status DeleteCorpus( + google::cloud::visionai::v1::DeleteCorpusRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Analyzes a corpus. + /// + /// @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.visionai.v1.AnalyzeCorpusRequest]. + /// 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.visionai.v1.AnalyzeCorpusResponse] 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.visionai.v1.AnalyzeCorpusRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1731} + /// [google.cloud.visionai.v1.AnalyzeCorpusResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1748} + /// + // clang-format on + future> + AnalyzeCorpus( + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief AnalyzeCorpus + /// + /// 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 AnalyzeCorpus( + NoAwaitTag, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief AnalyzeCorpus + /// + /// 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> + AnalyzeCorpus(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Creates data schema inside corpus. + /// + /// @param parent Required. The parent resource where this data schema will be created. + /// Format: + /// `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + /// @param data_schema Required. The data schema to create. + /// @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.visionai.v1.DataSchema]) + /// 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.visionai.v1.CreateDataSchemaRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1751} + /// [google.cloud.visionai.v1.DataSchema]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1766} + /// + // clang-format on + StatusOr CreateDataSchema( + std::string const& parent, + google::cloud::visionai::v1::DataSchema const& data_schema, + Options opts = {}); + + // clang-format off + /// + /// Creates data schema inside corpus. + /// + /// @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.visionai.v1.CreateDataSchemaRequest]. + /// 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.visionai.v1.DataSchema]) + /// 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.visionai.v1.CreateDataSchemaRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1751} + /// [google.cloud.visionai.v1.DataSchema]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1766} + /// + // clang-format on + StatusOr CreateDataSchema( + google::cloud::visionai::v1::CreateDataSchemaRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates data schema inside corpus. + /// + /// @param data_schema Required. The data schema's `name` field is used to identify the data + /// schema to be updated. Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}` + /// @param update_mask The list of fields to be updated. + /// @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.visionai.v1.DataSchema]) + /// 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.visionai.v1.DataSchema]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1766} + /// [google.cloud.visionai.v1.UpdateDataSchemaRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2033} + /// + // clang-format on + StatusOr UpdateDataSchema( + google::cloud::visionai::v1::DataSchema const& data_schema, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates data schema inside corpus. + /// + /// @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.visionai.v1.UpdateDataSchemaRequest]. + /// 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.visionai.v1.DataSchema]) + /// 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.visionai.v1.DataSchema]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1766} + /// [google.cloud.visionai.v1.UpdateDataSchemaRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2033} + /// + // clang-format on + StatusOr UpdateDataSchema( + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Gets data schema inside corpus. + /// + /// @param name Required. The name of the data schema to retrieve. + /// Format: + /// `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` + /// @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.visionai.v1.DataSchema]) + /// 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.visionai.v1.DataSchema]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1766} + /// [google.cloud.visionai.v1.GetDataSchemaRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2044} + /// + // clang-format on + StatusOr GetDataSchema( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets data schema inside corpus. + /// + /// @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.visionai.v1.GetDataSchemaRequest]. + /// 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.visionai.v1.DataSchema]) + /// 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.visionai.v1.DataSchema]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1766} + /// [google.cloud.visionai.v1.GetDataSchemaRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2044} + /// + // clang-format on + StatusOr GetDataSchema( + google::cloud::visionai::v1::GetDataSchemaRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes data schema inside corpus. + /// + /// @param name Required. The name of the data schema to delete. + /// Format: + /// `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` + /// @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.cloud.visionai.v1.DeleteDataSchemaRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2057} + /// + // clang-format on + Status DeleteDataSchema(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes data schema inside corpus. + /// + /// @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.visionai.v1.DeleteDataSchemaRequest]. + /// 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.cloud.visionai.v1.DeleteDataSchemaRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2057} + /// + // clang-format on + Status DeleteDataSchema( + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists a list of data schemas inside corpus. + /// + /// @param parent Required. The parent, which owns this collection of data schemas. + /// Format: + /// `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + /// @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.visionai.v1.DataSchema], 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.visionai.v1.DataSchema]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1766} + /// [google.cloud.visionai.v1.ListDataSchemasRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2070} + /// + // clang-format on + StreamRange ListDataSchemas( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists a list of data schemas inside corpus. + /// + /// @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.visionai.v1.ListDataSchemasRequest]. + /// 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.visionai.v1.DataSchema], 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.visionai.v1.DataSchema]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1766} + /// [google.cloud.visionai.v1.ListDataSchemasRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2070} + /// + // clang-format on + StreamRange ListDataSchemas( + google::cloud::visionai::v1::ListDataSchemasRequest request, + Options opts = {}); + + // clang-format off + /// + /// Creates annotation inside asset. + /// + /// @param parent Required. The parent resource where this annotation will be created. + /// Format: + /// `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + /// @param annotation Required. The annotation to create. + /// @param annotation_id Optional. The ID to use for the annotation, which will become the final + /// component of the annotation's resource name if user choose to specify. + /// Otherwise, annotation id will be generated by system. + /// @n + /// This value should be up to 63 characters, and valid characters + /// are /[a-z][0-9]-/. The first character must be a letter, the last could be + /// a letter or a number. + /// @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.visionai.v1.Annotation]) + /// 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.visionai.v1.Annotation]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2129} + /// [google.cloud.visionai.v1.CreateAnnotationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2105} + /// + // clang-format on + StatusOr CreateAnnotation( + std::string const& parent, + google::cloud::visionai::v1::Annotation const& annotation, + std::string const& annotation_id, Options opts = {}); + + // clang-format off + /// + /// Creates annotation inside asset. + /// + /// @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.visionai.v1.CreateAnnotationRequest]. + /// 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.visionai.v1.Annotation]) + /// 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.visionai.v1.Annotation]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2129} + /// [google.cloud.visionai.v1.CreateAnnotationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2105} + /// + // clang-format on + StatusOr CreateAnnotation( + google::cloud::visionai::v1::CreateAnnotationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Reads annotation inside asset. + /// + /// @param name Required. The name of the annotation to retrieve. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + /// @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.visionai.v1.Annotation]) + /// 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.visionai.v1.Annotation]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2129} + /// [google.cloud.visionai.v1.GetAnnotationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2265} + /// + // clang-format on + StatusOr GetAnnotation( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Reads annotation inside asset. + /// + /// @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.visionai.v1.GetAnnotationRequest]. + /// 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.visionai.v1.Annotation]) + /// 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.visionai.v1.Annotation]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2129} + /// [google.cloud.visionai.v1.GetAnnotationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2265} + /// + // clang-format on + StatusOr GetAnnotation( + google::cloud::visionai::v1::GetAnnotationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists a list of annotations inside asset. + /// + /// @param parent The parent, which owns this collection of annotations. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + /// @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.visionai.v1.Annotation], 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.visionai.v1.Annotation]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2129} + /// [google.cloud.visionai.v1.ListAnnotationsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2216} + /// + // clang-format on + StreamRange ListAnnotations( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists a list of annotations inside asset. + /// + /// @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.visionai.v1.ListAnnotationsRequest]. + /// 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.visionai.v1.Annotation], 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.visionai.v1.Annotation]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2129} + /// [google.cloud.visionai.v1.ListAnnotationsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2216} + /// + // clang-format on + StreamRange ListAnnotations( + google::cloud::visionai::v1::ListAnnotationsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Updates annotation inside asset. + /// + /// @param annotation Required. The annotation to update. + /// The annotation's `name` field is used to identify the annotation to be + /// updated. Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + /// @param update_mask The list of fields to be updated. + /// @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.visionai.v1.Annotation]) + /// 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.visionai.v1.Annotation]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2129} + /// [google.cloud.visionai.v1.UpdateAnnotationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2278} + /// + // clang-format on + StatusOr UpdateAnnotation( + google::cloud::visionai::v1::Annotation const& annotation, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates annotation inside asset. + /// + /// @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.visionai.v1.UpdateAnnotationRequest]. + /// 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.visionai.v1.Annotation]) + /// 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.visionai.v1.Annotation]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2129} + /// [google.cloud.visionai.v1.UpdateAnnotationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2278} + /// + // clang-format on + StatusOr UpdateAnnotation( + google::cloud::visionai::v1::UpdateAnnotationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes annotation inside asset. + /// + /// @param name Required. The name of the annotation to delete. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + /// @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.cloud.visionai.v1.DeleteAnnotationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2290} + /// + // clang-format on + Status DeleteAnnotation(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes annotation inside asset. + /// + /// @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.visionai.v1.DeleteAnnotationRequest]. + /// 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.cloud.visionai.v1.DeleteAnnotationRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2290} + /// + // clang-format on + Status DeleteAnnotation( + google::cloud::visionai::v1::DeleteAnnotationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Ingests data for the asset. It is not allowed to ingest a data chunk which + /// is already expired according to TTL. + /// This method is only available via the gRPC API (not HTTP since + /// bi-directional streaming is not supported via HTTP). + /// + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return An object representing the bidirectional streaming + /// RPC. Applications can send multiple request messages and receive + /// multiple response messages through this API. Bidirectional streaming + /// RPCs can impose restrictions on the sequence of request and response + /// messages. Please consult the service documentation for details. + /// The request message type ([google.cloud.visionai.v1.IngestAssetRequest]) and response messages + /// ([google.cloud.visionai.v1.IngestAssetResponse]) are mapped to C++ classes 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 + /// [`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.visionai.v1.IngestAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L3048} + /// [google.cloud.visionai.v1.IngestAssetResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L3102} + /// + // clang-format on + std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> + AsyncIngestAsset(Options opts = {}); + + // clang-format off + /// + /// Supported by STREAM_VIDEO corpus type. + /// Generates clips for downloading. The api takes in a time range, and + /// generates a clip of the first content available after start_time and + /// before end_time, which may overflow beyond these bounds. + /// Returned clips are truncated if the total size of the clips are larger + /// than 100MB. + /// + /// @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.visionai.v1.ClipAssetRequest]. + /// 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.visionai.v1.ClipAssetResponse]) + /// 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.visionai.v1.ClipAssetRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L3108} + /// [google.cloud.visionai.v1.ClipAssetResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L3123} + /// + // clang-format on + StatusOr ClipAsset( + google::cloud::visionai::v1::ClipAssetRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Generates a uri for an HLS manifest. The api takes in a collection of time + /// ranges, and generates a URI for an HLS manifest that covers all the + /// requested time ranges. + /// + /// @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.visionai.v1.GenerateHlsUriRequest]. + /// 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.visionai.v1.GenerateHlsUriResponse]) + /// 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.visionai.v1.GenerateHlsUriRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L3139} + /// [google.cloud.visionai.v1.GenerateHlsUriResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L3158} + /// + // clang-format on + StatusOr GenerateHlsUri( + google::cloud::visionai::v1::GenerateHlsUriRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Imports assets (images plus annotations) from a meta file on cloud storage. + /// Each row in the meta file is corresponding to an image (specified by a + /// cloud storage uri) and its annotations. + /// + /// @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.visionai.v1.ImportAssetsRequest]. + /// 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.visionai.v1.ImportAssetsResponse] 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.visionai.v1.ImportAssetsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2303} + /// [google.cloud.visionai.v1.ImportAssetsResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2344} + /// + // clang-format on + future> + ImportAssets(google::cloud::visionai::v1::ImportAssetsRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ImportAssets + /// + /// 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 ImportAssets( + NoAwaitTag, + google::cloud::visionai::v1::ImportAssetsRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ImportAssets + /// + /// 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> + ImportAssets(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Creates a search configuration inside a corpus. + /// + /// Please follow the rules below to create a valid CreateSearchConfigRequest. + /// - General Rules - + /// 1. Request.search_config_id must not be associated with an existing + /// SearchConfig. + /// 2. Request must contain at least one non-empty search_criteria_property or + /// facet_property. + /// 3. mapped_fields must not be empty, and must map to existing UGA keys. + /// 4. All mapped_fields must be of the same type. + /// 5. All mapped_fields must share the same granularity. + /// 6. All mapped_fields must share the same semantic SearchConfig match + /// options. + /// For property-specific rules, please reference the comments for + /// FacetProperty and SearchCriteriaProperty. + /// + /// @param parent Required. The parent resource where this search configuration will be + /// created. Format: + /// `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + /// @param search_config Required. The search config to create. + /// @param search_config_id Required. ID to use for the new search config. Will become the final + /// component of the SearchConfig's resource name. This value should be up to + /// 63 characters, and valid characters are /[a-z][0-9]-_/. The first character + /// must be a letter, the last could be a letter or a number. + /// @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.visionai.v1.SearchConfig]) + /// 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.visionai.v1.CreateSearchConfigRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2347} + /// [google.cloud.visionai.v1.SearchConfig]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2446} + /// + // clang-format on + StatusOr CreateSearchConfig( + std::string const& parent, + google::cloud::visionai::v1::SearchConfig const& search_config, + std::string const& search_config_id, Options opts = {}); + + // clang-format off + /// + /// Creates a search configuration inside a corpus. + /// + /// Please follow the rules below to create a valid CreateSearchConfigRequest. + /// - General Rules - + /// 1. Request.search_config_id must not be associated with an existing + /// SearchConfig. + /// 2. Request must contain at least one non-empty search_criteria_property or + /// facet_property. + /// 3. mapped_fields must not be empty, and must map to existing UGA keys. + /// 4. All mapped_fields must be of the same type. + /// 5. All mapped_fields must share the same granularity. + /// 6. All mapped_fields must share the same semantic SearchConfig match + /// options. + /// For property-specific rules, please reference the comments for + /// FacetProperty and SearchCriteriaProperty. + /// + /// @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.visionai.v1.CreateSearchConfigRequest]. + /// 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.visionai.v1.SearchConfig]) + /// 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.visionai.v1.CreateSearchConfigRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2347} + /// [google.cloud.visionai.v1.SearchConfig]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2446} + /// + // clang-format on + StatusOr CreateSearchConfig( + google::cloud::visionai::v1::CreateSearchConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates a search configuration inside a corpus. + /// + /// Please follow the rules below to create a valid UpdateSearchConfigRequest. + /// - General Rules - + /// 1. Request.search_configuration.name must already exist. + /// 2. Request must contain at least one non-empty search_criteria_property or + /// facet_property. + /// 3. mapped_fields must not be empty, and must map to existing UGA keys. + /// 4. All mapped_fields must be of the same type. + /// 5. All mapped_fields must share the same granularity. + /// 6. All mapped_fields must share the same semantic SearchConfig match + /// options. + /// For property-specific rules, please reference the comments for + /// FacetProperty and SearchCriteriaProperty. + /// + /// @param search_config Required. The search configuration to update. + /// @n + /// The search configuration's `name` field is used to identify the resource to + /// be updated. Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + /// @param update_mask The list of fields to be updated. If left unset, all field paths will be + /// updated/overwritten. + /// @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.visionai.v1.SearchConfig]) + /// 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.visionai.v1.SearchConfig]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2446} + /// [google.cloud.visionai.v1.UpdateSearchConfigRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2369} + /// + // clang-format on + StatusOr UpdateSearchConfig( + google::cloud::visionai::v1::SearchConfig const& search_config, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a search configuration inside a corpus. + /// + /// Please follow the rules below to create a valid UpdateSearchConfigRequest. + /// - General Rules - + /// 1. Request.search_configuration.name must already exist. + /// 2. Request must contain at least one non-empty search_criteria_property or + /// facet_property. + /// 3. mapped_fields must not be empty, and must map to existing UGA keys. + /// 4. All mapped_fields must be of the same type. + /// 5. All mapped_fields must share the same granularity. + /// 6. All mapped_fields must share the same semantic SearchConfig match + /// options. + /// For property-specific rules, please reference the comments for + /// FacetProperty and SearchCriteriaProperty. + /// + /// @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.visionai.v1.UpdateSearchConfigRequest]. + /// 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.visionai.v1.SearchConfig]) + /// 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.visionai.v1.SearchConfig]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2446} + /// [google.cloud.visionai.v1.UpdateSearchConfigRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2369} + /// + // clang-format on + StatusOr UpdateSearchConfig( + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Gets a search configuration inside a corpus. + /// + /// @param name Required. The name of the search configuration to retrieve. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + /// @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.visionai.v1.SearchConfig]) + /// 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.visionai.v1.GetSearchConfigRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2383} + /// [google.cloud.visionai.v1.SearchConfig]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2446} + /// + // clang-format on + StatusOr GetSearchConfig( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a search configuration inside a corpus. + /// + /// @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.visionai.v1.GetSearchConfigRequest]. + /// 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.visionai.v1.SearchConfig]) + /// 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.visionai.v1.GetSearchConfigRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2383} + /// [google.cloud.visionai.v1.SearchConfig]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2446} + /// + // clang-format on + StatusOr GetSearchConfig( + google::cloud::visionai::v1::GetSearchConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes a search configuration inside a corpus. + /// + /// For a DeleteSearchConfigRequest to be valid, + /// Request.search_configuration.name must already exist. + /// + /// @param name Required. The name of the search configuration to delete. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + /// @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.cloud.visionai.v1.DeleteSearchConfigRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2396} + /// + // clang-format on + Status DeleteSearchConfig(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a search configuration inside a corpus. + /// + /// For a DeleteSearchConfigRequest to be valid, + /// Request.search_configuration.name must already exist. + /// + /// @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.visionai.v1.DeleteSearchConfigRequest]. + /// 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.cloud.visionai.v1.DeleteSearchConfigRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2396} + /// + // clang-format on + Status DeleteSearchConfig( + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists all search configurations inside a corpus. + /// + /// @param parent Required. The parent, which owns this collection of search configurations. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}` + /// @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.visionai.v1.SearchConfig], 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.visionai.v1.ListSearchConfigsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2409} + /// [google.cloud.visionai.v1.SearchConfig]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2446} + /// + // clang-format on + StreamRange ListSearchConfigs( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists all search configurations inside a corpus. + /// + /// @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.visionai.v1.ListSearchConfigsRequest]. + /// 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.visionai.v1.SearchConfig], 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.visionai.v1.ListSearchConfigsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2409} + /// [google.cloud.visionai.v1.SearchConfig]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2446} + /// + // clang-format on + StreamRange ListSearchConfigs( + google::cloud::visionai::v1::ListSearchConfigsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Creates a SearchHypernym inside a corpus. + /// + /// @param parent Required. The parent resource where this SearchHypernym will be created. + /// Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` + /// @param search_hypernym Required. The SearchHypernym to create. + /// @param search_hypernym_id Optional. The search hypernym id. + /// If omitted, a random UUID will be generated. + /// @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.visionai.v1.SearchHypernym]) + /// 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.visionai.v1.CreateSearchHypernymRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2863} + /// [google.cloud.visionai.v1.SearchHypernym]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2844} + /// + // clang-format on + StatusOr CreateSearchHypernym( + std::string const& parent, + google::cloud::visionai::v1::SearchHypernym const& search_hypernym, + std::string const& search_hypernym_id, Options opts = {}); + + // clang-format off + /// + /// Creates a SearchHypernym inside a corpus. + /// + /// @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.visionai.v1.CreateSearchHypernymRequest]. + /// 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.visionai.v1.SearchHypernym]) + /// 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.visionai.v1.CreateSearchHypernymRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2863} + /// [google.cloud.visionai.v1.SearchHypernym]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2844} + /// + // clang-format on + StatusOr CreateSearchHypernym( + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates a SearchHypernym inside a corpus. + /// + /// @param search_hypernym Required. The SearchHypernym to update. + /// The search hypernym's `name` field is used to identify the search hypernym + /// to be updated. Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + /// @param update_mask The list of fields to be updated. If left unset, all field paths will be + /// updated/overwritten. + /// @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.visionai.v1.SearchHypernym]) + /// 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.visionai.v1.SearchHypernym]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2844} + /// [google.cloud.visionai.v1.UpdateSearchHypernymRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2881} + /// + // clang-format on + StatusOr UpdateSearchHypernym( + google::cloud::visionai::v1::SearchHypernym const& search_hypernym, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a SearchHypernym inside a corpus. + /// + /// @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.visionai.v1.UpdateSearchHypernymRequest]. + /// 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.visionai.v1.SearchHypernym]) + /// 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.visionai.v1.SearchHypernym]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2844} + /// [google.cloud.visionai.v1.UpdateSearchHypernymRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2881} + /// + // clang-format on + StatusOr UpdateSearchHypernym( + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Gets a SearchHypernym inside a corpus. + /// + /// @param name Required. The name of the SearchHypernym to retrieve. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + /// @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.visionai.v1.SearchHypernym]) + /// 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.visionai.v1.GetSearchHypernymRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2894} + /// [google.cloud.visionai.v1.SearchHypernym]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2844} + /// + // clang-format on + StatusOr GetSearchHypernym( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a SearchHypernym inside a corpus. + /// + /// @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.visionai.v1.GetSearchHypernymRequest]. + /// 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.visionai.v1.SearchHypernym]) + /// 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.visionai.v1.GetSearchHypernymRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2894} + /// [google.cloud.visionai.v1.SearchHypernym]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2844} + /// + // clang-format on + StatusOr GetSearchHypernym( + google::cloud::visionai::v1::GetSearchHypernymRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes a SearchHypernym inside a corpus. + /// + /// @param name Required. The name of the SearchHypernym to delete. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + /// @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.cloud.visionai.v1.DeleteSearchHypernymRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2907} + /// + // clang-format on + Status DeleteSearchHypernym(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a SearchHypernym inside a corpus. + /// + /// @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.visionai.v1.DeleteSearchHypernymRequest]. + /// 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.cloud.visionai.v1.DeleteSearchHypernymRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2907} + /// + // clang-format on + Status DeleteSearchHypernym( + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists SearchHypernyms inside a corpus. + /// + /// @param parent Required. The parent, which owns this collection of SearchHypernyms. + /// Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}` + /// @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.visionai.v1.SearchHypernym], 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.visionai.v1.ListSearchHypernymsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2920} + /// [google.cloud.visionai.v1.SearchHypernym]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2844} + /// + // clang-format on + StreamRange ListSearchHypernyms( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists SearchHypernyms inside a corpus. + /// + /// @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.visionai.v1.ListSearchHypernymsRequest]. + /// 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.visionai.v1.SearchHypernym], 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.visionai.v1.ListSearchHypernymsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2920} + /// [google.cloud.visionai.v1.SearchHypernym]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2844} + /// + // clang-format on + StreamRange ListSearchHypernyms( + google::cloud::visionai::v1::ListSearchHypernymsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Search media asset. + /// + /// @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.visionai.v1.SearchAssetsRequest]. + /// 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.visionai.v1.SearchResultItem], 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.visionai.v1.SearchAssetsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L3169} + /// [google.cloud.visionai.v1.SearchResultItem]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L3329} + /// + // clang-format on + StreamRange SearchAssets( + google::cloud::visionai::v1::SearchAssetsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Search a deployed index endpoint (IMAGE corpus type only). + /// + /// @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.visionai.v1.SearchIndexEndpointRequest]. + /// 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.visionai.v1.SearchResultItem], 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.visionai.v1.SearchIndexEndpointRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L3219} + /// [google.cloud.visionai.v1.SearchResultItem]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L3329} + /// + // clang-format on + StreamRange + SearchIndexEndpoint( + google::cloud::visionai::v1::SearchIndexEndpointRequest request, + Options opts = {}); + + // clang-format off + /// + /// Creates an IndexEndpoint. + /// + /// @param parent Required. Format: `projects/{project}/locations/{location}` + /// @param index_endpoint Required. The resource being created. + /// @param index_endpoint_id Optional. The ID to use for the IndexEndpoint, which will become the final + /// component of the IndexEndpoint's resource name if the user specifies it. + /// Otherwise, IndexEndpoint id will be autogenerated. + /// @n + /// This value should be up to 63 characters, and valid characters + /// are a-z, 0-9 and dash (-). The first character must be a letter, the last + /// must be a letter or a number. + /// @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.visionai.v1.IndexEndpoint] 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.visionai.v1.CreateIndexEndpointRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2553} + /// [google.cloud.visionai.v1.IndexEndpoint]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2468} + /// + // clang-format on + future> + CreateIndexEndpoint( + std::string const& parent, + google::cloud::visionai::v1::IndexEndpoint const& index_endpoint, + std::string const& index_endpoint_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateIndexEndpoint + /// + /// 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 CreateIndexEndpoint( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::IndexEndpoint const& index_endpoint, + std::string const& index_endpoint_id, Options opts = {}); + + // clang-format off + /// + /// Creates an IndexEndpoint. + /// + /// @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.visionai.v1.CreateIndexEndpointRequest]. + /// 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.visionai.v1.IndexEndpoint] 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.visionai.v1.CreateIndexEndpointRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2553} + /// [google.cloud.visionai.v1.IndexEndpoint]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2468} + /// + // clang-format on + future> + CreateIndexEndpoint( + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateIndexEndpoint + /// + /// 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 CreateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateIndexEndpoint + /// + /// 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> + CreateIndexEndpoint(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Gets an IndexEndpoint. + /// + /// @param name Required. Name of the IndexEndpoint 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.visionai.v1.IndexEndpoint]) + /// 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.visionai.v1.GetIndexEndpointRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2582} + /// [google.cloud.visionai.v1.IndexEndpoint]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2468} + /// + // clang-format on + StatusOr GetIndexEndpoint( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets an IndexEndpoint. + /// + /// @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.visionai.v1.GetIndexEndpointRequest]. + /// 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.visionai.v1.IndexEndpoint]) + /// 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.visionai.v1.GetIndexEndpointRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2582} + /// [google.cloud.visionai.v1.IndexEndpoint]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2468} + /// + // clang-format on + StatusOr GetIndexEndpoint( + google::cloud::visionai::v1::GetIndexEndpointRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists all IndexEndpoints in a project. + /// + /// @param parent Required. Format: `projects/{project}/locations/{location}` + /// @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.visionai.v1.IndexEndpoint], 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.visionai.v1.IndexEndpoint]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2468} + /// [google.cloud.visionai.v1.ListIndexEndpointsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2593} + /// + // clang-format on + StreamRange ListIndexEndpoints( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists all IndexEndpoints in a project. + /// + /// @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.visionai.v1.ListIndexEndpointsRequest]. + /// 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.visionai.v1.IndexEndpoint], 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.visionai.v1.IndexEndpoint]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2468} + /// [google.cloud.visionai.v1.ListIndexEndpointsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2593} + /// + // clang-format on + StreamRange ListIndexEndpoints( + google::cloud::visionai::v1::ListIndexEndpointsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Updates an IndexEndpoint. + /// + /// @param index_endpoint Required. The resource being updated. + /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// IndexEndpoint resource by the update. + /// The fields specified in the update_mask are relative to the resource, not + /// the full request. + /// A field of the resource will be overwritten if it is in the mask. + /// Empty field mask is not allowed. + /// If the mask is "*", then this is a full replacement 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.visionai.v1.IndexEndpoint] 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.visionai.v1.IndexEndpoint]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2468} + /// [google.cloud.visionai.v1.UpdateIndexEndpointRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2635} + /// + // clang-format on + future> + UpdateIndexEndpoint( + google::cloud::visionai::v1::IndexEndpoint const& index_endpoint, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateIndexEndpoint + /// + /// 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 UpdateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::IndexEndpoint const& index_endpoint, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates an IndexEndpoint. + /// + /// @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.visionai.v1.UpdateIndexEndpointRequest]. + /// 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.visionai.v1.IndexEndpoint] 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.visionai.v1.IndexEndpoint]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2468} + /// [google.cloud.visionai.v1.UpdateIndexEndpointRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2635} + /// + // clang-format on + future> + UpdateIndexEndpoint( + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateIndexEndpoint + /// + /// 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 UpdateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateIndexEndpoint + /// + /// 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> + UpdateIndexEndpoint(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes an IndexEndpoint. + /// + /// @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.visionai.v1.DeleteIndexEndpointMetadata] 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.visionai.v1.DeleteIndexEndpointMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2668} + /// [google.cloud.visionai.v1.DeleteIndexEndpointRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2657} + /// + // clang-format on + future> + DeleteIndexEndpoint(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteIndexEndpoint + /// + /// 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 DeleteIndexEndpoint( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes an IndexEndpoint. + /// + /// @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.visionai.v1.DeleteIndexEndpointRequest]. + /// 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.visionai.v1.DeleteIndexEndpointMetadata] 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.visionai.v1.DeleteIndexEndpointMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2668} + /// [google.cloud.visionai.v1.DeleteIndexEndpointRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2657} + /// + // clang-format on + future> + DeleteIndexEndpoint( + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteIndexEndpoint + /// + /// 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 DeleteIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteIndexEndpoint + /// + /// 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> + DeleteIndexEndpoint(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deploys an Index to IndexEndpoint. + /// + /// @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.visionai.v1.DeployIndexRequest]. + /// 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.visionai.v1.DeployIndexResponse] 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.visionai.v1.DeployIndexRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2674} + /// [google.cloud.visionai.v1.DeployIndexResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2690} + /// + // clang-format on + future> + DeployIndex(google::cloud::visionai::v1::DeployIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeployIndex + /// + /// 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 DeployIndex( + NoAwaitTag, + google::cloud::visionai::v1::DeployIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeployIndex + /// + /// 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> + DeployIndex(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Undeploys an Index from IndexEndpoint. + /// + /// @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.visionai.v1.UndeployIndexRequest]. + /// 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.visionai.v1.UndeployIndexResponse] 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.visionai.v1.UndeployIndexRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2717} + /// [google.cloud.visionai.v1.UndeployIndexResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L2730} + /// + // clang-format on + future> + UndeployIndex( + google::cloud::visionai::v1::UndeployIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UndeployIndex + /// + /// 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 UndeployIndex( + NoAwaitTag, + google::cloud::visionai::v1::UndeployIndexRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UndeployIndex + /// + /// 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> + UndeployIndex(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Creates a collection. + /// + /// @param parent Required. The parent resource where this collection will be created. + /// Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` + /// @param collection Required. The collection resource to be created. + /// @param collection_id Optional. The ID to use for the collection, which will become the final + /// component of the resource name if user choose to specify. Otherwise, + /// collection id will be generated by system. + /// @n + /// This value should be up to 55 characters, and valid characters + /// are /[a-z][0-9]-/. The first character must be a letter, the last could be + /// a letter or a number. + /// @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.visionai.v1.Collection] 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.visionai.v1.Collection]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1359} + /// [google.cloud.visionai.v1.CreateCollectionRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1194} + /// + // clang-format on + future> CreateCollection( + std::string const& parent, + google::cloud::visionai::v1::Collection const& collection, + std::string const& collection_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCollection + /// + /// 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 CreateCollection( + NoAwaitTag, std::string const& parent, + google::cloud::visionai::v1::Collection const& collection, + std::string const& collection_id, Options opts = {}); + + // clang-format off + /// + /// Creates a collection. + /// + /// @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.visionai.v1.CreateCollectionRequest]. + /// 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.visionai.v1.Collection] 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.visionai.v1.Collection]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1359} + /// [google.cloud.visionai.v1.CreateCollectionRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1194} + /// + // clang-format on + future> CreateCollection( + google::cloud::visionai::v1::CreateCollectionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCollection + /// + /// 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 CreateCollection( + NoAwaitTag, + google::cloud::visionai::v1::CreateCollectionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateCollection + /// + /// 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> CreateCollection( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a collection. + /// + /// @param name Required. The name of the collection to delete. Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + /// @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.visionai.v1.DeleteCollectionMetadata] 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.visionai.v1.DeleteCollectionMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1216} + /// [google.cloud.visionai.v1.DeleteCollectionRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1222} + /// + // clang-format on + future> + DeleteCollection(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCollection + /// + /// 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 DeleteCollection( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a collection. + /// + /// @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.visionai.v1.DeleteCollectionRequest]. + /// 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.visionai.v1.DeleteCollectionMetadata] 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.visionai.v1.DeleteCollectionMetadata]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1216} + /// [google.cloud.visionai.v1.DeleteCollectionRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1222} + /// + // clang-format on + future> + DeleteCollection( + google::cloud::visionai::v1::DeleteCollectionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCollection + /// + /// 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 DeleteCollection( + NoAwaitTag, + google::cloud::visionai::v1::DeleteCollectionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteCollection + /// + /// 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> + DeleteCollection(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Gets a collection. + /// + /// @param name Required. The name of the collection to retrieve. Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + /// @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.visionai.v1.Collection]) + /// 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.visionai.v1.Collection]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1359} + /// [google.cloud.visionai.v1.GetCollectionRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1234} + /// + // clang-format on + StatusOr GetCollection( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets a collection. + /// + /// @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.visionai.v1.GetCollectionRequest]. + /// 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.visionai.v1.Collection]) + /// 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.visionai.v1.Collection]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1359} + /// [google.cloud.visionai.v1.GetCollectionRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1234} + /// + // clang-format on + StatusOr GetCollection( + google::cloud::visionai::v1::GetCollectionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Updates a collection. + /// + /// @param collection Required. The collection to update. + /// @n + /// The collection's `name` field is used to identify the collection to be + /// updated. Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + /// @param update_mask The list of fields to be updated. + /// - Unset `update_mask` or set `update_mask` to be a single "*" only will + /// update all updatable fields with the value provided in `collection`. + /// - To update `display_name` value to empty string, set it in the + /// `collection` + /// to empty string, and set `update_mask` with "display_name". Same applies + /// to other updatable string fields in the `collection`. + /// @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.visionai.v1.Collection]) + /// 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.visionai.v1.Collection]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1359} + /// [google.cloud.visionai.v1.UpdateCollectionRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1246} + /// + // clang-format on + StatusOr UpdateCollection( + google::cloud::visionai::v1::Collection const& collection, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates a collection. + /// + /// @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.visionai.v1.UpdateCollectionRequest]. + /// 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.visionai.v1.Collection]) + /// 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.visionai.v1.Collection]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1359} + /// [google.cloud.visionai.v1.UpdateCollectionRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1246} + /// + // clang-format on + StatusOr UpdateCollection( + google::cloud::visionai::v1::UpdateCollectionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists collections inside a corpus. + /// + /// @param parent Required. The parent corpus. Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}` + /// @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.visionai.v1.Collection], 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.visionai.v1.Collection]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1359} + /// [google.cloud.visionai.v1.ListCollectionsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1265} + /// + // clang-format on + StreamRange ListCollections( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists collections inside a corpus. + /// + /// @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.visionai.v1.ListCollectionsRequest]. + /// 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.visionai.v1.Collection], 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.visionai.v1.Collection]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1359} + /// [google.cloud.visionai.v1.ListCollectionsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1265} + /// + // clang-format on + StreamRange ListCollections( + google::cloud::visionai::v1::ListCollectionsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Adds an item into a Collection. + /// + /// @param item Required. The item to be added. + /// @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.visionai.v1.AddCollectionItemResponse]) + /// 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.visionai.v1.AddCollectionItemRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1299} + /// [google.cloud.visionai.v1.AddCollectionItemResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1305} + /// + // clang-format on + StatusOr + AddCollectionItem(google::cloud::visionai::v1::CollectionItem const& item, + Options opts = {}); + + // clang-format off + /// + /// Adds an item into a Collection. + /// + /// @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.visionai.v1.AddCollectionItemRequest]. + /// 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.visionai.v1.AddCollectionItemResponse]) + /// 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.visionai.v1.AddCollectionItemRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1299} + /// [google.cloud.visionai.v1.AddCollectionItemResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1305} + /// + // clang-format on + StatusOr + AddCollectionItem( + google::cloud::visionai::v1::AddCollectionItemRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Removes an item from a collection. + /// + /// @param item Required. The item to be removed. + /// @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.visionai.v1.RemoveCollectionItemResponse]) + /// 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.visionai.v1.RemoveCollectionItemRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1311} + /// [google.cloud.visionai.v1.RemoveCollectionItemResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1317} + /// + // clang-format on + StatusOr + RemoveCollectionItem(google::cloud::visionai::v1::CollectionItem const& item, + Options opts = {}); + + // clang-format off + /// + /// Removes an item from a collection. + /// + /// @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.visionai.v1.RemoveCollectionItemRequest]. + /// 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.visionai.v1.RemoveCollectionItemResponse]) + /// 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.visionai.v1.RemoveCollectionItemRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1311} + /// [google.cloud.visionai.v1.RemoveCollectionItemResponse]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1317} + /// + // clang-format on + StatusOr + RemoveCollectionItem( + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// View items inside a collection. + /// + /// @param collection Required. The collection to view. Format: + /// `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + /// @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.visionai.v1.CollectionItem], 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.visionai.v1.CollectionItem]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1380} + /// [google.cloud.visionai.v1.ViewCollectionItemsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1323} + /// + // clang-format on + StreamRange ViewCollectionItems( + std::string const& collection, Options opts = {}); + + // clang-format off + /// + /// View items inside a collection. + /// + /// @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.visionai.v1.ViewCollectionItemsRequest]. + /// 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.visionai.v1.CollectionItem], 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.visionai.v1.CollectionItem]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1380} + /// [google.cloud.visionai.v1.ViewCollectionItemsRequest]: @googleapis_reference_link{google/cloud/visionai/v1/warehouse.proto#L1323} + /// + // clang-format on + StreamRange ViewCollectionItems( + google::cloud::visionai::v1::ViewCollectionItemsRequest request, + 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_WAREHOUSE_CLIENT_H diff --git a/google/cloud/visionai/v1/warehouse_connection.cc b/google/cloud/visionai/v1/warehouse_connection.cc new file mode 100644 index 0000000000000..82d5b85c4ed10 --- /dev/null +++ b/google/cloud/visionai/v1/warehouse_connection.cc @@ -0,0 +1,769 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#include "google/cloud/visionai/v1/warehouse_connection.h" +#include "google/cloud/visionai/v1/internal/warehouse_connection_impl.h" +#include "google/cloud/visionai/v1/internal/warehouse_option_defaults.h" +#include "google/cloud/visionai/v1/internal/warehouse_stub_factory.h" +#include "google/cloud/visionai/v1/internal/warehouse_tracing_connection.h" +#include "google/cloud/visionai/v1/warehouse_options.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 visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WarehouseConnection::~WarehouseConnection() = default; + +StatusOr WarehouseConnection::CreateAsset( + google::cloud::visionai::v1::CreateAssetRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr WarehouseConnection::UpdateAsset( + google::cloud::visionai::v1::UpdateAssetRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr WarehouseConnection::GetAsset( + google::cloud::visionai::v1::GetAssetRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange WarehouseConnection::ListAssets( + google::cloud::visionai::v1:: + ListAssetsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +future> +WarehouseConnection::DeleteAsset( + google::cloud::visionai::v1::DeleteAssetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::DeleteAsset( + NoAwaitTag, google::cloud::visionai::v1::DeleteAssetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::DeleteAsset(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::UploadAsset( + google::cloud::visionai::v1::UploadAssetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::UploadAsset( + NoAwaitTag, google::cloud::visionai::v1::UploadAssetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::UploadAsset(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WarehouseConnection::GenerateRetrievalUrl( + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +WarehouseConnection::AnalyzeAsset( + google::cloud::visionai::v1::AnalyzeAssetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::AnalyzeAsset( + NoAwaitTag, google::cloud::visionai::v1::AnalyzeAssetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::AnalyzeAsset(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::IndexAsset( + google::cloud::visionai::v1::IndexAssetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::IndexAsset( + NoAwaitTag, google::cloud::visionai::v1::IndexAssetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::IndexAsset(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::RemoveIndexAsset( + google::cloud::visionai::v1::RemoveIndexAssetRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::RemoveIndexAsset( + NoAwaitTag, google::cloud::visionai::v1::RemoveIndexAssetRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::RemoveIndexAsset(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +WarehouseConnection::ViewIndexedAssets( + google::cloud::visionai::v1:: + ViewIndexedAssetsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +future> +WarehouseConnection::CreateIndex( + google::cloud::visionai::v1::CreateIndexRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::CreateIndex( + NoAwaitTag, google::cloud::visionai::v1::CreateIndexRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::CreateIndex(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::UpdateIndex( + google::cloud::visionai::v1::UpdateIndexRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::UpdateIndex( + NoAwaitTag, google::cloud::visionai::v1::UpdateIndexRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::UpdateIndex(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::GetIndex( + google::cloud::visionai::v1::GetIndexRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +WarehouseConnection::ListIndexes( + google::cloud::visionai::v1:: + ListIndexesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +future> +WarehouseConnection::DeleteIndex( + google::cloud::visionai::v1::DeleteIndexRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::DeleteIndex( + NoAwaitTag, google::cloud::visionai::v1::DeleteIndexRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::DeleteIndex(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::CreateCorpus( + google::cloud::visionai::v1::CreateCorpusRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::CreateCorpus( + NoAwaitTag, google::cloud::visionai::v1::CreateCorpusRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::CreateCorpus(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::GetCorpus( + google::cloud::visionai::v1::GetCorpusRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr WarehouseConnection::UpdateCorpus( + google::cloud::visionai::v1::UpdateCorpusRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +WarehouseConnection::ListCorpora( + google::cloud::visionai::v1:: + ListCorporaRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +Status WarehouseConnection::DeleteCorpus( + google::cloud::visionai::v1::DeleteCorpusRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +WarehouseConnection::AnalyzeCorpus( + google::cloud::visionai::v1::AnalyzeCorpusRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::AnalyzeCorpus( + NoAwaitTag, google::cloud::visionai::v1::AnalyzeCorpusRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::AnalyzeCorpus(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WarehouseConnection::CreateDataSchema( + google::cloud::visionai::v1::CreateDataSchemaRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +WarehouseConnection::UpdateDataSchema( + google::cloud::visionai::v1::UpdateDataSchemaRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +WarehouseConnection::GetDataSchema( + google::cloud::visionai::v1::GetDataSchemaRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status WarehouseConnection::DeleteDataSchema( + google::cloud::visionai::v1::DeleteDataSchemaRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +WarehouseConnection::ListDataSchemas( + google::cloud::visionai::v1:: + ListDataSchemasRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +WarehouseConnection::CreateAnnotation( + google::cloud::visionai::v1::CreateAnnotationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +WarehouseConnection::GetAnnotation( + google::cloud::visionai::v1::GetAnnotationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +WarehouseConnection::ListAnnotations( + google::cloud::visionai::v1:: + ListAnnotationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +WarehouseConnection::UpdateAnnotation( + google::cloud::visionai::v1::UpdateAnnotationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status WarehouseConnection::DeleteAnnotation( + google::cloud::visionai::v1::DeleteAnnotationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> +WarehouseConnection::AsyncIngestAsset() { + return std::make_unique< + ::google::cloud::internal::AsyncStreamingReadWriteRpcError< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WarehouseConnection::ClipAsset( + google::cloud::visionai::v1::ClipAssetRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +WarehouseConnection::GenerateHlsUri( + google::cloud::visionai::v1::GenerateHlsUriRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +WarehouseConnection::ImportAssets( + google::cloud::visionai::v1::ImportAssetsRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::ImportAssets( + NoAwaitTag, google::cloud::visionai::v1::ImportAssetsRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::ImportAssets(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WarehouseConnection::CreateSearchConfig( + google::cloud::visionai::v1::CreateSearchConfigRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +WarehouseConnection::UpdateSearchConfig( + google::cloud::visionai::v1::UpdateSearchConfigRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +WarehouseConnection::GetSearchConfig( + google::cloud::visionai::v1::GetSearchConfigRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status WarehouseConnection::DeleteSearchConfig( + google::cloud::visionai::v1::DeleteSearchConfigRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +WarehouseConnection::ListSearchConfigs( + google::cloud::visionai::v1:: + ListSearchConfigsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +WarehouseConnection::CreateSearchHypernym( + google::cloud::visionai::v1::CreateSearchHypernymRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +WarehouseConnection::UpdateSearchHypernym( + google::cloud::visionai::v1::UpdateSearchHypernymRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +WarehouseConnection::GetSearchHypernym( + google::cloud::visionai::v1::GetSearchHypernymRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status WarehouseConnection::DeleteSearchHypernym( + google::cloud::visionai::v1::DeleteSearchHypernymRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +WarehouseConnection::ListSearchHypernyms( + google::cloud::visionai::v1:: + ListSearchHypernymsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StreamRange +WarehouseConnection::SearchAssets( + google::cloud::visionai::v1:: + SearchAssetsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StreamRange +WarehouseConnection::SearchIndexEndpoint( + google::cloud::visionai::v1:: + SearchIndexEndpointRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +future> +WarehouseConnection::CreateIndexEndpoint( + google::cloud::visionai::v1::CreateIndexEndpointRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WarehouseConnection::CreateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexEndpointRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::CreateIndexEndpoint( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WarehouseConnection::GetIndexEndpoint( + google::cloud::visionai::v1::GetIndexEndpointRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +WarehouseConnection::ListIndexEndpoints( + google::cloud::visionai::v1:: + ListIndexEndpointsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +future> +WarehouseConnection::UpdateIndexEndpoint( + google::cloud::visionai::v1::UpdateIndexEndpointRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WarehouseConnection::UpdateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::UpdateIndexEndpoint( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::DeleteIndexEndpoint( + google::cloud::visionai::v1::DeleteIndexEndpointRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WarehouseConnection::DeleteIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::DeleteIndexEndpoint( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::DeployIndex( + google::cloud::visionai::v1::DeployIndexRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::DeployIndex( + NoAwaitTag, google::cloud::visionai::v1::DeployIndexRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::DeployIndex(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::UndeployIndex( + google::cloud::visionai::v1::UndeployIndexRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::UndeployIndex( + NoAwaitTag, google::cloud::visionai::v1::UndeployIndexRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::UndeployIndex(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::CreateCollection( + google::cloud::visionai::v1::CreateCollectionRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::CreateCollection( + NoAwaitTag, google::cloud::visionai::v1::CreateCollectionRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::CreateCollection(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::DeleteCollection( + google::cloud::visionai::v1::DeleteCollectionRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr WarehouseConnection::DeleteCollection( + NoAwaitTag, google::cloud::visionai::v1::DeleteCollectionRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WarehouseConnection::DeleteCollection(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WarehouseConnection::GetCollection( + google::cloud::visionai::v1::GetCollectionRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +WarehouseConnection::UpdateCollection( + google::cloud::visionai::v1::UpdateCollectionRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +WarehouseConnection::ListCollections( + google::cloud::visionai::v1:: + ListCollectionsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +WarehouseConnection::AddCollectionItem( + google::cloud::visionai::v1::AddCollectionItemRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StatusOr +WarehouseConnection::RemoveCollectionItem( + google::cloud::visionai::v1::RemoveCollectionItemRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +WarehouseConnection::ViewCollectionItems( + google::cloud::visionai::v1:: + ViewCollectionItemsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StreamRange +WarehouseConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr WarehouseConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange WarehouseConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr WarehouseConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status WarehouseConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status WarehouseConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeWarehouseConnection(Options options) { + internal::CheckExpectedOptions(options, __func__); + options = visionai_v1_internal::WarehouseDefaultOptions(std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = visionai_v1_internal::CreateDefaultWarehouseStub(std::move(auth), + options); + return visionai_v1_internal::MakeWarehouseTracingConnection( + std::make_shared( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/warehouse_connection.h b/google/cloud/visionai/v1/warehouse_connection.h new file mode 100644 index 0000000000000..9ae35d5015266 --- /dev/null +++ b/google/cloud/visionai/v1/warehouse_connection.h @@ -0,0 +1,583 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_WAREHOUSE_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_WAREHOUSE_CONNECTION_H + +#include "google/cloud/visionai/v1/internal/warehouse_retry_traits.h" +#include "google/cloud/visionai/v1/warehouse.pb.h" +#include "google/cloud/visionai/v1/warehouse_connection_idempotency_policy.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/future.h" +#include "google/cloud/internal/async_read_write_stream_impl.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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `WarehouseConnection`. +class WarehouseRetryPolicy : 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 `WarehouseConnection` 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 WarehouseLimitedErrorCountRetryPolicy : public WarehouseRetryPolicy { + 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 WarehouseLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + WarehouseLimitedErrorCountRetryPolicy( + WarehouseLimitedErrorCountRetryPolicy&& rhs) noexcept + : WarehouseLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + WarehouseLimitedErrorCountRetryPolicy( + WarehouseLimitedErrorCountRetryPolicy const& rhs) noexcept + : WarehouseLimitedErrorCountRetryPolicy(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 = WarehouseRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + visionai_v1_internal::WarehouseRetryTraits> + impl_; +}; + +/** + * A retry policy for `WarehouseConnection` 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 WarehouseLimitedTimeRetryPolicy : public WarehouseRetryPolicy { + 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 WarehouseLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + WarehouseLimitedTimeRetryPolicy( + WarehouseLimitedTimeRetryPolicy&& rhs) noexcept + : WarehouseLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + WarehouseLimitedTimeRetryPolicy( + WarehouseLimitedTimeRetryPolicy const& rhs) noexcept + : WarehouseLimitedTimeRetryPolicy(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 = WarehouseRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + visionai_v1_internal::WarehouseRetryTraits> + impl_; +}; + +/** + * The `WarehouseConnection` object for `WarehouseClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `WarehouseClient`. This allows users to inject custom behavior + * (e.g., with a Google Mock object) when writing tests that use objects of type + * `WarehouseClient`. + * + * To create a concrete instance, see `MakeWarehouseConnection()`. + * + * For mocking, see `visionai_v1_mocks::MockWarehouseConnection`. + */ +class WarehouseConnection { + public: + virtual ~WarehouseConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StatusOr CreateAsset( + google::cloud::visionai::v1::CreateAssetRequest const& request); + + virtual StatusOr UpdateAsset( + google::cloud::visionai::v1::UpdateAssetRequest const& request); + + virtual StatusOr GetAsset( + google::cloud::visionai::v1::GetAssetRequest const& request); + + virtual StreamRange ListAssets( + google::cloud::visionai::v1::ListAssetsRequest request); + + virtual future> + DeleteAsset(google::cloud::visionai::v1::DeleteAssetRequest const& request); + + virtual StatusOr DeleteAsset( + NoAwaitTag, + google::cloud::visionai::v1::DeleteAssetRequest const& request); + + virtual future> + DeleteAsset(google::longrunning::Operation const& operation); + + virtual future> + UploadAsset(google::cloud::visionai::v1::UploadAssetRequest const& request); + + virtual StatusOr UploadAsset( + NoAwaitTag, + google::cloud::visionai::v1::UploadAssetRequest const& request); + + virtual future> + UploadAsset(google::longrunning::Operation const& operation); + + virtual StatusOr + GenerateRetrievalUrl( + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request); + + virtual future> + AnalyzeAsset(google::cloud::visionai::v1::AnalyzeAssetRequest const& request); + + virtual StatusOr AnalyzeAsset( + NoAwaitTag, + google::cloud::visionai::v1::AnalyzeAssetRequest const& request); + + virtual future> + AnalyzeAsset(google::longrunning::Operation const& operation); + + virtual future> + IndexAsset(google::cloud::visionai::v1::IndexAssetRequest const& request); + + virtual StatusOr IndexAsset( + NoAwaitTag, + google::cloud::visionai::v1::IndexAssetRequest const& request); + + virtual future> + IndexAsset(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + RemoveIndexAsset( + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request); + + virtual StatusOr RemoveIndexAsset( + NoAwaitTag, + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request); + + virtual future< + StatusOr> + RemoveIndexAsset(google::longrunning::Operation const& operation); + + virtual StreamRange + ViewIndexedAssets( + google::cloud::visionai::v1::ViewIndexedAssetsRequest request); + + virtual future> CreateIndex( + google::cloud::visionai::v1::CreateIndexRequest const& request); + + virtual StatusOr CreateIndex( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexRequest const& request); + + virtual future> CreateIndex( + google::longrunning::Operation const& operation); + + virtual future> UpdateIndex( + google::cloud::visionai::v1::UpdateIndexRequest const& request); + + virtual StatusOr UpdateIndex( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexRequest const& request); + + virtual future> UpdateIndex( + google::longrunning::Operation const& operation); + + virtual StatusOr GetIndex( + google::cloud::visionai::v1::GetIndexRequest const& request); + + virtual StreamRange ListIndexes( + google::cloud::visionai::v1::ListIndexesRequest request); + + virtual future> + DeleteIndex(google::cloud::visionai::v1::DeleteIndexRequest const& request); + + virtual StatusOr DeleteIndex( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexRequest const& request); + + virtual future> + DeleteIndex(google::longrunning::Operation const& operation); + + virtual future> CreateCorpus( + google::cloud::visionai::v1::CreateCorpusRequest const& request); + + virtual StatusOr CreateCorpus( + NoAwaitTag, + google::cloud::visionai::v1::CreateCorpusRequest const& request); + + virtual future> CreateCorpus( + google::longrunning::Operation const& operation); + + virtual StatusOr GetCorpus( + google::cloud::visionai::v1::GetCorpusRequest const& request); + + virtual StatusOr UpdateCorpus( + google::cloud::visionai::v1::UpdateCorpusRequest const& request); + + virtual StreamRange ListCorpora( + google::cloud::visionai::v1::ListCorporaRequest request); + + virtual Status DeleteCorpus( + google::cloud::visionai::v1::DeleteCorpusRequest const& request); + + virtual future> + AnalyzeCorpus( + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request); + + virtual StatusOr AnalyzeCorpus( + NoAwaitTag, + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request); + + virtual future> + AnalyzeCorpus(google::longrunning::Operation const& operation); + + virtual StatusOr CreateDataSchema( + google::cloud::visionai::v1::CreateDataSchemaRequest const& request); + + virtual StatusOr UpdateDataSchema( + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request); + + virtual StatusOr GetDataSchema( + google::cloud::visionai::v1::GetDataSchemaRequest const& request); + + virtual Status DeleteDataSchema( + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request); + + virtual StreamRange ListDataSchemas( + google::cloud::visionai::v1::ListDataSchemasRequest request); + + virtual StatusOr CreateAnnotation( + google::cloud::visionai::v1::CreateAnnotationRequest const& request); + + virtual StatusOr GetAnnotation( + google::cloud::visionai::v1::GetAnnotationRequest const& request); + + virtual StreamRange ListAnnotations( + google::cloud::visionai::v1::ListAnnotationsRequest request); + + virtual StatusOr UpdateAnnotation( + google::cloud::visionai::v1::UpdateAnnotationRequest const& request); + + virtual Status DeleteAnnotation( + google::cloud::visionai::v1::DeleteAnnotationRequest const& request); + + virtual std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc< + google::cloud::visionai::v1::IngestAssetRequest, + google::cloud::visionai::v1::IngestAssetResponse>> + AsyncIngestAsset(); + + virtual StatusOr ClipAsset( + google::cloud::visionai::v1::ClipAssetRequest const& request); + + virtual StatusOr + GenerateHlsUri( + google::cloud::visionai::v1::GenerateHlsUriRequest const& request); + + virtual future> + ImportAssets(google::cloud::visionai::v1::ImportAssetsRequest const& request); + + virtual StatusOr ImportAssets( + NoAwaitTag, + google::cloud::visionai::v1::ImportAssetsRequest const& request); + + virtual future> + ImportAssets(google::longrunning::Operation const& operation); + + virtual StatusOr + CreateSearchConfig( + google::cloud::visionai::v1::CreateSearchConfigRequest const& request); + + virtual StatusOr + UpdateSearchConfig( + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request); + + virtual StatusOr GetSearchConfig( + google::cloud::visionai::v1::GetSearchConfigRequest const& request); + + virtual Status DeleteSearchConfig( + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request); + + virtual StreamRange + ListSearchConfigs( + google::cloud::visionai::v1::ListSearchConfigsRequest request); + + virtual StatusOr + CreateSearchHypernym( + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request); + + virtual StatusOr + UpdateSearchHypernym( + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request); + + virtual StatusOr + GetSearchHypernym( + google::cloud::visionai::v1::GetSearchHypernymRequest const& request); + + virtual Status DeleteSearchHypernym( + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request); + + virtual StreamRange + ListSearchHypernyms( + google::cloud::visionai::v1::ListSearchHypernymsRequest request); + + virtual StreamRange + SearchAssets(google::cloud::visionai::v1::SearchAssetsRequest request); + + virtual StreamRange + SearchIndexEndpoint( + google::cloud::visionai::v1::SearchIndexEndpointRequest request); + + virtual future> + CreateIndexEndpoint( + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request); + + virtual StatusOr CreateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request); + + virtual future> + CreateIndexEndpoint(google::longrunning::Operation const& operation); + + virtual StatusOr GetIndexEndpoint( + google::cloud::visionai::v1::GetIndexEndpointRequest const& request); + + virtual StreamRange + ListIndexEndpoints( + google::cloud::visionai::v1::ListIndexEndpointsRequest request); + + virtual future> + UpdateIndexEndpoint( + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request); + + virtual StatusOr UpdateIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request); + + virtual future> + UpdateIndexEndpoint(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteIndexEndpoint( + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request); + + virtual StatusOr DeleteIndexEndpoint( + NoAwaitTag, + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request); + + virtual future< + StatusOr> + DeleteIndexEndpoint(google::longrunning::Operation const& operation); + + virtual future> + DeployIndex(google::cloud::visionai::v1::DeployIndexRequest const& request); + + virtual StatusOr DeployIndex( + NoAwaitTag, + google::cloud::visionai::v1::DeployIndexRequest const& request); + + virtual future> + DeployIndex(google::longrunning::Operation const& operation); + + virtual future> + UndeployIndex( + google::cloud::visionai::v1::UndeployIndexRequest const& request); + + virtual StatusOr UndeployIndex( + NoAwaitTag, + google::cloud::visionai::v1::UndeployIndexRequest const& request); + + virtual future> + UndeployIndex(google::longrunning::Operation const& operation); + + virtual future> + CreateCollection( + google::cloud::visionai::v1::CreateCollectionRequest const& request); + + virtual StatusOr CreateCollection( + NoAwaitTag, + google::cloud::visionai::v1::CreateCollectionRequest const& request); + + virtual future> + CreateCollection(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteCollection( + google::cloud::visionai::v1::DeleteCollectionRequest const& request); + + virtual StatusOr DeleteCollection( + NoAwaitTag, + google::cloud::visionai::v1::DeleteCollectionRequest const& request); + + virtual future< + StatusOr> + DeleteCollection(google::longrunning::Operation const& operation); + + virtual StatusOr GetCollection( + google::cloud::visionai::v1::GetCollectionRequest const& request); + + virtual StatusOr UpdateCollection( + google::cloud::visionai::v1::UpdateCollectionRequest const& request); + + virtual StreamRange ListCollections( + google::cloud::visionai::v1::ListCollectionsRequest request); + + virtual StatusOr + AddCollectionItem( + google::cloud::visionai::v1::AddCollectionItemRequest const& request); + + virtual StatusOr + RemoveCollectionItem( + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request); + + virtual StreamRange + ViewCollectionItems( + google::cloud::visionai::v1::ViewCollectionItemsRequest request); + + 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 `WarehouseConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of WarehouseClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `WarehouseConnection`. Expected options are any of the types in + * the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::visionai_v1::WarehousePolicyOptionList` + * + * @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 `WarehouseConnection` created by + * this function. + */ +std::shared_ptr MakeWarehouseConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_WAREHOUSE_CONNECTION_H diff --git a/google/cloud/visionai/v1/warehouse_connection_idempotency_policy.cc b/google/cloud/visionai/v1/warehouse_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..726c1f1a021e3 --- /dev/null +++ b/google/cloud/visionai/v1/warehouse_connection_idempotency_policy.cc @@ -0,0 +1,385 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#include "google/cloud/visionai/v1/warehouse_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +WarehouseConnectionIdempotencyPolicy::~WarehouseConnectionIdempotencyPolicy() = + default; + +std::unique_ptr +WarehouseConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency WarehouseConnectionIdempotencyPolicy::CreateAsset( + google::cloud::visionai::v1::CreateAssetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::UpdateAsset( + google::cloud::visionai::v1::UpdateAssetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::GetAsset( + google::cloud::visionai::v1::GetAssetRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ListAssets( + google::cloud::visionai::v1::ListAssetsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::DeleteAsset( + google::cloud::visionai::v1::DeleteAssetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::UploadAsset( + google::cloud::visionai::v1::UploadAssetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::GenerateRetrievalUrl( + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::AnalyzeAsset( + google::cloud::visionai::v1::AnalyzeAssetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::IndexAsset( + google::cloud::visionai::v1::IndexAssetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::RemoveIndexAsset( + google::cloud::visionai::v1::RemoveIndexAssetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ViewIndexedAssets( + google::cloud::visionai::v1::ViewIndexedAssetsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::CreateIndex( + google::cloud::visionai::v1::CreateIndexRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::UpdateIndex( + google::cloud::visionai::v1::UpdateIndexRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::GetIndex( + google::cloud::visionai::v1::GetIndexRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ListIndexes( + google::cloud::visionai::v1::ListIndexesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::DeleteIndex( + google::cloud::visionai::v1::DeleteIndexRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::CreateCorpus( + google::cloud::visionai::v1::CreateCorpusRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::GetCorpus( + google::cloud::visionai::v1::GetCorpusRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::UpdateCorpus( + google::cloud::visionai::v1::UpdateCorpusRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ListCorpora( + google::cloud::visionai::v1::ListCorporaRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::DeleteCorpus( + google::cloud::visionai::v1::DeleteCorpusRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::AnalyzeCorpus( + google::cloud::visionai::v1::AnalyzeCorpusRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::CreateDataSchema( + google::cloud::visionai::v1::CreateDataSchemaRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::UpdateDataSchema( + google::cloud::visionai::v1::UpdateDataSchemaRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::GetDataSchema( + google::cloud::visionai::v1::GetDataSchemaRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::DeleteDataSchema( + google::cloud::visionai::v1::DeleteDataSchemaRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ListDataSchemas( + google::cloud::visionai::v1::ListDataSchemasRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::CreateAnnotation( + google::cloud::visionai::v1::CreateAnnotationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::GetAnnotation( + google::cloud::visionai::v1::GetAnnotationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ListAnnotations( + google::cloud::visionai::v1::ListAnnotationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::UpdateAnnotation( + google::cloud::visionai::v1::UpdateAnnotationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::DeleteAnnotation( + google::cloud::visionai::v1::DeleteAnnotationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ClipAsset( + google::cloud::visionai::v1::ClipAssetRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::GenerateHlsUri( + google::cloud::visionai::v1::GenerateHlsUriRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ImportAssets( + google::cloud::visionai::v1::ImportAssetsRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::CreateSearchConfig( + google::cloud::visionai::v1::CreateSearchConfigRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::UpdateSearchConfig( + google::cloud::visionai::v1::UpdateSearchConfigRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::GetSearchConfig( + google::cloud::visionai::v1::GetSearchConfigRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::DeleteSearchConfig( + google::cloud::visionai::v1::DeleteSearchConfigRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ListSearchConfigs( + google::cloud::visionai::v1::ListSearchConfigsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::CreateSearchHypernym( + google::cloud::visionai::v1::CreateSearchHypernymRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::UpdateSearchHypernym( + google::cloud::visionai::v1::UpdateSearchHypernymRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::GetSearchHypernym( + google::cloud::visionai::v1::GetSearchHypernymRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::DeleteSearchHypernym( + google::cloud::visionai::v1::DeleteSearchHypernymRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ListSearchHypernyms( + google::cloud::visionai::v1::ListSearchHypernymsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::SearchAssets( + google::cloud::visionai::v1::SearchAssetsRequest) { // NOLINT + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::SearchIndexEndpoint( + google::cloud::visionai::v1::SearchIndexEndpointRequest) { // NOLINT + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::CreateIndexEndpoint( + google::cloud::visionai::v1::CreateIndexEndpointRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::GetIndexEndpoint( + google::cloud::visionai::v1::GetIndexEndpointRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ListIndexEndpoints( + google::cloud::visionai::v1::ListIndexEndpointsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::UpdateIndexEndpoint( + google::cloud::visionai::v1::UpdateIndexEndpointRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::DeleteIndexEndpoint( + google::cloud::visionai::v1::DeleteIndexEndpointRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::DeployIndex( + google::cloud::visionai::v1::DeployIndexRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::UndeployIndex( + google::cloud::visionai::v1::UndeployIndexRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::CreateCollection( + google::cloud::visionai::v1::CreateCollectionRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::DeleteCollection( + google::cloud::visionai::v1::DeleteCollectionRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::GetCollection( + google::cloud::visionai::v1::GetCollectionRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::UpdateCollection( + google::cloud::visionai::v1::UpdateCollectionRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ListCollections( + google::cloud::visionai::v1::ListCollectionsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::AddCollectionItem( + google::cloud::visionai::v1::AddCollectionItemRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::RemoveCollectionItem( + google::cloud::visionai::v1::RemoveCollectionItemRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ViewCollectionItems( + google::cloud::visionai::v1::ViewCollectionItemsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WarehouseConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultWarehouseConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/visionai/v1/warehouse_connection_idempotency_policy.h b/google/cloud/visionai/v1/warehouse_connection_idempotency_policy.h new file mode 100644 index 0000000000000..d3cfbbf55ae5e --- /dev/null +++ b/google/cloud/visionai/v1/warehouse_connection_idempotency_policy.h @@ -0,0 +1,254 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_WAREHOUSE_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_WAREHOUSE_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/visionai/v1/warehouse.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WarehouseConnectionIdempotencyPolicy { + public: + virtual ~WarehouseConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() const; + + virtual google::cloud::Idempotency CreateAsset( + google::cloud::visionai::v1::CreateAssetRequest const& request); + + virtual google::cloud::Idempotency UpdateAsset( + google::cloud::visionai::v1::UpdateAssetRequest const& request); + + virtual google::cloud::Idempotency GetAsset( + google::cloud::visionai::v1::GetAssetRequest const& request); + + virtual google::cloud::Idempotency ListAssets( + google::cloud::visionai::v1::ListAssetsRequest request); + + virtual google::cloud::Idempotency DeleteAsset( + google::cloud::visionai::v1::DeleteAssetRequest const& request); + + virtual google::cloud::Idempotency UploadAsset( + google::cloud::visionai::v1::UploadAssetRequest const& request); + + virtual google::cloud::Idempotency GenerateRetrievalUrl( + google::cloud::visionai::v1::GenerateRetrievalUrlRequest const& request); + + virtual google::cloud::Idempotency AnalyzeAsset( + google::cloud::visionai::v1::AnalyzeAssetRequest const& request); + + virtual google::cloud::Idempotency IndexAsset( + google::cloud::visionai::v1::IndexAssetRequest const& request); + + virtual google::cloud::Idempotency RemoveIndexAsset( + google::cloud::visionai::v1::RemoveIndexAssetRequest const& request); + + virtual google::cloud::Idempotency ViewIndexedAssets( + google::cloud::visionai::v1::ViewIndexedAssetsRequest request); + + virtual google::cloud::Idempotency CreateIndex( + google::cloud::visionai::v1::CreateIndexRequest const& request); + + virtual google::cloud::Idempotency UpdateIndex( + google::cloud::visionai::v1::UpdateIndexRequest const& request); + + virtual google::cloud::Idempotency GetIndex( + google::cloud::visionai::v1::GetIndexRequest const& request); + + virtual google::cloud::Idempotency ListIndexes( + google::cloud::visionai::v1::ListIndexesRequest request); + + virtual google::cloud::Idempotency DeleteIndex( + google::cloud::visionai::v1::DeleteIndexRequest const& request); + + virtual google::cloud::Idempotency CreateCorpus( + google::cloud::visionai::v1::CreateCorpusRequest const& request); + + virtual google::cloud::Idempotency GetCorpus( + google::cloud::visionai::v1::GetCorpusRequest const& request); + + virtual google::cloud::Idempotency UpdateCorpus( + google::cloud::visionai::v1::UpdateCorpusRequest const& request); + + virtual google::cloud::Idempotency ListCorpora( + google::cloud::visionai::v1::ListCorporaRequest request); + + virtual google::cloud::Idempotency DeleteCorpus( + google::cloud::visionai::v1::DeleteCorpusRequest const& request); + + virtual google::cloud::Idempotency AnalyzeCorpus( + google::cloud::visionai::v1::AnalyzeCorpusRequest const& request); + + virtual google::cloud::Idempotency CreateDataSchema( + google::cloud::visionai::v1::CreateDataSchemaRequest const& request); + + virtual google::cloud::Idempotency UpdateDataSchema( + google::cloud::visionai::v1::UpdateDataSchemaRequest const& request); + + virtual google::cloud::Idempotency GetDataSchema( + google::cloud::visionai::v1::GetDataSchemaRequest const& request); + + virtual google::cloud::Idempotency DeleteDataSchema( + google::cloud::visionai::v1::DeleteDataSchemaRequest const& request); + + virtual google::cloud::Idempotency ListDataSchemas( + google::cloud::visionai::v1::ListDataSchemasRequest request); + + virtual google::cloud::Idempotency CreateAnnotation( + google::cloud::visionai::v1::CreateAnnotationRequest const& request); + + virtual google::cloud::Idempotency GetAnnotation( + google::cloud::visionai::v1::GetAnnotationRequest const& request); + + virtual google::cloud::Idempotency ListAnnotations( + google::cloud::visionai::v1::ListAnnotationsRequest request); + + virtual google::cloud::Idempotency UpdateAnnotation( + google::cloud::visionai::v1::UpdateAnnotationRequest const& request); + + virtual google::cloud::Idempotency DeleteAnnotation( + google::cloud::visionai::v1::DeleteAnnotationRequest const& request); + + virtual google::cloud::Idempotency ClipAsset( + google::cloud::visionai::v1::ClipAssetRequest const& request); + + virtual google::cloud::Idempotency GenerateHlsUri( + google::cloud::visionai::v1::GenerateHlsUriRequest const& request); + + virtual google::cloud::Idempotency ImportAssets( + google::cloud::visionai::v1::ImportAssetsRequest const& request); + + virtual google::cloud::Idempotency CreateSearchConfig( + google::cloud::visionai::v1::CreateSearchConfigRequest const& request); + + virtual google::cloud::Idempotency UpdateSearchConfig( + google::cloud::visionai::v1::UpdateSearchConfigRequest const& request); + + virtual google::cloud::Idempotency GetSearchConfig( + google::cloud::visionai::v1::GetSearchConfigRequest const& request); + + virtual google::cloud::Idempotency DeleteSearchConfig( + google::cloud::visionai::v1::DeleteSearchConfigRequest const& request); + + virtual google::cloud::Idempotency ListSearchConfigs( + google::cloud::visionai::v1::ListSearchConfigsRequest request); + + virtual google::cloud::Idempotency CreateSearchHypernym( + google::cloud::visionai::v1::CreateSearchHypernymRequest const& request); + + virtual google::cloud::Idempotency UpdateSearchHypernym( + google::cloud::visionai::v1::UpdateSearchHypernymRequest const& request); + + virtual google::cloud::Idempotency GetSearchHypernym( + google::cloud::visionai::v1::GetSearchHypernymRequest const& request); + + virtual google::cloud::Idempotency DeleteSearchHypernym( + google::cloud::visionai::v1::DeleteSearchHypernymRequest const& request); + + virtual google::cloud::Idempotency ListSearchHypernyms( + google::cloud::visionai::v1::ListSearchHypernymsRequest request); + + virtual google::cloud::Idempotency SearchAssets( + google::cloud::visionai::v1::SearchAssetsRequest request); + + virtual google::cloud::Idempotency SearchIndexEndpoint( + google::cloud::visionai::v1::SearchIndexEndpointRequest request); + + virtual google::cloud::Idempotency CreateIndexEndpoint( + google::cloud::visionai::v1::CreateIndexEndpointRequest const& request); + + virtual google::cloud::Idempotency GetIndexEndpoint( + google::cloud::visionai::v1::GetIndexEndpointRequest const& request); + + virtual google::cloud::Idempotency ListIndexEndpoints( + google::cloud::visionai::v1::ListIndexEndpointsRequest request); + + virtual google::cloud::Idempotency UpdateIndexEndpoint( + google::cloud::visionai::v1::UpdateIndexEndpointRequest const& request); + + virtual google::cloud::Idempotency DeleteIndexEndpoint( + google::cloud::visionai::v1::DeleteIndexEndpointRequest const& request); + + virtual google::cloud::Idempotency DeployIndex( + google::cloud::visionai::v1::DeployIndexRequest const& request); + + virtual google::cloud::Idempotency UndeployIndex( + google::cloud::visionai::v1::UndeployIndexRequest const& request); + + virtual google::cloud::Idempotency CreateCollection( + google::cloud::visionai::v1::CreateCollectionRequest const& request); + + virtual google::cloud::Idempotency DeleteCollection( + google::cloud::visionai::v1::DeleteCollectionRequest const& request); + + virtual google::cloud::Idempotency GetCollection( + google::cloud::visionai::v1::GetCollectionRequest const& request); + + virtual google::cloud::Idempotency UpdateCollection( + google::cloud::visionai::v1::UpdateCollectionRequest const& request); + + virtual google::cloud::Idempotency ListCollections( + google::cloud::visionai::v1::ListCollectionsRequest request); + + virtual google::cloud::Idempotency AddCollectionItem( + google::cloud::visionai::v1::AddCollectionItemRequest const& request); + + virtual google::cloud::Idempotency RemoveCollectionItem( + google::cloud::visionai::v1::RemoveCollectionItemRequest const& request); + + virtual google::cloud::Idempotency ViewCollectionItems( + google::cloud::visionai::v1::ViewCollectionItemsRequest 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 +MakeDefaultWarehouseConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_WAREHOUSE_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/visionai/v1/warehouse_options.h b/google/cloud/visionai/v1/warehouse_options.h new file mode 100644 index 0000000000000..2be97b72bf3a9 --- /dev/null +++ b/google/cloud/visionai/v1/warehouse_options.h @@ -0,0 +1,86 @@ +// Copyright 2026 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/visionai/v1/warehouse.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_WAREHOUSE_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_WAREHOUSE_OPTIONS_H + +#include "google/cloud/visionai/v1/warehouse_connection.h" +#include "google/cloud/visionai/v1/warehouse_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 visionai_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-visionai-options + */ +struct WarehouseRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-visionai-options + */ +struct WarehouseBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-visionai-options + */ +struct WarehouseConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-visionai-options + */ +struct WarehousePollingPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to Warehouse. + * + * @ingroup google-cloud-visionai-options + */ +using WarehousePolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace visionai_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_VISIONAI_V1_WAREHOUSE_OPTIONS_H diff --git a/google/cloud/vmmigration/quickstart/.bazelversion b/google/cloud/vmmigration/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/vmmigration/quickstart/.bazelversion +++ b/google/cloud/vmmigration/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/vmmigration/quickstart/WORKSPACE.bazel b/google/cloud/vmmigration/quickstart/WORKSPACE.bazel index ae43e169e4e6b..c1a50ca2012b6 100644 --- a/google/cloud/vmmigration/quickstart/WORKSPACE.bazel +++ b/google/cloud/vmmigration/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/vmmigration/v1/vm_migration_client.h b/google/cloud/vmmigration/v1/vm_migration_client.h index 6c8b161584af4..74c6ba9551c5b 100644 --- a/google/cloud/vmmigration/v1/vm_migration_client.h +++ b/google/cloud/vmmigration/v1/vm_migration_client.h @@ -6167,7 +6167,7 @@ class VmMigrationClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -6206,7 +6206,7 @@ class VmMigrationClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/vmwareengine/quickstart/.bazelversion b/google/cloud/vmwareengine/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/vmwareengine/quickstart/.bazelversion +++ b/google/cloud/vmwareengine/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/vmwareengine/quickstart/WORKSPACE.bazel b/google/cloud/vmwareengine/quickstart/WORKSPACE.bazel index a3b0aa0c34ac0..2901fff9c41bb 100644 --- a/google/cloud/vmwareengine/quickstart/WORKSPACE.bazel +++ b/google/cloud/vmwareengine/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/vpcaccess/quickstart/.bazelversion b/google/cloud/vpcaccess/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/vpcaccess/quickstart/.bazelversion +++ b/google/cloud/vpcaccess/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/vpcaccess/quickstart/WORKSPACE.bazel b/google/cloud/vpcaccess/quickstart/WORKSPACE.bazel index 4b0daa2bcb897..33442d60c953b 100644 --- a/google/cloud/vpcaccess/quickstart/WORKSPACE.bazel +++ b/google/cloud/vpcaccess/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/webrisk/quickstart/.bazelversion b/google/cloud/webrisk/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/webrisk/quickstart/.bazelversion +++ b/google/cloud/webrisk/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/webrisk/quickstart/WORKSPACE.bazel b/google/cloud/webrisk/quickstart/WORKSPACE.bazel index 7a5d8be434a28..00979578feff7 100644 --- a/google/cloud/webrisk/quickstart/WORKSPACE.bazel +++ b/google/cloud/webrisk/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/webrisk/v1/web_risk_client.h b/google/cloud/webrisk/v1/web_risk_client.h index f88bbc9d5ded4..61f6874b269ed 100644 --- a/google/cloud/webrisk/v1/web_risk_client.h +++ b/google/cloud/webrisk/v1/web_risk_client.h @@ -734,7 +734,7 @@ class WebRiskServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -773,7 +773,7 @@ class WebRiskServiceClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/google/cloud/websecurityscanner/quickstart/.bazelversion b/google/cloud/websecurityscanner/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/websecurityscanner/quickstart/.bazelversion +++ b/google/cloud/websecurityscanner/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/websecurityscanner/quickstart/WORKSPACE.bazel b/google/cloud/websecurityscanner/quickstart/WORKSPACE.bazel index 5a666bd35e9e3..881a08fbb465c 100644 --- a/google/cloud/websecurityscanner/quickstart/WORKSPACE.bazel +++ b/google/cloud/websecurityscanner/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/workflows/quickstart/.bazelversion b/google/cloud/workflows/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/workflows/quickstart/.bazelversion +++ b/google/cloud/workflows/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/workflows/quickstart/WORKSPACE.bazel b/google/cloud/workflows/quickstart/WORKSPACE.bazel index c23bbe3df66e8..a0b4c590b8474 100644 --- a/google/cloud/workflows/quickstart/WORKSPACE.bazel +++ b/google/cloud/workflows/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/workloadmanager/BUILD.bazel b/google/cloud/workloadmanager/BUILD.bazel new file mode 100644 index 0000000000000..d43e336b24af1 --- /dev/null +++ b/google/cloud/workloadmanager/BUILD.bazel @@ -0,0 +1,31 @@ +# Copyright 2026 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 = [ + "@googleapis//google/cloud/workloadmanager/v1:workloadmanager_cc_grpc", +] + +cc_gapic_library( + name = "workloadmanager", + googleapis_deps = googleapis_deps, + service_dirs = service_dirs, +) diff --git a/google/cloud/workloadmanager/CMakeLists.txt b/google/cloud/workloadmanager/CMakeLists.txt new file mode 100644 index 0000000000000..c825e6687093c --- /dev/null +++ b/google/cloud/workloadmanager/CMakeLists.txt @@ -0,0 +1,35 @@ +# ~~~ +# Copyright 2026 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(workloadmanager "Workload Manager API" + SERVICE_DIRS "v1/") + +if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) + add_executable(workloadmanager_quickstart "quickstart/quickstart.cc") + target_link_libraries(workloadmanager_quickstart + PRIVATE google-cloud-cpp::workloadmanager) + google_cloud_cpp_add_common_options(workloadmanager_quickstart) + add_test( + NAME workloadmanager_quickstart + COMMAND + cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" + $ GOOGLE_CLOUD_PROJECT + GOOGLE_CLOUD_CPP_TEST_REGION) + set_tests_properties(workloadmanager_quickstart + PROPERTIES LABELS "integration-test;quickstart") +endif () diff --git a/google/cloud/workloadmanager/README.md b/google/cloud/workloadmanager/README.md new file mode 100644 index 0000000000000..f856aca88dc40 --- /dev/null +++ b/google/cloud/workloadmanager/README.md @@ -0,0 +1,63 @@ +# Workload Manager API C++ Client Library + +This directory contains an idiomatic C++ client library for the +[Workload Manager API][cloud-service-docs]. + +Workload Manager is a service that provides tooling for enterprise workloads to +automate the deployment and validation of your workloads against best practices +and recommendations. + +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/workloadmanager/v1/workload_manager_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 workloadmanager = ::google::cloud::workloadmanager_v1; + auto client = workloadmanager::WorkloadManagerClient( + workloadmanager::MakeWorkloadManagerConnection()); + + for (auto r : client.ListEvaluations(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 [Workload Manager 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://docs.cloud.google.com/workload-manager/docs +[doxygen-link]: https://cloud.google.com/cpp/docs/reference/workloadmanager/latest/ +[source-link]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/workloadmanager diff --git a/google/cloud/workloadmanager/doc/environment-variables.dox b/google/cloud/workloadmanager/doc/environment-variables.dox new file mode 100644 index 0000000000000..bd4c3459c1035 --- /dev/null +++ b/google/cloud/workloadmanager/doc/environment-variables.dox @@ -0,0 +1,49 @@ +/*! +@page workloadmanager-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 workloadmanager-env-endpoint Endpoint Overrides + + + +- `GOOGLE_CLOUD_CPP_WORKLOAD_MANAGER_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "workloadmanager.googleapis.com") + used by `MakeWorkloadManagerConnection()`. + + + +@see google::cloud::EndpointOption + +@section workloadmanager-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 workloadmanager-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/workloadmanager/doc/main.dox b/google/cloud/workloadmanager/doc/main.dox new file mode 100644 index 0000000000000..c2274b0aff035 --- /dev/null +++ b/google/cloud/workloadmanager/doc/main.dox @@ -0,0 +1,50 @@ +/*! + +@mainpage Workload Manager API C++ Client Library + +An idiomatic C++ client library for the [Workload Manager API][cloud-service-docs]. + +Workload Manager is a service that provides tooling for enterprise +workloads to automate the deployment and validation of your workloads +against best practices and recommendations. + +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/workloadmanager/quickstart/` directory, +which should give you a taste of the Workload Manager API C++ client library API. + +@snippet quickstart.cc all + +## Main classes + + +The main class in this library is +[`workloadmanager_v1::WorkloadManagerClient`](@ref google::cloud::workloadmanager_v1::WorkloadManagerClient). All RPCs are exposed +as member functions of this class. Other classes provide helpers, configuration +parameters, and infrastructure to mock +[`workloadmanager_v1::WorkloadManagerClient`](@ref google::cloud::workloadmanager_v1::WorkloadManagerClient) when testing your +application. + + +## More Information + +- @ref common-error-handling - describes how the library reports errors. +- @ref workloadmanager-override-endpoint - describes how to override the default + endpoint. +- @ref workloadmanager-override-authentication - describes how to change the + authentication credentials used by the library. +- @ref workloadmanager-override-retry - describes how to change the default retry + policies. +- @ref workloadmanager-env - describes environment variables that can configure the + behavior of the library. +- @ref workloadmanager-override-universe-domain - describes how to override the default universe domain. + +[cloud-service-docs]: https://docs.cloud.google.com/workload-manager/docs + +*/ diff --git a/google/cloud/workloadmanager/doc/options.dox b/google/cloud/workloadmanager/doc/options.dox new file mode 100644 index 0000000000000..5e6391ae1b68b --- /dev/null +++ b/google/cloud/workloadmanager/doc/options.dox @@ -0,0 +1,10 @@ +/*! +@defgroup google-cloud-workloadmanager-options Workload Manager 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/workloadmanager/doc/override-authentication.dox b/google/cloud/workloadmanager/doc/override-authentication.dox new file mode 100644 index 0000000000000..c88623cf0cf26 --- /dev/null +++ b/google/cloud/workloadmanager/doc/override-authentication.dox @@ -0,0 +1,35 @@ +/*! +@page workloadmanager-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 workload_manager_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 workloadmanager_v1::WorkloadManagerClient-service-account-snippet Override workloadmanager_v1::WorkloadManagerClient Authentication Defaults + +@snippet google/cloud/workloadmanager/v1/samples/workload_manager_client_samples.cc with-service-account + +*/ +// diff --git a/google/cloud/workloadmanager/doc/override-endpoint.dox b/google/cloud/workloadmanager/doc/override-endpoint.dox new file mode 100644 index 0000000000000..29a45e7dc1152 --- /dev/null +++ b/google/cloud/workloadmanager/doc/override-endpoint.dox @@ -0,0 +1,25 @@ +/*! +@page workloadmanager-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 `workloadmanager_v1::WorkloadManagerClient`: + +@snippet workload_manager_client_samples.cc set-client-endpoint + + + +*/ + +// + +/*! @page workloadmanager_v1::WorkloadManagerClient-endpoint-snippet Override workloadmanager_v1::WorkloadManagerClient Endpoint Configuration + +@snippet google/cloud/workloadmanager/v1/samples/workload_manager_client_samples.cc set-client-endpoint + +*/ +// diff --git a/google/cloud/workloadmanager/doc/override-retry-policies.dox b/google/cloud/workloadmanager/doc/override-retry-policies.dox new file mode 100644 index 0000000000000..a686e4500bbea --- /dev/null +++ b/google/cloud/workloadmanager/doc/override-retry-policies.dox @@ -0,0 +1,108 @@ +/*! +@page workloadmanager-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 workloadmanager-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 workloadmanager-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 workloadmanager-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 workloadmanager-override-retry-example Example + + +For example, this will override the retry policies for `workloadmanager_v1::WorkloadManagerClient`: + +@snippet workload_manager_client_samples.cc set-retry-policy + +This assumes you have created a custom idempotency policy. Such as: + +@snippet workload_manager_client_samples.cc custom-idempotency-policy + +This will override the polling policies for `workloadmanager_v1::WorkloadManagerClient` + +@snippet workload_manager_client_samples.cc set-polling-policy + + + + +@section workloadmanager-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 workloadmanager_v1::WorkloadManagerClient-retry-snippet Override workloadmanager_v1::WorkloadManagerClient Retry Policies + +This shows how to override the retry policies for workloadmanager_v1::WorkloadManagerClient: + +@snippet google/cloud/workloadmanager/v1/samples/workload_manager_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/workloadmanager/v1/samples/workload_manager_client_samples.cc custom-idempotency-policy + +*/ +// diff --git a/google/cloud/workloadmanager/doc/override-universe-domain.dox b/google/cloud/workloadmanager/doc/override-universe-domain.dox new file mode 100644 index 0000000000000..0bf06728649f3 --- /dev/null +++ b/google/cloud/workloadmanager/doc/override-universe-domain.dox @@ -0,0 +1,24 @@ +/*! +@page workloadmanager-override-universe-domain How to Override the Default Universe Domain + +In some cases, you may need to override the default universe domain used by the +client library. Use `AddUniverseDomainOption` when initializing the client +library to change this default. + + +For example, this will override the default universe domain for `workloadmanager_v1::WorkloadManagerClient`: + +@snippet workload_manager_client_samples.cc set-client-universe-domain + + + +*/ + +// + +/*! @page workloadmanager_v1::WorkloadManagerClient-universe-domain-snippet Override workloadmanager_v1::WorkloadManagerClient Universe Domain + +@snippet google/cloud/workloadmanager/v1/samples/workload_manager_client_samples.cc set-client-universe-domain + +*/ +// diff --git a/google/cloud/workloadmanager/quickstart/.bazelrc b/google/cloud/workloadmanager/quickstart/.bazelrc new file mode 100644 index 0000000000000..c884db46c2b4d --- /dev/null +++ b/google/cloud/workloadmanager/quickstart/.bazelrc @@ -0,0 +1,30 @@ +# Copyright 2026 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/workloadmanager/quickstart/BUILD.bazel b/google/cloud/workloadmanager/quickstart/BUILD.bazel new file mode 100644 index 0000000000000..0d1df16d51c6c --- /dev/null +++ b/google/cloud/workloadmanager/quickstart/BUILD.bazel @@ -0,0 +1,25 @@ +# Copyright 2026 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//:workloadmanager", + ], +) diff --git a/google/cloud/workloadmanager/quickstart/CMakeLists.txt b/google/cloud/workloadmanager/quickstart/CMakeLists.txt new file mode 100644 index 0000000000000..ea9c6a1b94f07 --- /dev/null +++ b/google/cloud/workloadmanager/quickstart/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright 2026 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 Workload Manager API C++ client library from a +# larger CMake project. + +cmake_minimum_required(VERSION 3.22...3.31) +project(google-cloud-cpp-workloadmanager-quickstart CXX) + +find_package(google_cloud_cpp_workloadmanager 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::workloadmanager) diff --git a/google/cloud/workloadmanager/quickstart/Makefile b/google/cloud/workloadmanager/quickstart/Makefile new file mode 100644 index 0000000000000..e8e75c309e9ea --- /dev/null +++ b/google/cloud/workloadmanager/quickstart/Makefile @@ -0,0 +1,35 @@ +# Copyright 2026 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 Workload Manager 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 Workload Manager API C++ +# client library. +CLIENT_MODULE := google_cloud_cpp_workloadmanager +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/workloadmanager/quickstart/README.md b/google/cloud/workloadmanager/quickstart/README.md new file mode 100644 index 0000000000000..bb0d9b44d7008 --- /dev/null +++ b/google/cloud/workloadmanager/quickstart/README.md @@ -0,0 +1,135 @@ +# HOWTO: using the Workload Manager API C++ client in your project + +This directory contains small examples showing how to use the Workload Manager +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, Workload Manager 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/workloadmanager/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,workloadmanager] + ``` + + 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/workloadmanager/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/workloadmanager/quickstart/WORKSPACE.bazel b/google/cloud/workloadmanager/quickstart/WORKSPACE.bazel new file mode 100644 index 0000000000000..07a0f0ed39c09 --- /dev/null +++ b/google/cloud/workloadmanager/quickstart/WORKSPACE.bazel @@ -0,0 +1,53 @@ +# Copyright 2026 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 Workload Manager 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 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.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/workloadmanager/quickstart/quickstart.cc b/google/cloud/workloadmanager/quickstart/quickstart.cc new file mode 100644 index 0000000000000..089dffd1e3d8e --- /dev/null +++ b/google/cloud/workloadmanager/quickstart/quickstart.cc @@ -0,0 +1,42 @@ +// Copyright 2026 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/workloadmanager/v1/workload_manager_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 workloadmanager = ::google::cloud::workloadmanager_v1; + auto client = workloadmanager::WorkloadManagerClient( + workloadmanager::MakeWorkloadManagerConnection()); + + for (auto r : client.ListEvaluations(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/workloadmanager/v1/.repo-metadata.json b/google/cloud/workloadmanager/v1/.repo-metadata.json new file mode 100644 index 0000000000000..05dc57006f644 --- /dev/null +++ b/google/cloud/workloadmanager/v1/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "api_id": "workloadmanager.googleapis.com", + "api_shortname": "workloadmanager", + "client_documentation": "https://cloud.google.com/cpp/docs/reference/workloadmanager/latest", + "distribution_name": "google-cloud-cpp", + "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:1631482%20status=open", + "language": "cpp", + "library_type": "GAPIC_AUTO", + "name_pretty": "Workload Manager API", + "product_documentation": "https://docs.cloud.google.com/workload-manager/docs", + "release_level": "stable", + "repo": "googleapis/google-cloud-cpp", + "requires_billing": true +} diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_auth_decorator.cc b/google/cloud/workloadmanager/v1/internal/workload_manager_auth_decorator.cc new file mode 100644 index 0000000000000..e4d50b6159e9c --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_auth_decorator.cc @@ -0,0 +1,339 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_auth_decorator.h" +#include "google/cloud/workloadmanager/v1/service.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WorkloadManagerAuth::WorkloadManagerAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +WorkloadManagerAuth::ListEvaluations( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListEvaluationsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListEvaluations(context, options, request); +} + +StatusOr +WorkloadManagerAuth::GetEvaluation( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetEvaluation(context, options, request); +} + +future> +WorkloadManagerAuth::AsyncCreateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest 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->AsyncCreateEvaluation(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WorkloadManagerAuth::CreateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateEvaluation(context, options, request); +} + +future> +WorkloadManagerAuth::AsyncUpdateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest 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->AsyncUpdateEvaluation(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WorkloadManagerAuth::UpdateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateEvaluation(context, options, request); +} + +future> +WorkloadManagerAuth::AsyncDeleteEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest 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->AsyncDeleteEvaluation(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WorkloadManagerAuth::DeleteEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteEvaluation(context, options, request); +} + +StatusOr +WorkloadManagerAuth::ListExecutions( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListExecutions(context, options, request); +} + +StatusOr +WorkloadManagerAuth::GetExecution( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetExecution(context, options, request); +} + +future> +WorkloadManagerAuth::AsyncRunEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::RunEvaluationRequest 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->AsyncRunEvaluation(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WorkloadManagerAuth::RunEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->RunEvaluation(context, options, request); +} + +future> +WorkloadManagerAuth::AsyncDeleteExecution( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest 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->AsyncDeleteExecution(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr WorkloadManagerAuth::DeleteExecution( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteExecution(context, options, request); +} + +StatusOr +WorkloadManagerAuth::ListExecutionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionResultsRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListExecutionResults(context, options, request); +} + +StatusOr +WorkloadManagerAuth::ListRules( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListRulesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListRules(context, options, request); +} + +StatusOr +WorkloadManagerAuth::ListScannedResources( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListScannedResourcesRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListScannedResources(context, options, request); +} + +StatusOr +WorkloadManagerAuth::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 WorkloadManagerAuth::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 +WorkloadManagerAuth::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 WorkloadManagerAuth::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 WorkloadManagerAuth::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 WorkloadManagerAuth::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> +WorkloadManagerAuth::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 WorkloadManagerAuth::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 workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_auth_decorator.h b/google/cloud/workloadmanager/v1/internal/workload_manager_auth_decorator.h new file mode 100644 index 0000000000000..e445fe39002e7 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_auth_decorator.h @@ -0,0 +1,192 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_AUTH_DECORATOR_H + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WorkloadManagerAuth : public WorkloadManagerStub { + public: + ~WorkloadManagerAuth() override = default; + WorkloadManagerAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr + ListEvaluations( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListEvaluationsRequest const& request) + override; + + StatusOr GetEvaluation( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) + override; + + future> AsyncCreateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + StatusOr CreateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + future> AsyncUpdateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + StatusOr UpdateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + future> AsyncDeleteEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + StatusOr DeleteEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + StatusOr + ListExecutions( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionsRequest const& request) + override; + + StatusOr GetExecution( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) + override; + + future> AsyncRunEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + StatusOr RunEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + future> AsyncDeleteExecution( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + StatusOr DeleteExecution( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + StatusOr + ListExecutionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionResultsRequest const& + request) override; + + StatusOr ListRules( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListRulesRequest const& request) + override; + + StatusOr + ListScannedResources( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListScannedResourcesRequest 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 workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_AUTH_DECORATOR_H diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_connection_impl.cc b/google/cloud/workloadmanager/v1/internal/workload_manager_connection_impl.cc new file mode 100644 index 0000000000000..96bfd93aa44bc --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_connection_impl.cc @@ -0,0 +1,857 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_connection_impl.h" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_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 workloadmanager_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 + +WorkloadManagerConnectionImpl::WorkloadManagerConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions(std::move(options), + WorkloadManagerConnection::options())) {} + +StreamRange +WorkloadManagerConnectionImpl::ListEvaluations( + google::cloud::workloadmanager::v1::ListEvaluationsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListEvaluations(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::workloadmanager::v1::ListEvaluationsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1:: + ListEvaluationsRequest const& request) { + return stub->ListEvaluations(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::workloadmanager::v1::ListEvaluationsResponse r) { + std::vector result( + r.evaluations().size()); + auto& messages = *r.mutable_evaluations(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +WorkloadManagerConnectionImpl::GetEvaluation( + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetEvaluation(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetEvaluationRequest const& + request) { + return stub_->GetEvaluation(context, options, request); + }, + *current, request, __func__); +} + +future> +WorkloadManagerConnectionImpl::CreateEvaluation( + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateEvaluation(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::workloadmanager::v1::Evaluation>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + return stub->AsyncCreateEvaluation(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::workloadmanager::v1::Evaluation>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +WorkloadManagerConnectionImpl::CreateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateEvaluation(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + return stub_->CreateEvaluation(context, options, request); + }, + *current, request, __func__); +} + +future> +WorkloadManagerConnectionImpl::CreateEvaluation( + 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 CreateEvaluation", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::workloadmanager::v1::Evaluation>( + 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::workloadmanager::v1::Evaluation>, + polling_policy(*current), __func__); +} + +future> +WorkloadManagerConnectionImpl::UpdateEvaluation( + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateEvaluation(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::workloadmanager::v1::Evaluation>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + return stub->AsyncUpdateEvaluation(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::workloadmanager::v1::Evaluation>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +WorkloadManagerConnectionImpl::UpdateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateEvaluation(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + return stub_->UpdateEvaluation(context, options, request); + }, + *current, request, __func__); +} + +future> +WorkloadManagerConnectionImpl::UpdateEvaluation( + 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 UpdateEvaluation", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::workloadmanager::v1::Evaluation>( + 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::workloadmanager::v1::Evaluation>, + polling_policy(*current), __func__); +} + +future> +WorkloadManagerConnectionImpl::DeleteEvaluation( + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteEvaluation(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::workloadmanager::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::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + return stub->AsyncDeleteEvaluation(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::workloadmanager::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +WorkloadManagerConnectionImpl::DeleteEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteEvaluation(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + return stub_->DeleteEvaluation(context, options, request); + }, + *current, request, __func__); +} + +future> +WorkloadManagerConnectionImpl::DeleteEvaluation( + 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 DeleteEvaluation", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::workloadmanager::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::workloadmanager::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +WorkloadManagerConnectionImpl::ListExecutions( + google::cloud::workloadmanager::v1::ListExecutionsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListExecutions(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::workloadmanager::v1::ListExecutionsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionsRequest const& + request) { + return stub->ListExecutions(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::workloadmanager::v1::ListExecutionsResponse r) { + std::vector result( + r.executions().size()); + auto& messages = *r.mutable_executions(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +WorkloadManagerConnectionImpl::GetExecution( + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetExecution(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetExecutionRequest const& + request) { + return stub_->GetExecution(context, options, request); + }, + *current, request, __func__); +} + +future> +WorkloadManagerConnectionImpl::RunEvaluation( + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->RunEvaluation(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::workloadmanager::v1::Execution>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& + request) { + return stub->AsyncRunEvaluation(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::workloadmanager::v1::Execution>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +WorkloadManagerConnectionImpl::RunEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->RunEvaluation(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& + request) { + return stub_->RunEvaluation(context, options, request); + }, + *current, request, __func__); +} + +future> +WorkloadManagerConnectionImpl::RunEvaluation( + 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 RunEvaluation", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::workloadmanager::v1::Execution>( + 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::workloadmanager::v1::Execution>, + polling_policy(*current), __func__); +} + +future> +WorkloadManagerConnectionImpl::DeleteExecution( + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteExecution(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::workloadmanager::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::workloadmanager::v1::DeleteExecutionRequest const& + request) { + return stub->AsyncDeleteExecution(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::workloadmanager::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +WorkloadManagerConnectionImpl::DeleteExecution( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteExecution(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& + request) { + return stub_->DeleteExecution(context, options, request); + }, + *current, request, __func__); +} + +future> +WorkloadManagerConnectionImpl::DeleteExecution( + 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 DeleteExecution", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::workloadmanager::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::workloadmanager::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +WorkloadManagerConnectionImpl::ListExecutionResults( + google::cloud::workloadmanager::v1::ListExecutionResultsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListExecutionResults(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::workloadmanager::v1::ListExecutionResultsRequest const& + r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1:: + ListExecutionResultsRequest const& request) { + return stub->ListExecutionResults(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::workloadmanager::v1::ListExecutionResultsResponse r) { + std::vector result( + r.execution_results().size()); + auto& messages = *r.mutable_execution_results(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +WorkloadManagerConnectionImpl::ListRules( + google::cloud::workloadmanager::v1::ListRulesRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ListRules(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListRulesRequest const& request) { + return stub_->ListRules(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +WorkloadManagerConnectionImpl::ListScannedResources( + google::cloud::workloadmanager::v1::ListScannedResourcesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = + idempotency_policy(*current)->ListScannedResources(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::workloadmanager::v1::ListScannedResourcesRequest const& + r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1:: + ListScannedResourcesRequest const& request) { + return stub->ListScannedResources(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::workloadmanager::v1::ListScannedResourcesResponse r) { + std::vector result( + r.scanned_resources().size()); + auto& messages = *r.mutable_scanned_resources(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StreamRange +WorkloadManagerConnectionImpl::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 +WorkloadManagerConnectionImpl::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 +WorkloadManagerConnectionImpl::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 +WorkloadManagerConnectionImpl::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 WorkloadManagerConnectionImpl::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 WorkloadManagerConnectionImpl::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 workloadmanager_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_connection_impl.h b/google/cloud/workloadmanager/v1/internal/workload_manager_connection_impl.h new file mode 100644 index 0000000000000..aadc87cdf5bb3 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_connection_impl.h @@ -0,0 +1,178 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_CONNECTION_IMPL_H + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_retry_traits.h" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_stub.h" +#include "google/cloud/workloadmanager/v1/workload_manager_connection.h" +#include "google/cloud/workloadmanager/v1/workload_manager_connection_idempotency_policy.h" +#include "google/cloud/workloadmanager/v1/workload_manager_options.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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WorkloadManagerConnectionImpl + : public workloadmanager_v1::WorkloadManagerConnection { + public: + ~WorkloadManagerConnectionImpl() override = default; + + WorkloadManagerConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + StreamRange ListEvaluations( + google::cloud::workloadmanager::v1::ListEvaluationsRequest request) + override; + + StatusOr GetEvaluation( + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) + override; + + future> + CreateEvaluation( + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + StatusOr CreateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + future> + CreateEvaluation(google::longrunning::Operation const& operation) override; + + future> + UpdateEvaluation( + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + StatusOr UpdateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + future> + UpdateEvaluation(google::longrunning::Operation const& operation) override; + + future> + DeleteEvaluation( + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + StatusOr DeleteEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + future> + DeleteEvaluation(google::longrunning::Operation const& operation) override; + + StreamRange ListExecutions( + google::cloud::workloadmanager::v1::ListExecutionsRequest request) + override; + + StatusOr GetExecution( + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) + override; + + future> RunEvaluation( + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + StatusOr RunEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + future> RunEvaluation( + google::longrunning::Operation const& operation) override; + + future> + DeleteExecution( + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + StatusOr DeleteExecution( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + future> + DeleteExecution(google::longrunning::Operation const& operation) override; + + StreamRange + ListExecutionResults( + google::cloud::workloadmanager::v1::ListExecutionResultsRequest request) + override; + + StatusOr ListRules( + google::cloud::workloadmanager::v1::ListRulesRequest const& request) + override; + + StreamRange + ListScannedResources( + google::cloud::workloadmanager::v1::ListScannedResourcesRequest request) + 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 workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_CONNECTION_IMPL_H diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_logging_decorator.cc b/google/cloud/workloadmanager/v1/internal/workload_manager_logging_decorator.cc new file mode 100644 index 0000000000000..ae88dc4fb5c2b --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_logging_decorator.cc @@ -0,0 +1,409 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_logging_decorator.h" +#include "google/cloud/workloadmanager/v1/service.grpc.pb.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WorkloadManagerLogging::WorkloadManagerLogging( + std::shared_ptr child, TracingOptions tracing_options, + std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +WorkloadManagerLogging::ListEvaluations( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListEvaluationsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListEvaluationsRequest const& + request) { + return child_->ListEvaluations(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WorkloadManagerLogging::GetEvaluation( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetEvaluationRequest const& + request) { + return child_->GetEvaluation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WorkloadManagerLogging::AsyncCreateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + return child_->AsyncCreateEvaluation(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +WorkloadManagerLogging::CreateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + return child_->CreateEvaluation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WorkloadManagerLogging::AsyncUpdateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + return child_->AsyncUpdateEvaluation(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +WorkloadManagerLogging::UpdateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + return child_->UpdateEvaluation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WorkloadManagerLogging::AsyncDeleteEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + return child_->AsyncDeleteEvaluation(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +WorkloadManagerLogging::DeleteEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + return child_->DeleteEvaluation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WorkloadManagerLogging::ListExecutions( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionsRequest const& + request) { + return child_->ListExecutions(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WorkloadManagerLogging::GetExecution( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetExecutionRequest const& + request) { + return child_->GetExecution(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WorkloadManagerLogging::AsyncRunEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& + request) { + return child_->AsyncRunEvaluation(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr WorkloadManagerLogging::RunEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& + request) { + return child_->RunEvaluation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +WorkloadManagerLogging::AsyncDeleteExecution( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& + request) { + return child_->AsyncDeleteExecution(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +WorkloadManagerLogging::DeleteExecution( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& + request) { + return child_->DeleteExecution(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WorkloadManagerLogging::ListExecutionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionResultsRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionResultsRequest const& + request) { + return child_->ListExecutionResults(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WorkloadManagerLogging::ListRules( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListRulesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListRulesRequest const& request) { + return child_->ListRules(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WorkloadManagerLogging::ListScannedResources( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListScannedResourcesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListScannedResourcesRequest const& + request) { + return child_->ListScannedResources(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +WorkloadManagerLogging::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 WorkloadManagerLogging::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 +WorkloadManagerLogging::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 WorkloadManagerLogging::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 WorkloadManagerLogging::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 WorkloadManagerLogging::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> +WorkloadManagerLogging::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 WorkloadManagerLogging::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 workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_logging_decorator.h b/google/cloud/workloadmanager/v1/internal/workload_manager_logging_decorator.h new file mode 100644 index 0000000000000..504a5c1b9349f --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_logging_decorator.h @@ -0,0 +1,192 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_LOGGING_DECORATOR_H + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WorkloadManagerLogging : public WorkloadManagerStub { + public: + ~WorkloadManagerLogging() override = default; + WorkloadManagerLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr + ListEvaluations( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListEvaluationsRequest const& request) + override; + + StatusOr GetEvaluation( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) + override; + + future> AsyncCreateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + StatusOr CreateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + future> AsyncUpdateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + StatusOr UpdateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + future> AsyncDeleteEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + StatusOr DeleteEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + StatusOr + ListExecutions( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionsRequest const& request) + override; + + StatusOr GetExecution( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) + override; + + future> AsyncRunEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + StatusOr RunEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + future> AsyncDeleteExecution( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + StatusOr DeleteExecution( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + StatusOr + ListExecutionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionResultsRequest const& + request) override; + + StatusOr ListRules( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListRulesRequest const& request) + override; + + StatusOr + ListScannedResources( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListScannedResourcesRequest 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_; +}; // WorkloadManagerLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_LOGGING_DECORATOR_H diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_metadata_decorator.cc b/google/cloud/workloadmanager/v1/internal/workload_manager_metadata_decorator.cc new file mode 100644 index 0000000000000..67edc95cfd9b7 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_metadata_decorator.cc @@ -0,0 +1,320 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_metadata_decorator.h" +#include "google/cloud/workloadmanager/v1/service.grpc.pb.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WorkloadManagerMetadata::WorkloadManagerMetadata( + 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 +WorkloadManagerMetadata::ListEvaluations( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListEvaluationsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListEvaluations(context, options, request); +} + +StatusOr +WorkloadManagerMetadata::GetEvaluation( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetEvaluation(context, options, request); +} + +future> +WorkloadManagerMetadata::AsyncCreateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateEvaluation(cq, std::move(context), + std::move(options), request); +} + +StatusOr +WorkloadManagerMetadata::CreateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateEvaluation(context, options, request); +} + +future> +WorkloadManagerMetadata::AsyncUpdateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("evaluation.name=", + internal::UrlEncode(request.evaluation().name()))); + return child_->AsyncUpdateEvaluation(cq, std::move(context), + std::move(options), request); +} + +StatusOr +WorkloadManagerMetadata::UpdateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("evaluation.name=", + internal::UrlEncode(request.evaluation().name()))); + return child_->UpdateEvaluation(context, options, request); +} + +future> +WorkloadManagerMetadata::AsyncDeleteEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteEvaluation(cq, std::move(context), + std::move(options), request); +} + +StatusOr +WorkloadManagerMetadata::DeleteEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteEvaluation(context, options, request); +} + +StatusOr +WorkloadManagerMetadata::ListExecutions( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListExecutions(context, options, request); +} + +StatusOr +WorkloadManagerMetadata::GetExecution( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetExecution(context, options, request); +} + +future> +WorkloadManagerMetadata::AsyncRunEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncRunEvaluation(cq, std::move(context), std::move(options), + request); +} + +StatusOr WorkloadManagerMetadata::RunEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->RunEvaluation(context, options, request); +} + +future> +WorkloadManagerMetadata::AsyncDeleteExecution( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteExecution(cq, std::move(context), + std::move(options), request); +} + +StatusOr +WorkloadManagerMetadata::DeleteExecution( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteExecution(context, options, request); +} + +StatusOr +WorkloadManagerMetadata::ListExecutionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionResultsRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListExecutionResults(context, options, request); +} + +StatusOr +WorkloadManagerMetadata::ListRules( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListRulesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListRules(context, options, request); +} + +StatusOr +WorkloadManagerMetadata::ListScannedResources( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListScannedResourcesRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListScannedResources(context, options, request); +} + +StatusOr +WorkloadManagerMetadata::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 +WorkloadManagerMetadata::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 +WorkloadManagerMetadata::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 WorkloadManagerMetadata::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 WorkloadManagerMetadata::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 WorkloadManagerMetadata::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> +WorkloadManagerMetadata::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 WorkloadManagerMetadata::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 WorkloadManagerMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void WorkloadManagerMetadata::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 workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_metadata_decorator.h b/google/cloud/workloadmanager/v1/internal/workload_manager_metadata_decorator.h new file mode 100644 index 0000000000000..ace230d880be7 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_metadata_decorator.h @@ -0,0 +1,198 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_METADATA_DECORATOR_H + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WorkloadManagerMetadata : public WorkloadManagerStub { + public: + ~WorkloadManagerMetadata() override = default; + WorkloadManagerMetadata( + std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr + ListEvaluations( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListEvaluationsRequest const& request) + override; + + StatusOr GetEvaluation( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) + override; + + future> AsyncCreateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + StatusOr CreateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + future> AsyncUpdateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + StatusOr UpdateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + future> AsyncDeleteEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + StatusOr DeleteEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + StatusOr + ListExecutions( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionsRequest const& request) + override; + + StatusOr GetExecution( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) + override; + + future> AsyncRunEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + StatusOr RunEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + future> AsyncDeleteExecution( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + StatusOr DeleteExecution( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + StatusOr + ListExecutionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionResultsRequest const& + request) override; + + StatusOr ListRules( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListRulesRequest const& request) + override; + + StatusOr + ListScannedResources( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListScannedResourcesRequest 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 workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_METADATA_DECORATOR_H diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_option_defaults.cc b/google/cloud/workloadmanager/v1/internal/workload_manager_option_defaults.cc new file mode 100644 index 0000000000000..021144eecc896 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_option_defaults.cc @@ -0,0 +1,81 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_option_defaults.h" +#include "google/cloud/workloadmanager/v1/workload_manager_connection.h" +#include "google/cloud/workloadmanager/v1/workload_manager_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 workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options WorkloadManagerDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_WORKLOAD_MANAGER_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_WORKLOAD_MANAGER_AUTHORITY", + "workloadmanager.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + workloadmanager_v1::WorkloadManagerLimitedTimeRetryPolicy( + std::chrono::minutes(10)) + .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< + workloadmanager_v1::WorkloadManagerRetryPolicyOption::Type, + workloadmanager_v1::WorkloadManagerBackoffPolicyOption::Type>( + options.get() + ->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } + if (!options.has()) { + options.set< + workloadmanager_v1::WorkloadManagerConnectionIdempotencyPolicyOption>( + workloadmanager_v1:: + MakeDefaultWorkloadManagerConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_option_defaults.h b/google/cloud/workloadmanager/v1/internal/workload_manager_option_defaults.h new file mode 100644 index 0000000000000..2e2a291e68550 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options WorkloadManagerDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_OPTION_DEFAULTS_H diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_retry_traits.h b/google/cloud/workloadmanager/v1/internal/workload_manager_retry_traits.h new file mode 100644 index 0000000000000..7dac520bd1335 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct WorkloadManagerRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_RETRY_TRAITS_H diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_sources.cc b/google/cloud/workloadmanager/v1/internal/workload_manager_sources.cc new file mode 100644 index 0000000000000..3127a1b168606 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/workloadmanager/v1/internal/workload_manager_auth_decorator.cc" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_connection_impl.cc" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_logging_decorator.cc" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_metadata_decorator.cc" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_option_defaults.cc" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_stub.cc" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_stub_factory.cc" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_tracing_connection.cc" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_tracing_stub.cc" +#include "google/cloud/workloadmanager/v1/workload_manager_client.cc" +#include "google/cloud/workloadmanager/v1/workload_manager_connection.cc" +#include "google/cloud/workloadmanager/v1/workload_manager_connection_idempotency_policy.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_stub.cc b/google/cloud/workloadmanager/v1/internal/workload_manager_stub.cc new file mode 100644 index 0000000000000..b6df8aa66f785 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_stub.cc @@ -0,0 +1,398 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_stub.h" +#include "google/cloud/workloadmanager/v1/service.grpc.pb.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WorkloadManagerStub::~WorkloadManagerStub() = default; + +StatusOr +DefaultWorkloadManagerStub::ListEvaluations( + grpc::ClientContext& context, Options const&, + google::cloud::workloadmanager::v1::ListEvaluationsRequest const& request) { + google::cloud::workloadmanager::v1::ListEvaluationsResponse response; + auto status = grpc_stub_->ListEvaluations(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWorkloadManagerStub::GetEvaluation( + grpc::ClientContext& context, Options const&, + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) { + google::cloud::workloadmanager::v1::Evaluation response; + auto status = grpc_stub_->GetEvaluation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWorkloadManagerStub::AsyncCreateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::workloadmanager::v1::CreateEvaluationRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateEvaluation(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultWorkloadManagerStub::CreateEvaluation( + grpc::ClientContext& context, Options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateEvaluation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWorkloadManagerStub::AsyncUpdateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::workloadmanager::v1::UpdateEvaluationRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateEvaluation(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultWorkloadManagerStub::UpdateEvaluation( + grpc::ClientContext& context, Options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateEvaluation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWorkloadManagerStub::AsyncDeleteEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::workloadmanager::v1::DeleteEvaluationRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteEvaluation(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultWorkloadManagerStub::DeleteEvaluation( + grpc::ClientContext& context, Options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteEvaluation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWorkloadManagerStub::ListExecutions( + grpc::ClientContext& context, Options const&, + google::cloud::workloadmanager::v1::ListExecutionsRequest const& request) { + google::cloud::workloadmanager::v1::ListExecutionsResponse response; + auto status = grpc_stub_->ListExecutions(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWorkloadManagerStub::GetExecution( + grpc::ClientContext& context, Options const&, + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) { + google::cloud::workloadmanager::v1::Execution response; + auto status = grpc_stub_->GetExecution(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWorkloadManagerStub::AsyncRunEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::workloadmanager::v1::RunEvaluationRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncRunEvaluation(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultWorkloadManagerStub::RunEvaluation( + grpc::ClientContext& context, Options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->RunEvaluation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultWorkloadManagerStub::AsyncDeleteExecution( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::workloadmanager::v1::DeleteExecutionRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteExecution(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultWorkloadManagerStub::DeleteExecution( + grpc::ClientContext& context, Options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteExecution(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWorkloadManagerStub::ListExecutionResults( + grpc::ClientContext& context, Options const&, + google::cloud::workloadmanager::v1::ListExecutionResultsRequest const& + request) { + google::cloud::workloadmanager::v1::ListExecutionResultsResponse response; + auto status = grpc_stub_->ListExecutionResults(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWorkloadManagerStub::ListRules( + grpc::ClientContext& context, Options const&, + google::cloud::workloadmanager::v1::ListRulesRequest const& request) { + google::cloud::workloadmanager::v1::ListRulesResponse response; + auto status = grpc_stub_->ListRules(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWorkloadManagerStub::ListScannedResources( + grpc::ClientContext& context, Options const&, + google::cloud::workloadmanager::v1::ListScannedResourcesRequest const& + request) { + google::cloud::workloadmanager::v1::ListScannedResourcesResponse response; + auto status = grpc_stub_->ListScannedResources(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultWorkloadManagerStub::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 +DefaultWorkloadManagerStub::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 +DefaultWorkloadManagerStub::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 +DefaultWorkloadManagerStub::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 DefaultWorkloadManagerStub::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 DefaultWorkloadManagerStub::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> +DefaultWorkloadManagerStub::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 DefaultWorkloadManagerStub::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 workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_stub.h b/google/cloud/workloadmanager/v1/internal/workload_manager_stub.h new file mode 100644 index 0000000000000..90324054f25c6 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_stub.h @@ -0,0 +1,353 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_STUB_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/workloadmanager/v1/service.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WorkloadManagerStub { + public: + virtual ~WorkloadManagerStub() = 0; + + virtual StatusOr + ListEvaluations( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListEvaluationsRequest const& + request) = 0; + + virtual StatusOr + GetEvaluation(grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetEvaluationRequest const& + request) = 0; + + virtual future> + AsyncCreateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) = 0; + + virtual StatusOr CreateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) = 0; + + virtual future> + AsyncUpdateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) = 0; + + virtual StatusOr UpdateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) = 0; + + virtual future> + AsyncDeleteEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) = 0; + + virtual StatusOr DeleteEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) = 0; + + virtual StatusOr + ListExecutions( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionsRequest const& + request) = 0; + + virtual StatusOr GetExecution( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetExecutionRequest const& + request) = 0; + + virtual future> AsyncRunEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& + request) = 0; + + virtual StatusOr RunEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& + request) = 0; + + virtual future> AsyncDeleteExecution( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& + request) = 0; + + virtual StatusOr DeleteExecution( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& + request) = 0; + + virtual StatusOr< + google::cloud::workloadmanager::v1::ListExecutionResultsResponse> + ListExecutionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionResultsRequest const& + request) = 0; + + virtual StatusOr + ListRules( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListRulesRequest const& request) = 0; + + virtual StatusOr< + google::cloud::workloadmanager::v1::ListScannedResourcesResponse> + ListScannedResources( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListScannedResourcesRequest 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 DefaultWorkloadManagerStub : public WorkloadManagerStub { + public: + DefaultWorkloadManagerStub( + std::unique_ptr< + google::cloud::workloadmanager::v1::WorkloadManager::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 + ListEvaluations( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListEvaluationsRequest const& request) + override; + + StatusOr GetEvaluation( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) + override; + + future> AsyncCreateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + StatusOr CreateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + future> AsyncUpdateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + StatusOr UpdateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + future> AsyncDeleteEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + StatusOr DeleteEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + StatusOr + ListExecutions( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionsRequest const& request) + override; + + StatusOr GetExecution( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) + override; + + future> AsyncRunEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + StatusOr RunEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + future> AsyncDeleteExecution( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + StatusOr DeleteExecution( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + StatusOr + ListExecutionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionResultsRequest const& + request) override; + + StatusOr ListRules( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListRulesRequest const& request) + override; + + StatusOr + ListScannedResources( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListScannedResourcesRequest 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::workloadmanager::v1::WorkloadManager::StubInterface> + grpc_stub_; + std::unique_ptr + locations_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_STUB_H diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_stub_factory.cc b/google/cloud/workloadmanager/v1/internal/workload_manager_stub_factory.cc new file mode 100644 index 0000000000000..030a5540c06be --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_stub_factory.cc @@ -0,0 +1,82 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_stub_factory.h" +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_auth_decorator.h" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_logging_decorator.h" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_metadata_decorator.h" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_stub.h" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_tracing_stub.h" +#include "google/cloud/workloadmanager/v1/service.grpc.pb.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 "google/longrunning/operations.grpc.pb.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultWorkloadManagerStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::workloadmanager::v1::WorkloadManager::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 = MakeWorkloadManagerTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_stub_factory.h b/google/cloud/workloadmanager/v1/internal/workload_manager_stub_factory.h new file mode 100644 index 0000000000000..714c2955df136 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_stub_factory.h @@ -0,0 +1,47 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_STUB_FACTORY_H + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultWorkloadManagerStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_STUB_FACTORY_H diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_tracing_connection.cc b/google/cloud/workloadmanager/v1/internal/workload_manager_tracing_connection.cc new file mode 100644 index 0000000000000..f12a3ff9d3005 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_tracing_connection.cc @@ -0,0 +1,330 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WorkloadManagerTracingConnection::WorkloadManagerTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StreamRange +WorkloadManagerTracingConnection::ListEvaluations( + google::cloud::workloadmanager::v1::ListEvaluationsRequest request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::ListEvaluations"); + internal::OTelScope scope(span); + auto sr = child_->ListEvaluations(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::workloadmanager::v1::Evaluation>(std::move(span), + std::move(sr)); +} + +StatusOr +WorkloadManagerTracingConnection::GetEvaluation( + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::GetEvaluation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetEvaluation(request)); +} + +future> +WorkloadManagerTracingConnection::CreateEvaluation( + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::CreateEvaluation"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateEvaluation(request)); +} + +StatusOr +WorkloadManagerTracingConnection::CreateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::CreateEvaluation"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateEvaluation(NoAwaitTag{}, request)); +} + +future> +WorkloadManagerTracingConnection::CreateEvaluation( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::CreateEvaluation"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateEvaluation(operation)); +} + +future> +WorkloadManagerTracingConnection::UpdateEvaluation( + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::UpdateEvaluation"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateEvaluation(request)); +} + +StatusOr +WorkloadManagerTracingConnection::UpdateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::UpdateEvaluation"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateEvaluation(NoAwaitTag{}, request)); +} + +future> +WorkloadManagerTracingConnection::UpdateEvaluation( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::UpdateEvaluation"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateEvaluation(operation)); +} + +future> +WorkloadManagerTracingConnection::DeleteEvaluation( + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::DeleteEvaluation"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteEvaluation(request)); +} + +StatusOr +WorkloadManagerTracingConnection::DeleteEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::DeleteEvaluation"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteEvaluation(NoAwaitTag{}, request)); +} + +future> +WorkloadManagerTracingConnection::DeleteEvaluation( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::DeleteEvaluation"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteEvaluation(operation)); +} + +StreamRange +WorkloadManagerTracingConnection::ListExecutions( + google::cloud::workloadmanager::v1::ListExecutionsRequest request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::ListExecutions"); + internal::OTelScope scope(span); + auto sr = child_->ListExecutions(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::workloadmanager::v1::Execution>(std::move(span), + std::move(sr)); +} + +StatusOr +WorkloadManagerTracingConnection::GetExecution( + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::GetExecution"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetExecution(request)); +} + +future> +WorkloadManagerTracingConnection::RunEvaluation( + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::RunEvaluation"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->RunEvaluation(request)); +} + +StatusOr +WorkloadManagerTracingConnection::RunEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::RunEvaluation"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->RunEvaluation(NoAwaitTag{}, request)); +} + +future> +WorkloadManagerTracingConnection::RunEvaluation( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::RunEvaluation"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->RunEvaluation(operation)); +} + +future> +WorkloadManagerTracingConnection::DeleteExecution( + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::DeleteExecution"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteExecution(request)); +} + +StatusOr +WorkloadManagerTracingConnection::DeleteExecution( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::DeleteExecution"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteExecution(NoAwaitTag{}, request)); +} + +future> +WorkloadManagerTracingConnection::DeleteExecution( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::DeleteExecution"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteExecution(operation)); +} + +StreamRange +WorkloadManagerTracingConnection::ListExecutionResults( + google::cloud::workloadmanager::v1::ListExecutionResultsRequest request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::ListExecutionResults"); + internal::OTelScope scope(span); + auto sr = child_->ListExecutionResults(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::workloadmanager::v1::ExecutionResult>(std::move(span), + std::move(sr)); +} + +StatusOr +WorkloadManagerTracingConnection::ListRules( + google::cloud::workloadmanager::v1::ListRulesRequest const& request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::ListRules"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->ListRules(request)); +} + +StreamRange +WorkloadManagerTracingConnection::ListScannedResources( + google::cloud::workloadmanager::v1::ListScannedResourcesRequest request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::ListScannedResources"); + internal::OTelScope scope(span); + auto sr = child_->ListScannedResources(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::workloadmanager::v1::ScannedResource>(std::move(span), + std::move(sr)); +} + +StreamRange +WorkloadManagerTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +WorkloadManagerTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +WorkloadManagerTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +WorkloadManagerTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status WorkloadManagerTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status WorkloadManagerTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "workloadmanager_v1::WorkloadManagerConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +std::shared_ptr +MakeWorkloadManagerTracingConnection( + std::shared_ptr conn) { + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared(std::move(conn)); + } + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_tracing_connection.h b/google/cloud/workloadmanager/v1/internal/workload_manager_tracing_connection.h new file mode 100644 index 0000000000000..22d55ab128208 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_tracing_connection.h @@ -0,0 +1,172 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_TRACING_CONNECTION_H + +#include "google/cloud/workloadmanager/v1/workload_manager_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WorkloadManagerTracingConnection + : public workloadmanager_v1::WorkloadManagerConnection { + public: + ~WorkloadManagerTracingConnection() override = default; + + explicit WorkloadManagerTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StreamRange ListEvaluations( + google::cloud::workloadmanager::v1::ListEvaluationsRequest request) + override; + + StatusOr GetEvaluation( + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) + override; + + future> + CreateEvaluation( + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + StatusOr CreateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + future> + CreateEvaluation(google::longrunning::Operation const& operation) override; + + future> + UpdateEvaluation( + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + StatusOr UpdateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + future> + UpdateEvaluation(google::longrunning::Operation const& operation) override; + + future> + DeleteEvaluation( + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + StatusOr DeleteEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + future> + DeleteEvaluation(google::longrunning::Operation const& operation) override; + + StreamRange ListExecutions( + google::cloud::workloadmanager::v1::ListExecutionsRequest request) + override; + + StatusOr GetExecution( + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) + override; + + future> RunEvaluation( + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + StatusOr RunEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + future> RunEvaluation( + google::longrunning::Operation const& operation) override; + + future> + DeleteExecution( + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + StatusOr DeleteExecution( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + future> + DeleteExecution(google::longrunning::Operation const& operation) override; + + StreamRange + ListExecutionResults( + google::cloud::workloadmanager::v1::ListExecutionResultsRequest request) + override; + + StatusOr ListRules( + google::cloud::workloadmanager::v1::ListRulesRequest const& request) + override; + + StreamRange + ListScannedResources( + google::cloud::workloadmanager::v1::ListScannedResourcesRequest request) + 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_; +}; + +/** + * 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 +MakeWorkloadManagerTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_TRACING_CONNECTION_H diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_tracing_stub.cc b/google/cloud/workloadmanager/v1/internal/workload_manager_tracing_stub.cc new file mode 100644 index 0000000000000..eaea46f70a2cf --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_tracing_stub.cc @@ -0,0 +1,372 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WorkloadManagerTracingStub::WorkloadManagerTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +WorkloadManagerTracingStub::ListEvaluations( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListEvaluationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "ListEvaluations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListEvaluations(context, options, request)); +} + +StatusOr +WorkloadManagerTracingStub::GetEvaluation( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "GetEvaluation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetEvaluation(context, options, request)); +} + +future> +WorkloadManagerTracingStub::AsyncCreateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "CreateEvaluation"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateEvaluation(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +WorkloadManagerTracingStub::CreateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "CreateEvaluation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateEvaluation(context, options, request)); +} + +future> +WorkloadManagerTracingStub::AsyncUpdateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "UpdateEvaluation"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateEvaluation(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +WorkloadManagerTracingStub::UpdateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "UpdateEvaluation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateEvaluation(context, options, request)); +} + +future> +WorkloadManagerTracingStub::AsyncDeleteEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "DeleteEvaluation"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteEvaluation(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +WorkloadManagerTracingStub::DeleteEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "DeleteEvaluation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteEvaluation(context, options, request)); +} + +StatusOr +WorkloadManagerTracingStub::ListExecutions( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "ListExecutions"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListExecutions(context, options, request)); +} + +StatusOr +WorkloadManagerTracingStub::GetExecution( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "GetExecution"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetExecution(context, options, request)); +} + +future> +WorkloadManagerTracingStub::AsyncRunEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "RunEvaluation"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncRunEvaluation(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +WorkloadManagerTracingStub::RunEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "RunEvaluation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->RunEvaluation(context, options, request)); +} + +future> +WorkloadManagerTracingStub::AsyncDeleteExecution( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "DeleteExecution"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteExecution(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +WorkloadManagerTracingStub::DeleteExecution( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "DeleteExecution"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteExecution(context, options, request)); +} + +StatusOr +WorkloadManagerTracingStub::ListExecutionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionResultsRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.workloadmanager.v1.WorkloadManager", + "ListExecutionResults"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListExecutionResults(context, options, request)); +} + +StatusOr +WorkloadManagerTracingStub::ListRules( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListRulesRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "ListRules"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListRules(context, options, request)); +} + +StatusOr +WorkloadManagerTracingStub::ListScannedResources( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListScannedResourcesRequest const& + request) { + auto span = + internal::MakeSpanGrpc("google.cloud.workloadmanager.v1.WorkloadManager", + "ListScannedResources"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListScannedResources(context, options, request)); +} + +StatusOr +WorkloadManagerTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +WorkloadManagerTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +WorkloadManagerTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +WorkloadManagerTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status WorkloadManagerTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status WorkloadManagerTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.workloadmanager.v1.WorkloadManager", "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +WorkloadManagerTracingStub::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 WorkloadManagerTracingStub::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)); +} + +std::shared_ptr MakeWorkloadManagerTracingStub( + std::shared_ptr stub) { + return std::make_shared(std::move(stub)); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" diff --git a/google/cloud/workloadmanager/v1/internal/workload_manager_tracing_stub.h b/google/cloud/workloadmanager/v1/internal/workload_manager_tracing_stub.h new file mode 100644 index 0000000000000..9da129e3f8c93 --- /dev/null +++ b/google/cloud/workloadmanager/v1/internal/workload_manager_tracing_stub.h @@ -0,0 +1,200 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_TRACING_STUB_H + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +// Must be included last. +#include "google/cloud/ports_def.inc" + +namespace google { +namespace cloud { +namespace workloadmanager_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WorkloadManagerTracingStub : public WorkloadManagerStub { + public: + ~WorkloadManagerTracingStub() override = default; + + explicit WorkloadManagerTracingStub( + std::shared_ptr child); + + StatusOr + ListEvaluations( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListEvaluationsRequest const& request) + override; + + StatusOr GetEvaluation( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request) + override; + + future> AsyncCreateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + StatusOr CreateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request) override; + + future> AsyncUpdateEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + StatusOr UpdateEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request) override; + + future> AsyncDeleteEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + StatusOr DeleteEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request) override; + + StatusOr + ListExecutions( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionsRequest const& request) + override; + + StatusOr GetExecution( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::GetExecutionRequest const& request) + override; + + future> AsyncRunEvaluation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + StatusOr RunEvaluation( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request) + override; + + future> AsyncDeleteExecution( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + StatusOr DeleteExecution( + grpc::ClientContext& context, Options options, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request) + override; + + StatusOr + ListExecutionResults( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListExecutionResultsRequest const& + request) override; + + StatusOr ListRules( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListRulesRequest const& request) + override; + + StatusOr + ListScannedResources( + grpc::ClientContext& context, Options const& options, + google::cloud::workloadmanager::v1::ListScannedResourcesRequest 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_; +}; + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeWorkloadManagerTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1_internal +} // namespace cloud +} // namespace google + +#include "google/cloud/ports_undef.inc" + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_INTERNAL_WORKLOAD_MANAGER_TRACING_STUB_H diff --git a/google/cloud/workloadmanager/v1/mocks/mock_workload_manager_connection.h b/google/cloud/workloadmanager/v1/mocks/mock_workload_manager_connection.h new file mode 100644 index 0000000000000..8e7aabaa73601 --- /dev/null +++ b/google/cloud/workloadmanager/v1/mocks/mock_workload_manager_connection.h @@ -0,0 +1,323 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_MOCKS_MOCK_WORKLOAD_MANAGER_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_MOCKS_MOCK_WORKLOAD_MANAGER_CONNECTION_H + +#include "google/cloud/workloadmanager/v1/workload_manager_connection.h" +#include + +namespace google { +namespace cloud { +namespace workloadmanager_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `WorkloadManagerConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `WorkloadManagerClient`. To do so, + * construct an object of type `WorkloadManagerClient` 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 MockWorkloadManagerConnection + : public workloadmanager_v1::WorkloadManagerConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD( + (StreamRange), + ListEvaluations, + (google::cloud::workloadmanager::v1::ListEvaluationsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, GetEvaluation, + (google::cloud::workloadmanager::v1::GetEvaluationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateEvaluation(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateEvaluation, + (google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateEvaluation(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateEvaluation, + (NoAwaitTag, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateEvaluation(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateEvaluation, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateEvaluation(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateEvaluation, + (google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateEvaluation(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateEvaluation, + (NoAwaitTag, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateEvaluation(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateEvaluation, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteEvaluation(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteEvaluation, + (google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteEvaluation(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteEvaluation, + (NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteEvaluation(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteEvaluation, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + (StreamRange), + ListExecutions, + (google::cloud::workloadmanager::v1::ListExecutionsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, GetExecution, + (google::cloud::workloadmanager::v1::GetExecutionRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// RunEvaluation(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + RunEvaluation, + (google::cloud::workloadmanager::v1::RunEvaluationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, RunEvaluation(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, RunEvaluation, + (NoAwaitTag, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, RunEvaluation(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + RunEvaluation, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteExecution(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteExecution, + (google::cloud::workloadmanager::v1::DeleteExecutionRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteExecution(_, _)) + /// @endcode + MOCK_METHOD(StatusOr, DeleteExecution, + (NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteExecution(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteExecution, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + (StreamRange), + ListExecutionResults, + (google::cloud::workloadmanager::v1::ListExecutionResultsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, + ListRules, + (google::cloud::workloadmanager::v1::ListRulesRequest const& request), + (override)); + + MOCK_METHOD( + (StreamRange), + ListScannedResources, + (google::cloud::workloadmanager::v1::ListScannedResourcesRequest request), + (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 workloadmanager_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_MOCKS_MOCK_WORKLOAD_MANAGER_CONNECTION_H diff --git a/google/cloud/workloadmanager/v1/samples/workload_manager_client_samples.cc b/google/cloud/workloadmanager/v1/samples/workload_manager_client_samples.cc new file mode 100644 index 0000000000000..8fbee830d5600 --- /dev/null +++ b/google/cloud/workloadmanager/v1/samples/workload_manager_client_samples.cc @@ -0,0 +1,236 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#include "google/cloud/workloadmanager/v1/workload_manager_client.h" +#include "google/cloud/workloadmanager/v1/workload_manager_connection_idempotency_policy.h" +#include "google/cloud/workloadmanager/v1/workload_manager_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 "google/cloud/universe_domain.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: workloadmanager_v1::WorkloadManagerClient +// 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::workloadmanager_v1::WorkloadManagerClient( + google::cloud::workloadmanager_v1::MakeWorkloadManagerConnection( + options)); + //! [set-client-endpoint] +} + +void SetClientUniverseDomain(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-universe-domain"}; + } + //! [set-client-universe-domain] + google::cloud::Options options; + + // AddUniverseDomainOption interrogates the UnifiedCredentialsOption, if set, + // in the provided Options for the Universe Domain associated with the + // credentials and adds it to the set of Options. + // If no UnifiedCredentialsOption is set, GoogleDefaultCredentials are used. + auto ud_options = google::cloud::AddUniverseDomainOption(std::move(options)); + + if (!ud_options.ok()) throw std::move(ud_options).status(); + auto ud_client = google::cloud::workloadmanager_v1::WorkloadManagerClient( + google::cloud::workloadmanager_v1::MakeWorkloadManagerConnection( + *ud_options)); + //! [set-client-universe-domain] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy : public google::cloud::workloadmanager_v1:: + WorkloadManagerConnectionIdempotencyPolicy { + 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::workloadmanager_v1:: + WorkloadManagerLimitedErrorCountRetryPolicy(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::workloadmanager_v1::MakeWorkloadManagerConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = + google::cloud::workloadmanager_v1::WorkloadManagerClient(connection); + auto c2 = + google::cloud::workloadmanager_v1::WorkloadManagerClient(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::workloadmanager_v1::WorkloadManagerClient( + connection, + google::cloud::Options{} + .set( + google::cloud::workloadmanager_v1:: + WorkloadManagerLimitedTimeRetryPolicy(std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::workloadmanager_v1::WorkloadManagerLimitedErrorCountRetryPolicy(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::workloadmanager_v1:: + WorkloadManagerRetryPolicyOption::Type, + google::cloud::workloadmanager_v1:: + WorkloadManagerBackoffPolicyOption::Type>( + google::cloud::workloadmanager_v1:: + WorkloadManagerLimitedTimeRetryPolicy( + /*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::workloadmanager_v1::MakeWorkloadManagerConnection(options); + + // c1 and c2 share the same polling policies. + auto c1 = + google::cloud::workloadmanager_v1::WorkloadManagerClient(connection); + auto c2 = + google::cloud::workloadmanager_v1::WorkloadManagerClient(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::workloadmanager_v1::WorkloadManagerClient( + google::cloud::workloadmanager_v1::MakeWorkloadManagerConnection( + 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}); + + std::cout << "\nRunning SetClientUniverseDomain() example" << std::endl; + SetClientUniverseDomain({}); +} + +} // 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}, + {"set-client-universe-domain", SetClientUniverseDomain}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/google/cloud/workloadmanager/v1/workload_manager_client.cc b/google/cloud/workloadmanager/v1/workload_manager_client.cc new file mode 100644 index 0000000000000..94ed9665d87c8 --- /dev/null +++ b/google/cloud/workloadmanager/v1/workload_manager_client.cc @@ -0,0 +1,450 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#include "google/cloud/workloadmanager/v1/workload_manager_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace workloadmanager_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WorkloadManagerClient::WorkloadManagerClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +WorkloadManagerClient::~WorkloadManagerClient() = default; + +StreamRange +WorkloadManagerClient::ListEvaluations(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::ListEvaluationsRequest request; + request.set_parent(parent); + return connection_->ListEvaluations(request); +} + +StreamRange +WorkloadManagerClient::ListEvaluations( + google::cloud::workloadmanager::v1::ListEvaluationsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListEvaluations(std::move(request)); +} + +StatusOr +WorkloadManagerClient::GetEvaluation(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::GetEvaluationRequest request; + request.set_name(name); + return connection_->GetEvaluation(request); +} + +StatusOr +WorkloadManagerClient::GetEvaluation( + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetEvaluation(request); +} + +future> +WorkloadManagerClient::CreateEvaluation( + std::string const& parent, + google::cloud::workloadmanager::v1::Evaluation const& evaluation, + std::string const& evaluation_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::CreateEvaluationRequest request; + request.set_parent(parent); + *request.mutable_evaluation() = evaluation; + request.set_evaluation_id(evaluation_id); + return connection_->CreateEvaluation(request); +} + +StatusOr +WorkloadManagerClient::CreateEvaluation( + NoAwaitTag, std::string const& parent, + google::cloud::workloadmanager::v1::Evaluation const& evaluation, + std::string const& evaluation_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::CreateEvaluationRequest request; + request.set_parent(parent); + *request.mutable_evaluation() = evaluation; + request.set_evaluation_id(evaluation_id); + return connection_->CreateEvaluation(NoAwaitTag{}, request); +} + +future> +WorkloadManagerClient::CreateEvaluation( + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateEvaluation(request); +} + +StatusOr +WorkloadManagerClient::CreateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateEvaluation(NoAwaitTag{}, request); +} + +future> +WorkloadManagerClient::CreateEvaluation( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateEvaluation(operation); +} + +future> +WorkloadManagerClient::UpdateEvaluation( + google::cloud::workloadmanager::v1::Evaluation const& evaluation, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::UpdateEvaluationRequest request; + *request.mutable_evaluation() = evaluation; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateEvaluation(request); +} + +StatusOr +WorkloadManagerClient::UpdateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::Evaluation const& evaluation, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::UpdateEvaluationRequest request; + *request.mutable_evaluation() = evaluation; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateEvaluation(NoAwaitTag{}, request); +} + +future> +WorkloadManagerClient::UpdateEvaluation( + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateEvaluation(request); +} + +StatusOr +WorkloadManagerClient::UpdateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateEvaluation(NoAwaitTag{}, request); +} + +future> +WorkloadManagerClient::UpdateEvaluation( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateEvaluation(operation); +} + +future> +WorkloadManagerClient::DeleteEvaluation(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::DeleteEvaluationRequest request; + request.set_name(name); + return connection_->DeleteEvaluation(request); +} + +StatusOr +WorkloadManagerClient::DeleteEvaluation(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::DeleteEvaluationRequest request; + request.set_name(name); + return connection_->DeleteEvaluation(NoAwaitTag{}, request); +} + +future> +WorkloadManagerClient::DeleteEvaluation( + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteEvaluation(request); +} + +StatusOr +WorkloadManagerClient::DeleteEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteEvaluation(NoAwaitTag{}, request); +} + +future> +WorkloadManagerClient::DeleteEvaluation( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteEvaluation(operation); +} + +StreamRange +WorkloadManagerClient::ListExecutions(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::ListExecutionsRequest request; + request.set_parent(parent); + return connection_->ListExecutions(request); +} + +StreamRange +WorkloadManagerClient::ListExecutions( + google::cloud::workloadmanager::v1::ListExecutionsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListExecutions(std::move(request)); +} + +StatusOr +WorkloadManagerClient::GetExecution(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::GetExecutionRequest request; + request.set_name(name); + return connection_->GetExecution(request); +} + +StatusOr +WorkloadManagerClient::GetExecution( + google::cloud::workloadmanager::v1::GetExecutionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetExecution(request); +} + +future> +WorkloadManagerClient::RunEvaluation( + std::string const& name, + google::cloud::workloadmanager::v1::Execution const& execution, + std::string const& execution_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::RunEvaluationRequest request; + request.set_name(name); + *request.mutable_execution() = execution; + request.set_execution_id(execution_id); + return connection_->RunEvaluation(request); +} + +StatusOr WorkloadManagerClient::RunEvaluation( + NoAwaitTag, std::string const& name, + google::cloud::workloadmanager::v1::Execution const& execution, + std::string const& execution_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::RunEvaluationRequest request; + request.set_name(name); + *request.mutable_execution() = execution; + request.set_execution_id(execution_id); + return connection_->RunEvaluation(NoAwaitTag{}, request); +} + +future> +WorkloadManagerClient::RunEvaluation( + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RunEvaluation(request); +} + +StatusOr WorkloadManagerClient::RunEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RunEvaluation(NoAwaitTag{}, request); +} + +future> +WorkloadManagerClient::RunEvaluation( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->RunEvaluation(operation); +} + +future> +WorkloadManagerClient::DeleteExecution(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::DeleteExecutionRequest request; + request.set_name(name); + return connection_->DeleteExecution(request); +} + +StatusOr WorkloadManagerClient::DeleteExecution( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::DeleteExecutionRequest request; + request.set_name(name); + return connection_->DeleteExecution(NoAwaitTag{}, request); +} + +future> +WorkloadManagerClient::DeleteExecution( + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteExecution(request); +} + +StatusOr WorkloadManagerClient::DeleteExecution( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteExecution(NoAwaitTag{}, request); +} + +future> +WorkloadManagerClient::DeleteExecution( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteExecution(operation); +} + +StreamRange +WorkloadManagerClient::ListExecutionResults(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::ListExecutionResultsRequest request; + request.set_parent(parent); + return connection_->ListExecutionResults(request); +} + +StreamRange +WorkloadManagerClient::ListExecutionResults( + google::cloud::workloadmanager::v1::ListExecutionResultsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListExecutionResults(std::move(request)); +} + +StatusOr +WorkloadManagerClient::ListRules(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::ListRulesRequest request; + request.set_parent(parent); + return connection_->ListRules(request); +} + +StatusOr +WorkloadManagerClient::ListRules( + google::cloud::workloadmanager::v1::ListRulesRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListRules(request); +} + +StreamRange +WorkloadManagerClient::ListScannedResources(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::workloadmanager::v1::ListScannedResourcesRequest request; + request.set_parent(parent); + return connection_->ListScannedResources(request); +} + +StreamRange +WorkloadManagerClient::ListScannedResources( + google::cloud::workloadmanager::v1::ListScannedResourcesRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListScannedResources(std::move(request)); +} + +StreamRange +WorkloadManagerClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr WorkloadManagerClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange +WorkloadManagerClient::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 +WorkloadManagerClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr WorkloadManagerClient::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 WorkloadManagerClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status WorkloadManagerClient::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 WorkloadManagerClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status WorkloadManagerClient::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 WorkloadManagerClient::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 workloadmanager_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/workloadmanager/v1/workload_manager_client.h b/google/cloud/workloadmanager/v1/workload_manager_client.h new file mode 100644 index 0000000000000..b427a914839d5 --- /dev/null +++ b/google/cloud/workloadmanager/v1/workload_manager_client.h @@ -0,0 +1,1506 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_WORKLOAD_MANAGER_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_WORKLOAD_MANAGER_CLIENT_H + +#include "google/cloud/workloadmanager/v1/workload_manager_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 "google/longrunning/operations.grpc.pb.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace workloadmanager_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// The Workload Manager provides various tools to deploy, validate and observe +/// your workloads running on Google Cloud. +/// +/// @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 WorkloadManagerClient { + public: + explicit WorkloadManagerClient( + std::shared_ptr connection, Options opts = {}); + ~WorkloadManagerClient(); + + ///@{ + /// @name Copy and move support + WorkloadManagerClient(WorkloadManagerClient const&) = default; + WorkloadManagerClient& operator=(WorkloadManagerClient const&) = default; + WorkloadManagerClient(WorkloadManagerClient&&) = default; + WorkloadManagerClient& operator=(WorkloadManagerClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(WorkloadManagerClient const& a, + WorkloadManagerClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(WorkloadManagerClient const& a, + WorkloadManagerClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Lists Evaluations in a given project and location. + /// + /// @param parent Required. Parent value for ListEvaluationsRequest. + /// @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.workloadmanager.v1.Evaluation], 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.workloadmanager.v1.Evaluation]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L178} + /// [google.cloud.workloadmanager.v1.ListEvaluationsRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L330} + /// + // clang-format on + StreamRange ListEvaluations( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Evaluations 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.workloadmanager.v1.ListEvaluationsRequest]. + /// 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.workloadmanager.v1.Evaluation], 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.workloadmanager.v1.Evaluation]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L178} + /// [google.cloud.workloadmanager.v1.ListEvaluationsRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L330} + /// + // clang-format on + StreamRange ListEvaluations( + google::cloud::workloadmanager::v1::ListEvaluationsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Evaluation. + /// + /// @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.workloadmanager.v1.Evaluation]) + /// 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.workloadmanager.v1.Evaluation]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L178} + /// [google.cloud.workloadmanager.v1.GetEvaluationRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L366} + /// + // clang-format on + StatusOr GetEvaluation( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Evaluation. + /// + /// @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.workloadmanager.v1.GetEvaluationRequest]. + /// 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.workloadmanager.v1.Evaluation]) + /// 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.workloadmanager.v1.Evaluation]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L178} + /// [google.cloud.workloadmanager.v1.GetEvaluationRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L366} + /// + // clang-format on + StatusOr GetEvaluation( + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Evaluation in a given project and location. + /// + /// @param parent Required. The resource prefix of the evaluation location using the form: + /// `projects/{project_id}/locations/{location_id}`. + /// @param evaluation Required. The resource being created. + /// @param evaluation_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.workloadmanager.v1.Evaluation] 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.workloadmanager.v1.CreateEvaluationRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L377} + /// [google.cloud.workloadmanager.v1.Evaluation]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L178} + /// + // clang-format on + future> + CreateEvaluation( + std::string const& parent, + google::cloud::workloadmanager::v1::Evaluation const& evaluation, + std::string const& evaluation_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateEvaluation + /// + /// 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 CreateEvaluation( + NoAwaitTag, std::string const& parent, + google::cloud::workloadmanager::v1::Evaluation const& evaluation, + std::string const& evaluation_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Evaluation 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.workloadmanager.v1.CreateEvaluationRequest]. + /// 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.workloadmanager.v1.Evaluation] 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.workloadmanager.v1.CreateEvaluationRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L377} + /// [google.cloud.workloadmanager.v1.Evaluation]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L178} + /// + // clang-format on + future> + CreateEvaluation( + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateEvaluation + /// + /// 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 CreateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateEvaluation + /// + /// 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> + CreateEvaluation(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Evaluation. + /// + /// @param evaluation Required. The resource being updated. + /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// Evaluation 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. + /// @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.workloadmanager.v1.Evaluation] 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.workloadmanager.v1.Evaluation]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L178} + /// [google.cloud.workloadmanager.v1.UpdateEvaluationRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L410} + /// + // clang-format on + future> + UpdateEvaluation( + google::cloud::workloadmanager::v1::Evaluation const& evaluation, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateEvaluation + /// + /// 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 UpdateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::Evaluation const& evaluation, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Evaluation. + /// + /// @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.workloadmanager.v1.UpdateEvaluationRequest]. + /// 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.workloadmanager.v1.Evaluation] 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.workloadmanager.v1.Evaluation]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L178} + /// [google.cloud.workloadmanager.v1.UpdateEvaluationRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L410} + /// + // clang-format on + future> + UpdateEvaluation( + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateEvaluation + /// + /// 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 UpdateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateEvaluation + /// + /// 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> + UpdateEvaluation(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single Evaluation. + /// + /// @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.workloadmanager.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.workloadmanager.v1.DeleteEvaluationRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L438} + /// [google.cloud.workloadmanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L891} + /// + // clang-format on + future> + DeleteEvaluation(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteEvaluation + /// + /// 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 DeleteEvaluation( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Evaluation. + /// + /// @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.workloadmanager.v1.DeleteEvaluationRequest]. + /// 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.workloadmanager.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.workloadmanager.v1.DeleteEvaluationRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L438} + /// [google.cloud.workloadmanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L891} + /// + // clang-format on + future> + DeleteEvaluation( + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteEvaluation + /// + /// 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 DeleteEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteEvaluation + /// + /// 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> + DeleteEvaluation(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists Executions in a given project and location. + /// + /// @param parent Required. The resource prefix of the Execution using the form: + /// `projects/{project}/locations/{location}/evaluations/{evaluation}`. + /// @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.workloadmanager.v1.Execution], 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.workloadmanager.v1.Execution]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L468} + /// [google.cloud.workloadmanager.v1.ListExecutionsRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L644} + /// + // clang-format on + StreamRange ListExecutions( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Executions 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.workloadmanager.v1.ListExecutionsRequest]. + /// 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.workloadmanager.v1.Execution], 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.workloadmanager.v1.Execution]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L468} + /// [google.cloud.workloadmanager.v1.ListExecutionsRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L644} + /// + // clang-format on + StreamRange ListExecutions( + google::cloud::workloadmanager::v1::ListExecutionsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Execution. + /// + /// @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.workloadmanager.v1.Execution]) + /// 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.workloadmanager.v1.Execution]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L468} + /// [google.cloud.workloadmanager.v1.GetExecutionRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L681} + /// + // clang-format on + StatusOr GetExecution( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Execution. + /// + /// @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.workloadmanager.v1.GetExecutionRequest]. + /// 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.workloadmanager.v1.Execution]) + /// 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.workloadmanager.v1.Execution]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L468} + /// [google.cloud.workloadmanager.v1.GetExecutionRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L681} + /// + // clang-format on + StatusOr GetExecution( + google::cloud::workloadmanager::v1::GetExecutionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Execution in a given project and location. + /// + /// @param name Required. The resource name of the Evaluation using the form: + /// `projects/{project}/locations/{location}/evaluations/{evaluation}`. + /// @param execution Required. The resource being created. + /// @param execution_id Required. ID of the execution which will be created. + /// @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.workloadmanager.v1.Execution] 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.workloadmanager.v1.Execution]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L468} + /// [google.cloud.workloadmanager.v1.RunEvaluationRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L692} + /// + // clang-format on + future> RunEvaluation( + std::string const& name, + google::cloud::workloadmanager::v1::Execution const& execution, + std::string const& execution_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief RunEvaluation + /// + /// 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 RunEvaluation( + NoAwaitTag, std::string const& name, + google::cloud::workloadmanager::v1::Execution const& execution, + std::string const& execution_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Execution 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.workloadmanager.v1.RunEvaluationRequest]. + /// 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.workloadmanager.v1.Execution] 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.workloadmanager.v1.Execution]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L468} + /// [google.cloud.workloadmanager.v1.RunEvaluationRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L692} + /// + // clang-format on + future> RunEvaluation( + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief RunEvaluation + /// + /// 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 RunEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief RunEvaluation + /// + /// 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> RunEvaluation( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Execution. + /// + /// @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.workloadmanager.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.workloadmanager.v1.DeleteExecutionRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L725} + /// [google.cloud.workloadmanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L891} + /// + // clang-format on + future> + DeleteExecution(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteExecution + /// + /// 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 DeleteExecution( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Execution. + /// + /// @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.workloadmanager.v1.DeleteExecutionRequest]. + /// 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.workloadmanager.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.workloadmanager.v1.DeleteExecutionRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L725} + /// [google.cloud.workloadmanager.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L891} + /// + // clang-format on + future> + DeleteExecution( + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteExecution + /// + /// 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 DeleteExecution( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteExecution + /// + /// 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> + DeleteExecution(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists the result of a single evaluation. + /// + /// @param parent Required. The execution results. + /// Format: {parent}/evaluations/*/executions/*/results. + /// @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.workloadmanager.v1.ExecutionResult], 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.workloadmanager.v1.ExecutionResult]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L778} + /// [google.cloud.workloadmanager.v1.ListExecutionResultsRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L751} + /// + // clang-format on + StreamRange + ListExecutionResults(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists the result of a single evaluation. + /// + /// @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.workloadmanager.v1.ListExecutionResultsRequest]. + /// 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.workloadmanager.v1.ExecutionResult], 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.workloadmanager.v1.ExecutionResult]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L778} + /// [google.cloud.workloadmanager.v1.ListExecutionResultsRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L751} + /// + // clang-format on + StreamRange + ListExecutionResults( + google::cloud::workloadmanager::v1::ListExecutionResultsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Lists rules in a given project. + /// + /// @param parent Required. The [project] on which to execute the request. The format is: + /// projects/{project_id}/locations/{location} + /// Currently, the pre-defined rules are global available to all projects and + /// all regions. + /// @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.workloadmanager.v1.ListRulesResponse]) + /// 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.workloadmanager.v1.ListRulesRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L983} + /// [google.cloud.workloadmanager.v1.ListRulesResponse]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L1015} + /// + // clang-format on + StatusOr ListRules( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists rules in a given project. + /// + /// @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.workloadmanager.v1.ListRulesRequest]. + /// 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.workloadmanager.v1.ListRulesResponse]) + /// 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.workloadmanager.v1.ListRulesRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L983} + /// [google.cloud.workloadmanager.v1.ListRulesResponse]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L1015} + /// + // clang-format on + StatusOr ListRules( + google::cloud::workloadmanager::v1::ListRulesRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// List all scanned resources for a single Execution. + /// + /// @param parent Required. Parent for ListScannedResourcesRequest. + /// @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.workloadmanager.v1.ScannedResource], 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.workloadmanager.v1.ListScannedResourcesRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L1021} + /// [google.cloud.workloadmanager.v1.ScannedResource]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L1053} + /// + // clang-format on + StreamRange + ListScannedResources(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// List all scanned resources for a single Execution. + /// + /// @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.workloadmanager.v1.ListScannedResourcesRequest]. + /// 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.workloadmanager.v1.ScannedResource], 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.workloadmanager.v1.ListScannedResourcesRequest]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L1021} + /// [google.cloud.workloadmanager.v1.ScannedResource]: @googleapis_reference_link{google/cloud/workloadmanager/v1/service.proto#L1053} + /// + // clang-format on + StreamRange + ListScannedResources( + google::cloud::workloadmanager::v1::ListScannedResourcesRequest request, + 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#L219} + /// + // 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#L219} + /// + // 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#L212} + /// [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#L37} + /// + // 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#L212} + /// [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#L37} + /// + // 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 workloadmanager_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_WORKLOAD_MANAGER_CLIENT_H diff --git a/google/cloud/workloadmanager/v1/workload_manager_connection.cc b/google/cloud/workloadmanager/v1/workload_manager_connection.cc new file mode 100644 index 0000000000000..9568bbe48444f --- /dev/null +++ b/google/cloud/workloadmanager/v1/workload_manager_connection.cc @@ -0,0 +1,270 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#include "google/cloud/workloadmanager/v1/workload_manager_connection.h" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_connection_impl.h" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_option_defaults.h" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_stub_factory.h" +#include "google/cloud/workloadmanager/v1/internal/workload_manager_tracing_connection.h" +#include "google/cloud/workloadmanager/v1/workload_manager_options.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 workloadmanager_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +WorkloadManagerConnection::~WorkloadManagerConnection() = default; + +StreamRange +WorkloadManagerConnection::ListEvaluations( + google::cloud::workloadmanager::v1:: + ListEvaluationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +WorkloadManagerConnection::GetEvaluation( + google::cloud::workloadmanager::v1::GetEvaluationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +WorkloadManagerConnection::CreateEvaluation( + google::cloud::workloadmanager::v1::CreateEvaluationRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WorkloadManagerConnection::CreateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WorkloadManagerConnection::CreateEvaluation( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WorkloadManagerConnection::UpdateEvaluation( + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WorkloadManagerConnection::UpdateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WorkloadManagerConnection::UpdateEvaluation( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WorkloadManagerConnection::DeleteEvaluation( + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WorkloadManagerConnection::DeleteEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WorkloadManagerConnection::DeleteEvaluation( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +WorkloadManagerConnection::ListExecutions( + google::cloud::workloadmanager::v1:: + ListExecutionsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +WorkloadManagerConnection::GetExecution( + google::cloud::workloadmanager::v1::GetExecutionRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +WorkloadManagerConnection::RunEvaluation( + google::cloud::workloadmanager::v1::RunEvaluationRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WorkloadManagerConnection::RunEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::RunEvaluationRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WorkloadManagerConnection::RunEvaluation( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WorkloadManagerConnection::DeleteExecution( + google::cloud::workloadmanager::v1::DeleteExecutionRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +WorkloadManagerConnection::DeleteExecution( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +WorkloadManagerConnection::DeleteExecution( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +WorkloadManagerConnection::ListExecutionResults( + google::cloud::workloadmanager::v1:: + ListExecutionResultsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +WorkloadManagerConnection::ListRules( + google::cloud::workloadmanager::v1::ListRulesRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +WorkloadManagerConnection::ListScannedResources( + google::cloud::workloadmanager::v1:: + ListScannedResourcesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StreamRange +WorkloadManagerConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +WorkloadManagerConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +WorkloadManagerConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +WorkloadManagerConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status WorkloadManagerConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status WorkloadManagerConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeWorkloadManagerConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = workloadmanager_v1_internal::WorkloadManagerDefaultOptions( + std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = workloadmanager_v1_internal::CreateDefaultWorkloadManagerStub( + std::move(auth), options); + return workloadmanager_v1_internal::MakeWorkloadManagerTracingConnection( + std::make_shared< + workloadmanager_v1_internal::WorkloadManagerConnectionImpl>( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/workloadmanager/v1/workload_manager_connection.h b/google/cloud/workloadmanager/v1/workload_manager_connection.h new file mode 100644 index 0000000000000..dd8720223512c --- /dev/null +++ b/google/cloud/workloadmanager/v1/workload_manager_connection.h @@ -0,0 +1,333 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_WORKLOAD_MANAGER_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_WORKLOAD_MANAGER_CONNECTION_H + +#include "google/cloud/workloadmanager/v1/internal/workload_manager_retry_traits.h" +#include "google/cloud/workloadmanager/v1/service.pb.h" +#include "google/cloud/workloadmanager/v1/workload_manager_connection_idempotency_policy.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 "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace workloadmanager_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `WorkloadManagerConnection`. +class WorkloadManagerRetryPolicy : 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 `WorkloadManagerConnection` 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 WorkloadManagerLimitedErrorCountRetryPolicy + : public WorkloadManagerRetryPolicy { + 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 WorkloadManagerLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + WorkloadManagerLimitedErrorCountRetryPolicy( + WorkloadManagerLimitedErrorCountRetryPolicy&& rhs) noexcept + : WorkloadManagerLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + WorkloadManagerLimitedErrorCountRetryPolicy( + WorkloadManagerLimitedErrorCountRetryPolicy const& rhs) noexcept + : WorkloadManagerLimitedErrorCountRetryPolicy(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 = WorkloadManagerRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + workloadmanager_v1_internal::WorkloadManagerRetryTraits> + impl_; +}; + +/** + * A retry policy for `WorkloadManagerConnection` 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 WorkloadManagerLimitedTimeRetryPolicy + : public WorkloadManagerRetryPolicy { + 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 WorkloadManagerLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + WorkloadManagerLimitedTimeRetryPolicy( + WorkloadManagerLimitedTimeRetryPolicy&& rhs) noexcept + : WorkloadManagerLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + WorkloadManagerLimitedTimeRetryPolicy( + WorkloadManagerLimitedTimeRetryPolicy const& rhs) noexcept + : WorkloadManagerLimitedTimeRetryPolicy(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 = WorkloadManagerRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + workloadmanager_v1_internal::WorkloadManagerRetryTraits> + impl_; +}; + +/** + * The `WorkloadManagerConnection` object for `WorkloadManagerClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `WorkloadManagerClient`. This allows users to inject custom behavior + * (e.g., with a Google Mock object) when writing tests that use objects of type + * `WorkloadManagerClient`. + * + * To create a concrete instance, see `MakeWorkloadManagerConnection()`. + * + * For mocking, see `workloadmanager_v1_mocks::MockWorkloadManagerConnection`. + */ +class WorkloadManagerConnection { + public: + virtual ~WorkloadManagerConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StreamRange + ListEvaluations( + google::cloud::workloadmanager::v1::ListEvaluationsRequest request); + + virtual StatusOr + GetEvaluation( + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request); + + virtual future> + CreateEvaluation( + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request); + + virtual StatusOr CreateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request); + + virtual future> + CreateEvaluation(google::longrunning::Operation const& operation); + + virtual future> + UpdateEvaluation( + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request); + + virtual StatusOr UpdateEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request); + + virtual future> + UpdateEvaluation(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteEvaluation( + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request); + + virtual StatusOr DeleteEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request); + + virtual future< + StatusOr> + DeleteEvaluation(google::longrunning::Operation const& operation); + + virtual StreamRange + ListExecutions( + google::cloud::workloadmanager::v1::ListExecutionsRequest request); + + virtual StatusOr GetExecution( + google::cloud::workloadmanager::v1::GetExecutionRequest const& request); + + virtual future> + RunEvaluation( + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request); + + virtual StatusOr RunEvaluation( + NoAwaitTag, + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request); + + virtual future> + RunEvaluation(google::longrunning::Operation const& operation); + + virtual future< + StatusOr> + DeleteExecution( + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& + request); + + virtual StatusOr DeleteExecution( + NoAwaitTag, + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& + request); + + virtual future< + StatusOr> + DeleteExecution(google::longrunning::Operation const& operation); + + virtual StreamRange + ListExecutionResults( + google::cloud::workloadmanager::v1::ListExecutionResultsRequest request); + + virtual StatusOr + ListRules( + google::cloud::workloadmanager::v1::ListRulesRequest const& request); + + virtual StreamRange + ListScannedResources( + google::cloud::workloadmanager::v1::ListScannedResourcesRequest request); + + 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 + * `WorkloadManagerConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of WorkloadManagerClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `WorkloadManagerConnection`. Expected options are any of the types + * in the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::workloadmanager_v1::WorkloadManagerPolicyOptionList` + * + * @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 `WorkloadManagerConnection` created + * by this function. + */ +std::shared_ptr MakeWorkloadManagerConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_WORKLOAD_MANAGER_CONNECTION_H diff --git a/google/cloud/workloadmanager/v1/workload_manager_connection_idempotency_policy.cc b/google/cloud/workloadmanager/v1/workload_manager_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..62d71c82878e4 --- /dev/null +++ b/google/cloud/workloadmanager/v1/workload_manager_connection_idempotency_policy.cc @@ -0,0 +1,137 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#include "google/cloud/workloadmanager/v1/workload_manager_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace workloadmanager_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +WorkloadManagerConnectionIdempotencyPolicy:: + ~WorkloadManagerConnectionIdempotencyPolicy() = default; + +std::unique_ptr +WorkloadManagerConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::ListEvaluations( + google::cloud::workloadmanager::v1::ListEvaluationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::GetEvaluation( + google::cloud::workloadmanager::v1::GetEvaluationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::CreateEvaluation( + google::cloud::workloadmanager::v1::CreateEvaluationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::UpdateEvaluation( + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::DeleteEvaluation( + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::ListExecutions( + google::cloud::workloadmanager::v1::ListExecutionsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::GetExecution( + google::cloud::workloadmanager::v1::GetExecutionRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::RunEvaluation( + google::cloud::workloadmanager::v1::RunEvaluationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::DeleteExecution( + google::cloud::workloadmanager::v1::DeleteExecutionRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::ListExecutionResults( + google::cloud::workloadmanager::v1:: + ListExecutionResultsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::ListRules( + google::cloud::workloadmanager::v1::ListRulesRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::ListScannedResources( + google::cloud::workloadmanager::v1:: + ListScannedResourcesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency WorkloadManagerConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultWorkloadManagerConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/workloadmanager/v1/workload_manager_connection_idempotency_policy.h b/google/cloud/workloadmanager/v1/workload_manager_connection_idempotency_policy.h new file mode 100644 index 0000000000000..9476b1a08a793 --- /dev/null +++ b/google/cloud/workloadmanager/v1/workload_manager_connection_idempotency_policy.h @@ -0,0 +1,109 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_WORKLOAD_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_WORKLOAD_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/location/locations.grpc.pb.h" +#include "google/cloud/workloadmanager/v1/service.grpc.pb.h" +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include "google/longrunning/operations.grpc.pb.h" +#include + +namespace google { +namespace cloud { +namespace workloadmanager_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class WorkloadManagerConnectionIdempotencyPolicy { + public: + virtual ~WorkloadManagerConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() + const; + + virtual google::cloud::Idempotency ListEvaluations( + google::cloud::workloadmanager::v1::ListEvaluationsRequest request); + + virtual google::cloud::Idempotency GetEvaluation( + google::cloud::workloadmanager::v1::GetEvaluationRequest const& request); + + virtual google::cloud::Idempotency CreateEvaluation( + google::cloud::workloadmanager::v1::CreateEvaluationRequest const& + request); + + virtual google::cloud::Idempotency UpdateEvaluation( + google::cloud::workloadmanager::v1::UpdateEvaluationRequest const& + request); + + virtual google::cloud::Idempotency DeleteEvaluation( + google::cloud::workloadmanager::v1::DeleteEvaluationRequest const& + request); + + virtual google::cloud::Idempotency ListExecutions( + google::cloud::workloadmanager::v1::ListExecutionsRequest request); + + virtual google::cloud::Idempotency GetExecution( + google::cloud::workloadmanager::v1::GetExecutionRequest const& request); + + virtual google::cloud::Idempotency RunEvaluation( + google::cloud::workloadmanager::v1::RunEvaluationRequest const& request); + + virtual google::cloud::Idempotency DeleteExecution( + google::cloud::workloadmanager::v1::DeleteExecutionRequest const& + request); + + virtual google::cloud::Idempotency ListExecutionResults( + google::cloud::workloadmanager::v1::ListExecutionResultsRequest request); + + virtual google::cloud::Idempotency ListRules( + google::cloud::workloadmanager::v1::ListRulesRequest const& request); + + virtual google::cloud::Idempotency ListScannedResources( + google::cloud::workloadmanager::v1::ListScannedResourcesRequest 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 +MakeDefaultWorkloadManagerConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_WORKLOAD_MANAGER_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/workloadmanager/v1/workload_manager_options.h b/google/cloud/workloadmanager/v1/workload_manager_options.h new file mode 100644 index 0000000000000..5a3bc07fa3356 --- /dev/null +++ b/google/cloud/workloadmanager/v1/workload_manager_options.h @@ -0,0 +1,87 @@ +// Copyright 2026 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/workloadmanager/v1/service.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_WORKLOAD_MANAGER_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_WORKLOAD_MANAGER_OPTIONS_H + +#include "google/cloud/workloadmanager/v1/workload_manager_connection.h" +#include "google/cloud/workloadmanager/v1/workload_manager_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 workloadmanager_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-workloadmanager-options + */ +struct WorkloadManagerRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-workloadmanager-options + */ +struct WorkloadManagerBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-workloadmanager-options + */ +struct WorkloadManagerConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-workloadmanager-options + */ +struct WorkloadManagerPollingPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to WorkloadManager. + * + * @ingroup google-cloud-workloadmanager-options + */ +using WorkloadManagerPolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace workloadmanager_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_WORKLOADMANAGER_V1_WORKLOAD_MANAGER_OPTIONS_H diff --git a/google/cloud/workstations/quickstart/.bazelversion b/google/cloud/workstations/quickstart/.bazelversion index e8be68404bcb3..5942a0d3a0e74 100644 --- a/google/cloud/workstations/quickstart/.bazelversion +++ b/google/cloud/workstations/quickstart/.bazelversion @@ -1 +1 @@ -7.6.1 +7.7.1 diff --git a/google/cloud/workstations/quickstart/WORKSPACE.bazel b/google/cloud/workstations/quickstart/WORKSPACE.bazel index 168c08eac687f..35b1655ac4654 100644 --- a/google/cloud/workstations/quickstart/WORKSPACE.bazel +++ b/google/cloud/workstations/quickstart/WORKSPACE.bazel @@ -23,9 +23,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # NOTE: Update this version and SHA256 as needed. http_archive( name = "google_cloud_cpp", - sha256 = "e868bdb537121d2169fbc1ef69b81f4b4f96e97891c4567a6533d4adf62bffde", - strip_prefix = "google-cloud-cpp-3.1.0", - url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.1.0.tar.gz", + sha256 = "79ed6303d5b0c46f627bf8b38b5bd6b007c85e76c88722eb570a495bc2b579a0", + strip_prefix = "google-cloud-cpp-3.2.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v3.2.0.tar.gz", ) load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") diff --git a/google/cloud/workstations/v1/workstations_client.h b/google/cloud/workstations/v1/workstations_client.h index 99b1ead23e8dc..5f63a6c9c9502 100644 --- a/google/cloud/workstations/v1/workstations_client.h +++ b/google/cloud/workstations/v1/workstations_client.h @@ -2335,7 +2335,7 @@ class WorkstationsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation(std::string const& name, Options opts = {}); @@ -2374,7 +2374,7 @@ class WorkstationsClient { /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L212} /// [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} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L37} /// // clang-format on Status CancelOperation( diff --git a/libraries.bzl b/libraries.bzl index e7b75f32f10af..1a895a0f78464 100644 --- a/libraries.bzl +++ b/libraries.bzl @@ -51,6 +51,7 @@ GOOGLE_CLOUD_CPP_GA_LIBRARIES = [ "billing", "binaryauthorization", "certificatemanager", + "ces", "channel", "chronicle", "cloudbuild", @@ -173,6 +174,7 @@ GOOGLE_CLOUD_CPP_GA_LIBRARIES = [ "gkehub", "gkemulticloud", "gkerecommender", + "hypercomputecluster", "iam", "iap", "ids", @@ -245,14 +247,17 @@ GOOGLE_CLOUD_CPP_GA_LIBRARIES = [ "tpu", "trace", "translate", + "vectorsearch", "video", "videointelligence", "vision", + "visionai", "vmmigration", "vmwareengine", "vpcaccess", "webrisk", "websecurityscanner", "workflows", + "workloadmanager", "workstations", ]